aboutsummaryrefslogtreecommitdiff
path: root/speedtest1/main_linux_amd64.go
blob: 37334c17f4fad3be22b7ee138b9b7578f8c28867 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
// Code generated by 'ccgo speedtest1/main_linux_amd64.go testdata/sqlite-src-3330000/test/speedtest1.c -Itestdata/sqlite-amalgamation-3330000 -l modernc.org/sqlite/lib -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -DSQLITE_SOUNDEX -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1 -ccgo-long-double-is-double', DO NOT EDIT.

package main

import (
	"math"
	"reflect"
	"unsafe"

	"modernc.org/libc"
	"modernc.org/sqlite/lib"
)

var _ = math.Pi
var _ reflect.Kind
var _ unsafe.Pointer

func main() { libc.Start(main1) }

// Copyright (C) 1991-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

// Copyright (C) 1991-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//   Copyright (C) 2002-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

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

// Copyright (C) 1992-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

const ( /* ctype.h:46:1: */
	_ISupper  = 256   // UPPERCASE.
	_ISlower  = 512   // lowercase.
	_ISalpha  = 1024  // Alphabetic.
	_ISdigit  = 2048  // Numeric.
	_ISxdigit = 4096  // Hexadecimal numeric.
	_ISspace  = 8192  // Whitespace.
	_ISprint  = 16384 // Printing.
	_ISgraph  = 32768 // Graphical.
	_ISblank  = 1     // Blank (usually SPC and TAB).
	_IScntrl  = 2     // Control character.
	_ISpunct  = 4     // Punctuation.
	_ISalnum  = 8
)

// Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf';
//   the `_SC_*' symbols for the NAME argument to `sysconf';
//   and the `_CS_*' symbols for the NAME argument to `confstr'.
// `sysconf', `pathconf', and `confstr' NAME values.  Generic version.
//   Copyright (C) 1993-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

// Values for the NAME argument to `pathconf' and `fpathconf'.
const ( /* confname.h:24:1: */
	_PC_LINK_MAX           = 0
	_PC_MAX_CANON          = 1
	_PC_MAX_INPUT          = 2
	_PC_NAME_MAX           = 3
	_PC_PATH_MAX           = 4
	_PC_PIPE_BUF           = 5
	_PC_CHOWN_RESTRICTED   = 6
	_PC_NO_TRUNC           = 7
	_PC_VDISABLE           = 8
	_PC_SYNC_IO            = 9
	_PC_ASYNC_IO           = 10
	_PC_PRIO_IO            = 11
	_PC_SOCK_MAXBUF        = 12
	_PC_FILESIZEBITS       = 13
	_PC_REC_INCR_XFER_SIZE = 14
	_PC_REC_MAX_XFER_SIZE  = 15
	_PC_REC_MIN_XFER_SIZE  = 16
	_PC_REC_XFER_ALIGN     = 17
	_PC_ALLOC_SIZE_MIN     = 18
	_PC_SYMLINK_MAX        = 19
	_PC_2_SYMLINKS         = 20
)

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

	_CS_V6_WIDTH_RESTRICTED_ENVS = 1

	_CS_GNU_LIBC_VERSION       = 2
	_CS_GNU_LIBPTHREAD_VERSION = 3

	_CS_V5_WIDTH_RESTRICTED_ENVS = 4

	_CS_V7_WIDTH_RESTRICTED_ENVS = 5

	_CS_LFS_CFLAGS      = 1000
	_CS_LFS_LDFLAGS     = 1001
	_CS_LFS_LIBS        = 1002
	_CS_LFS_LINTFLAGS   = 1003
	_CS_LFS64_CFLAGS    = 1004
	_CS_LFS64_LDFLAGS   = 1005
	_CS_LFS64_LIBS      = 1006
	_CS_LFS64_LINTFLAGS = 1007

	_CS_XBS5_ILP32_OFF32_CFLAGS     = 1100
	_CS_XBS5_ILP32_OFF32_LDFLAGS    = 1101
	_CS_XBS5_ILP32_OFF32_LIBS       = 1102
	_CS_XBS5_ILP32_OFF32_LINTFLAGS  = 1103
	_CS_XBS5_ILP32_OFFBIG_CFLAGS    = 1104
	_CS_XBS5_ILP32_OFFBIG_LDFLAGS   = 1105
	_CS_XBS5_ILP32_OFFBIG_LIBS      = 1106
	_CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 1107
	_CS_XBS5_LP64_OFF64_CFLAGS      = 1108
	_CS_XBS5_LP64_OFF64_LDFLAGS     = 1109
	_CS_XBS5_LP64_OFF64_LIBS        = 1110
	_CS_XBS5_LP64_OFF64_LINTFLAGS   = 1111
	_CS_XBS5_LPBIG_OFFBIG_CFLAGS    = 1112
	_CS_XBS5_LPBIG_OFFBIG_LDFLAGS   = 1113
	_CS_XBS5_LPBIG_OFFBIG_LIBS      = 1114
	_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 1115

	_CS_POSIX_V6_ILP32_OFF32_CFLAGS     = 1116
	_CS_POSIX_V6_ILP32_OFF32_LDFLAGS    = 1117
	_CS_POSIX_V6_ILP32_OFF32_LIBS       = 1118
	_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS  = 1119
	_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS    = 1120
	_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS   = 1121
	_CS_POSIX_V6_ILP32_OFFBIG_LIBS      = 1122
	_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123
	_CS_POSIX_V6_LP64_OFF64_CFLAGS      = 1124
	_CS_POSIX_V6_LP64_OFF64_LDFLAGS     = 1125
	_CS_POSIX_V6_LP64_OFF64_LIBS        = 1126
	_CS_POSIX_V6_LP64_OFF64_LINTFLAGS   = 1127
	_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS    = 1128
	_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS   = 1129
	_CS_POSIX_V6_LPBIG_OFFBIG_LIBS      = 1130
	_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131

	_CS_POSIX_V7_ILP32_OFF32_CFLAGS     = 1132
	_CS_POSIX_V7_ILP32_OFF32_LDFLAGS    = 1133
	_CS_POSIX_V7_ILP32_OFF32_LIBS       = 1134
	_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS  = 1135
	_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS    = 1136
	_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS   = 1137
	_CS_POSIX_V7_ILP32_OFFBIG_LIBS      = 1138
	_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139
	_CS_POSIX_V7_LP64_OFF64_CFLAGS      = 1140
	_CS_POSIX_V7_LP64_OFF64_LDFLAGS     = 1141
	_CS_POSIX_V7_LP64_OFF64_LIBS        = 1142
	_CS_POSIX_V7_LP64_OFF64_LINTFLAGS   = 1143
	_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS    = 1144
	_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS   = 1145
	_CS_POSIX_V7_LPBIG_OFFBIG_LIBS      = 1146
	_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147

	_CS_V6_ENV = 1148
	_CS_V7_ENV = 1149
)

// Values for the argument to `sysconf'.
const ( /* confname.h:71:1: */
	_SC_ARG_MAX               = 0
	_SC_CHILD_MAX             = 1
	_SC_CLK_TCK               = 2
	_SC_NGROUPS_MAX           = 3
	_SC_OPEN_MAX              = 4
	_SC_STREAM_MAX            = 5
	_SC_TZNAME_MAX            = 6
	_SC_JOB_CONTROL           = 7
	_SC_SAVED_IDS             = 8
	_SC_REALTIME_SIGNALS      = 9
	_SC_PRIORITY_SCHEDULING   = 10
	_SC_TIMERS                = 11
	_SC_ASYNCHRONOUS_IO       = 12
	_SC_PRIORITIZED_IO        = 13
	_SC_SYNCHRONIZED_IO       = 14
	_SC_FSYNC                 = 15
	_SC_MAPPED_FILES          = 16
	_SC_MEMLOCK               = 17
	_SC_MEMLOCK_RANGE         = 18
	_SC_MEMORY_PROTECTION     = 19
	_SC_MESSAGE_PASSING       = 20
	_SC_SEMAPHORES            = 21
	_SC_SHARED_MEMORY_OBJECTS = 22
	_SC_AIO_LISTIO_MAX        = 23
	_SC_AIO_MAX               = 24
	_SC_AIO_PRIO_DELTA_MAX    = 25
	_SC_DELAYTIMER_MAX        = 26
	_SC_MQ_OPEN_MAX           = 27
	_SC_MQ_PRIO_MAX           = 28
	_SC_VERSION               = 29
	_SC_PAGESIZE              = 30
	_SC_RTSIG_MAX             = 31
	_SC_SEM_NSEMS_MAX         = 32
	_SC_SEM_VALUE_MAX         = 33
	_SC_SIGQUEUE_MAX          = 34
	_SC_TIMER_MAX             = 35

	// Values for the argument to `sysconf'
	//       corresponding to _POSIX2_* symbols.
	_SC_BC_BASE_MAX        = 36
	_SC_BC_DIM_MAX         = 37
	_SC_BC_SCALE_MAX       = 38
	_SC_BC_STRING_MAX      = 39
	_SC_COLL_WEIGHTS_MAX   = 40
	_SC_EQUIV_CLASS_MAX    = 41
	_SC_EXPR_NEST_MAX      = 42
	_SC_LINE_MAX           = 43
	_SC_RE_DUP_MAX         = 44
	_SC_CHARCLASS_NAME_MAX = 45

	_SC_2_VERSION   = 46
	_SC_2_C_BIND    = 47
	_SC_2_C_DEV     = 48
	_SC_2_FORT_DEV  = 49
	_SC_2_FORT_RUN  = 50
	_SC_2_SW_DEV    = 51
	_SC_2_LOCALEDEF = 52

	_SC_PII                 = 53
	_SC_PII_XTI             = 54
	_SC_PII_SOCKET          = 55
	_SC_PII_INTERNET        = 56
	_SC_PII_OSI             = 57
	_SC_POLL                = 58
	_SC_SELECT              = 59
	_SC_UIO_MAXIOV          = 60
	_SC_IOV_MAX             = 60
	_SC_PII_INTERNET_STREAM = 61
	_SC_PII_INTERNET_DGRAM  = 62
	_SC_PII_OSI_COTS        = 63
	_SC_PII_OSI_CLTS        = 64
	_SC_PII_OSI_M           = 65
	_SC_T_IOV_MAX           = 66

	// Values according to POSIX 1003.1c (POSIX threads).
	_SC_THREADS                      = 67
	_SC_THREAD_SAFE_FUNCTIONS        = 68
	_SC_GETGR_R_SIZE_MAX             = 69
	_SC_GETPW_R_SIZE_MAX             = 70
	_SC_LOGIN_NAME_MAX               = 71
	_SC_TTY_NAME_MAX                 = 72
	_SC_THREAD_DESTRUCTOR_ITERATIONS = 73
	_SC_THREAD_KEYS_MAX              = 74
	_SC_THREAD_STACK_MIN             = 75
	_SC_THREAD_THREADS_MAX           = 76
	_SC_THREAD_ATTR_STACKADDR        = 77
	_SC_THREAD_ATTR_STACKSIZE        = 78
	_SC_THREAD_PRIORITY_SCHEDULING   = 79
	_SC_THREAD_PRIO_INHERIT          = 80
	_SC_THREAD_PRIO_PROTECT          = 81
	_SC_THREAD_PROCESS_SHARED        = 82

	_SC_NPROCESSORS_CONF = 83
	_SC_NPROCESSORS_ONLN = 84
	_SC_PHYS_PAGES       = 85
	_SC_AVPHYS_PAGES     = 86
	_SC_ATEXIT_MAX       = 87
	_SC_PASS_MAX         = 88

	_SC_XOPEN_VERSION     = 89
	_SC_XOPEN_XCU_VERSION = 90
	_SC_XOPEN_UNIX        = 91
	_SC_XOPEN_CRYPT       = 92
	_SC_XOPEN_ENH_I18N    = 93
	_SC_XOPEN_SHM         = 94

	_SC_2_CHAR_TERM = 95
	_SC_2_C_VERSION = 96
	_SC_2_UPE       = 97

	_SC_XOPEN_XPG2 = 98
	_SC_XOPEN_XPG3 = 99
	_SC_XOPEN_XPG4 = 100

	_SC_CHAR_BIT   = 101
	_SC_CHAR_MAX   = 102
	_SC_CHAR_MIN   = 103
	_SC_INT_MAX    = 104
	_SC_INT_MIN    = 105
	_SC_LONG_BIT   = 106
	_SC_WORD_BIT   = 107
	_SC_MB_LEN_MAX = 108
	_SC_NZERO      = 109
	_SC_SSIZE_MAX  = 110
	_SC_SCHAR_MAX  = 111
	_SC_SCHAR_MIN  = 112
	_SC_SHRT_MAX   = 113
	_SC_SHRT_MIN   = 114
	_SC_UCHAR_MAX  = 115
	_SC_UINT_MAX   = 116
	_SC_ULONG_MAX  = 117
	_SC_USHRT_MAX  = 118

	_SC_NL_ARGMAX  = 119
	_SC_NL_LANGMAX = 120
	_SC_NL_MSGMAX  = 121
	_SC_NL_NMAX    = 122
	_SC_NL_SETMAX  = 123
	_SC_NL_TEXTMAX = 124

	_SC_XBS5_ILP32_OFF32  = 125
	_SC_XBS5_ILP32_OFFBIG = 126
	_SC_XBS5_LP64_OFF64   = 127
	_SC_XBS5_LPBIG_OFFBIG = 128

	_SC_XOPEN_LEGACY           = 129
	_SC_XOPEN_REALTIME         = 130
	_SC_XOPEN_REALTIME_THREADS = 131

	_SC_ADVISORY_INFO          = 132
	_SC_BARRIERS               = 133
	_SC_BASE                   = 134
	_SC_C_LANG_SUPPORT         = 135
	_SC_C_LANG_SUPPORT_R       = 136
	_SC_CLOCK_SELECTION        = 137
	_SC_CPUTIME                = 138
	_SC_THREAD_CPUTIME         = 139
	_SC_DEVICE_IO              = 140
	_SC_DEVICE_SPECIFIC        = 141
	_SC_DEVICE_SPECIFIC_R      = 142
	_SC_FD_MGMT                = 143
	_SC_FIFO                   = 144
	_SC_PIPE                   = 145
	_SC_FILE_ATTRIBUTES        = 146
	_SC_FILE_LOCKING           = 147
	_SC_FILE_SYSTEM            = 148
	_SC_MONOTONIC_CLOCK        = 149
	_SC_MULTI_PROCESS          = 150
	_SC_SINGLE_PROCESS         = 151
	_SC_NETWORKING             = 152
	_SC_READER_WRITER_LOCKS    = 153
	_SC_SPIN_LOCKS             = 154
	_SC_REGEXP                 = 155
	_SC_REGEX_VERSION          = 156
	_SC_SHELL                  = 157
	_SC_SIGNALS                = 158
	_SC_SPAWN                  = 159
	_SC_SPORADIC_SERVER        = 160
	_SC_THREAD_SPORADIC_SERVER = 161
	_SC_SYSTEM_DATABASE        = 162
	_SC_SYSTEM_DATABASE_R      = 163
	_SC_TIMEOUTS               = 164
	_SC_TYPED_MEMORY_OBJECTS   = 165
	_SC_USER_GROUPS            = 166
	_SC_USER_GROUPS_R          = 167
	_SC_2_PBS                  = 168
	_SC_2_PBS_ACCOUNTING       = 169
	_SC_2_PBS_LOCATE           = 170
	_SC_2_PBS_MESSAGE          = 171
	_SC_2_PBS_TRACK            = 172
	_SC_SYMLOOP_MAX            = 173
	_SC_STREAMS                = 174
	_SC_2_PBS_CHECKPOINT       = 175

	_SC_V6_ILP32_OFF32  = 176
	_SC_V6_ILP32_OFFBIG = 177
	_SC_V6_LP64_OFF64   = 178
	_SC_V6_LPBIG_OFFBIG = 179

	_SC_HOST_NAME_MAX      = 180
	_SC_TRACE              = 181
	_SC_TRACE_EVENT_FILTER = 182
	_SC_TRACE_INHERIT      = 183
	_SC_TRACE_LOG          = 184

	_SC_LEVEL1_ICACHE_SIZE     = 185
	_SC_LEVEL1_ICACHE_ASSOC    = 186
	_SC_LEVEL1_ICACHE_LINESIZE = 187
	_SC_LEVEL1_DCACHE_SIZE     = 188
	_SC_LEVEL1_DCACHE_ASSOC    = 189
	_SC_LEVEL1_DCACHE_LINESIZE = 190
	_SC_LEVEL2_CACHE_SIZE      = 191
	_SC_LEVEL2_CACHE_ASSOC     = 192
	_SC_LEVEL2_CACHE_LINESIZE  = 193
	_SC_LEVEL3_CACHE_SIZE      = 194
	_SC_LEVEL3_CACHE_ASSOC     = 195
	_SC_LEVEL3_CACHE_LINESIZE  = 196
	_SC_LEVEL4_CACHE_SIZE      = 197
	_SC_LEVEL4_CACHE_ASSOC     = 198
	_SC_LEVEL4_CACHE_LINESIZE  = 199
	// Leave room here, maybe we need a few more cache levels some day.

	_SC_IPV6        = 235
	_SC_RAW_SOCKETS = 236

	_SC_V7_ILP32_OFF32  = 237
	_SC_V7_ILP32_OFFBIG = 238
	_SC_V7_LP64_OFF64   = 239
	_SC_V7_LPBIG_OFFBIG = 240

	_SC_SS_REPL_MAX = 241

	_SC_TRACE_EVENT_NAME_MAX = 242
	_SC_TRACE_NAME_MAX       = 243
	_SC_TRACE_SYS_MAX        = 244
	_SC_TRACE_USER_EVENT_MAX = 245

	_SC_XOPEN_STREAMS = 246

	_SC_THREAD_ROBUST_PRIO_INHERIT = 247
	_SC_THREAD_ROBUST_PRIO_PROTECT = 248
)

//  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
//    are already defined.
//  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
//  NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.

// A null pointer constant.

// XPG requires a few symbols from <sys/wait.h> being defined.
// Definitions of flag bits for `waitpid' et al.
//   Copyright (C) 1992-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

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

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

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

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

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

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

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

// A program for performance testing.
//
// The available command-line options are described below:
var zHelp = *(*[2146]int8)(unsafe.Pointer(ts /* "Usage: %s [--opt..." */)) /* speedtest1.c:6:19 */

// Define the standard macros for the user,
//   if this invocation was from the user program.

// Define va_list, if desired, from __gnuc_va_list.
// We deliberately do not define va_list when called from
//   stdio.h, because ANSI C says that stdio.h is not supposed to define
//   va_list.  stdio.h needs to have access to that data type,
//   but must not use that name.  It should use the name __gnuc_va_list,
//   which is safe because it is reserved for the implementation.

// The macro _VA_LIST_ is the same thing used by this file in Ultrix.
//   But on BSD NET2 we must not test or define or undef it.
//   (Note that the comments in NET 2's ansi.h
//   are incorrect for _VA_LIST_--see stdio.h!)
// The macro _VA_LIST_DEFINED is used in Windows NT 3.5
// The macro _VA_LIST is used in SCO Unix 3.2.
// The macro _VA_LIST_T_H is used in the Bull dpx2
// The macro __va_list__ is used by BeOS.
type va_list = uintptr /* stdarg.h:99:24 */

// CAPI3REF: 64-Bit Integer Types
// KEYWORDS: sqlite_int64 sqlite_uint64
//
// Because there is no cross-platform way to specify 64-bit integer types
// SQLite includes typedefs for 64-bit signed and unsigned integers.
//
// The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions.
// The sqlite_int64 and sqlite_uint64 types are supported for backwards
// compatibility only.
//
// ^The sqlite3_int64 and sqlite_int64 types can store integer values
// between -9223372036854775808 and +9223372036854775807 inclusive.  ^The
// sqlite3_uint64 and sqlite_uint64 types can store integer values
// between 0 and +18446744073709551615 inclusive.
type sqlite_int64 = int64           /* sqlite3.h:278:25 */
type sqlite_uint64 = uint64         /* sqlite3.h:279:34 */
type sqlite3_int64 = sqlite_int64   /* sqlite3.h:281:22 */
type sqlite3_uint64 = sqlite_uint64 /* sqlite3.h:282:23 */

// The type for a callback function.
// This is legacy and deprecated.  It is included for historical
// compatibility and is not documented.
type sqlite3_callback = uintptr /* sqlite3.h:338:13 */

// CAPI3REF: Result Codes
// KEYWORDS: {result code definitions}
//
// Many SQLite functions return an integer result code from the set shown
// here in order to indicate success or failure.
//
// New error codes may be added in future versions of SQLite.
//
// See also: [extended result code definitions]
// beginning-of-error-codes
// end-of-error-codes

// CAPI3REF: Extended Result Codes
// KEYWORDS: {extended result code definitions}
//
// In its default configuration, SQLite API routines return one of 30 integer
// [result codes].  However, experience has shown that many of
// these result codes are too coarse-grained.  They do not provide as
// much information about problems as programmers might like.  In an effort to
// address this, newer versions of SQLite (version 3.3.8 [dateof:3.3.8]
// and later) include
// support for additional result codes that provide more detailed information
// about errors. These [extended result codes] are enabled or disabled
// on a per database connection basis using the
// [sqlite3_extended_result_codes()] API.  Or, the extended code for
// the most recent error can be obtained using
// [sqlite3_extended_errcode()].

// CAPI3REF: Flags For File Open Operations
//
// These bit values are intended for use in the
// 3rd parameter to the [sqlite3_open_v2()] interface and
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.

// Reserved:                         0x00F00000
// Legacy compatibility:

// CAPI3REF: Device Characteristics
//
// The xDeviceCharacteristics method of the [sqlite3_io_methods]
// object returns an integer which is a vector of these
// bit values expressing I/O characteristics of the mass storage
// device that holds the file that the [sqlite3_io_methods]
// refers to.
//
// The SQLITE_IOCAP_ATOMIC property means that all writes of
// any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
// mean that writes of blocks that are nnn bytes in size and
// are aligned to an address which is an integer multiple of
// nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
// that when data is appended to a file, the data is appended
// first then the size of the file is extended, never the other
// way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
// information is written to disk in the same order as calls
// to xWrite().  The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that
// after reboot following a crash or power loss, the only bytes in a
// file that were written at the application level might have changed
// and that adjacent bytes, even bytes within the same sector are
// guaranteed to be unchanged.  The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN
// flag indicates that a file cannot be deleted when open.  The
// SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on
// read-only media and cannot be changed even by processes with
// elevated privileges.
//
// The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying
// filesystem supports doing multiple write operations atomically when those
// write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
// [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].

// CAPI3REF: File Locking Levels
//
// SQLite uses one of these integer values as the second
// argument to calls it makes to the xLock() and xUnlock() methods
// of an [sqlite3_io_methods] object.

// CAPI3REF: Synchronization Type Flags
//
// When SQLite invokes the xSync() method of an
// [sqlite3_io_methods] object it uses a combination of
// these integer values as the second argument.
//
// When the SQLITE_SYNC_DATAONLY flag is used, it means that the
// sync operation only needs to flush data to mass storage.  Inode
// information need not be flushed. If the lower four bits of the flag
// equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics.
// If the lower four bits equal SQLITE_SYNC_FULL, that means
// to use Mac OS X style fullsync instead of fsync().
//
// Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags
// with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL
// settings.  The [synchronous pragma] determines when calls to the
// xSync VFS method occur and applies uniformly across all platforms.
// The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how
// energetic or rigorous or forceful the sync operations are and
// only make a difference on Mac OSX for the default SQLite code.
// (Third-party VFS implementations might also make the distinction
// between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the
// operating systems natively supported by SQLite, only Mac OSX
// cares about the difference.)

// CAPI3REF: OS Interface Open File Handle
//
// An [sqlite3_file] object represents an open file in the
// [sqlite3_vfs | OS interface layer].  Individual OS interface
// implementations will
// want to subclass this object by appending additional fields
// for their own use.  The pMethods entry is a pointer to an
// [sqlite3_io_methods] object that defines methods for performing
// I/O operations on the open file.
type sqlite3_file1 = struct{ pMethods uintptr }

// CAPI3REF: Result Codes
// KEYWORDS: {result code definitions}
//
// Many SQLite functions return an integer result code from the set shown
// here in order to indicate success or failure.
//
// New error codes may be added in future versions of SQLite.
//
// See also: [extended result code definitions]
// beginning-of-error-codes
// end-of-error-codes

// CAPI3REF: Extended Result Codes
// KEYWORDS: {extended result code definitions}
//
// In its default configuration, SQLite API routines return one of 30 integer
// [result codes].  However, experience has shown that many of
// these result codes are too coarse-grained.  They do not provide as
// much information about problems as programmers might like.  In an effort to
// address this, newer versions of SQLite (version 3.3.8 [dateof:3.3.8]
// and later) include
// support for additional result codes that provide more detailed information
// about errors. These [extended result codes] are enabled or disabled
// on a per database connection basis using the
// [sqlite3_extended_result_codes()] API.  Or, the extended code for
// the most recent error can be obtained using
// [sqlite3_extended_errcode()].

// CAPI3REF: Flags For File Open Operations
//
// These bit values are intended for use in the
// 3rd parameter to the [sqlite3_open_v2()] interface and
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.

// Reserved:                         0x00F00000
// Legacy compatibility:

// CAPI3REF: Device Characteristics
//
// The xDeviceCharacteristics method of the [sqlite3_io_methods]
// object returns an integer which is a vector of these
// bit values expressing I/O characteristics of the mass storage
// device that holds the file that the [sqlite3_io_methods]
// refers to.
//
// The SQLITE_IOCAP_ATOMIC property means that all writes of
// any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
// mean that writes of blocks that are nnn bytes in size and
// are aligned to an address which is an integer multiple of
// nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
// that when data is appended to a file, the data is appended
// first then the size of the file is extended, never the other
// way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
// information is written to disk in the same order as calls
// to xWrite().  The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that
// after reboot following a crash or power loss, the only bytes in a
// file that were written at the application level might have changed
// and that adjacent bytes, even bytes within the same sector are
// guaranteed to be unchanged.  The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN
// flag indicates that a file cannot be deleted when open.  The
// SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on
// read-only media and cannot be changed even by processes with
// elevated privileges.
//
// The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying
// filesystem supports doing multiple write operations atomically when those
// write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
// [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].

// CAPI3REF: File Locking Levels
//
// SQLite uses one of these integer values as the second
// argument to calls it makes to the xLock() and xUnlock() methods
// of an [sqlite3_io_methods] object.

// CAPI3REF: Synchronization Type Flags
//
// When SQLite invokes the xSync() method of an
// [sqlite3_io_methods] object it uses a combination of
// these integer values as the second argument.
//
// When the SQLITE_SYNC_DATAONLY flag is used, it means that the
// sync operation only needs to flush data to mass storage.  Inode
// information need not be flushed. If the lower four bits of the flag
// equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics.
// If the lower four bits equal SQLITE_SYNC_FULL, that means
// to use Mac OS X style fullsync instead of fsync().
//
// Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags
// with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL
// settings.  The [synchronous pragma] determines when calls to the
// xSync VFS method occur and applies uniformly across all platforms.
// The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how
// energetic or rigorous or forceful the sync operations are and
// only make a difference on Mac OSX for the default SQLite code.
// (Third-party VFS implementations might also make the distinction
// between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the
// operating systems natively supported by SQLite, only Mac OSX
// cares about the difference.)

// CAPI3REF: OS Interface Open File Handle
//
// An [sqlite3_file] object represents an open file in the
// [sqlite3_vfs | OS interface layer].  Individual OS interface
// implementations will
// want to subclass this object by appending additional fields
// for their own use.  The pMethods entry is a pointer to an
// [sqlite3_io_methods] object that defines methods for performing
// I/O operations on the open file.
type sqlite3_file = sqlite3_file1 /* sqlite3.h:683:29 */
type sqlite3_io_methods1 = struct {
	iVersion               int32
	xClose                 uintptr
	xRead                  uintptr
	xWrite                 uintptr
	xTruncate              uintptr
	xSync                  uintptr
	xFileSize              uintptr
	xLock                  uintptr
	xUnlock                uintptr
	xCheckReservedLock     uintptr
	xFileControl           uintptr
	xSectorSize            uintptr
	xDeviceCharacteristics uintptr
	xShmMap                uintptr
	xShmLock               uintptr
	xShmBarrier            uintptr
	xShmUnmap              uintptr
	xFetch                 uintptr
	xUnfetch               uintptr
}

// CAPI3REF: OS Interface File Virtual Methods Object
//
// Every file opened by the [sqlite3_vfs.xOpen] method populates an
// [sqlite3_file] object (or, more commonly, a subclass of the
// [sqlite3_file] object) with a pointer to an instance of this object.
// This object defines the methods used to perform various operations
// against the open file represented by the [sqlite3_file] object.
//
// If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element
// to a non-NULL pointer, then the sqlite3_io_methods.xClose method
// may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed.  The
// only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen]
// is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element
// to NULL.
//
// The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or
// [SQLITE_SYNC_FULL].  The first choice is the normal fsync().
// The second choice is a Mac OS X style fullsync.  The [SQLITE_SYNC_DATAONLY]
// flag may be ORed in to indicate that only the data of the file
// and not its inode needs to be synced.
//
// The integer values to xLock() and xUnlock() are one of
// <ul>
// <li> [SQLITE_LOCK_NONE],
// <li> [SQLITE_LOCK_SHARED],
// <li> [SQLITE_LOCK_RESERVED],
// <li> [SQLITE_LOCK_PENDING], or
// <li> [SQLITE_LOCK_EXCLUSIVE].
// </ul>
// xLock() increases the lock. xUnlock() decreases the lock.
// The xCheckReservedLock() method checks whether any database connection,
// either in this process or in some other process, is holding a RESERVED,
// PENDING, or EXCLUSIVE lock on the file.  It returns true
// if such a lock exists and false otherwise.
//
// The xFileControl() method is a generic interface that allows custom
// VFS implementations to directly control an open file using the
// [sqlite3_file_control()] interface.  The second "op" argument is an
// integer opcode.  The third argument is a generic pointer intended to
// point to a structure that may contain arguments or space in which to
// write return values.  Potential uses for xFileControl() might be
// functions to enable blocking locks with timeouts, to change the
// locking strategy (for example to use dot-file locks), to inquire
// about the status of a lock, or to break stale locks.  The SQLite
// core reserves all opcodes less than 100 for its own use.
// A [file control opcodes | list of opcodes] less than 100 is available.
// Applications that define a custom xFileControl method should use opcodes
// greater than 100 to avoid conflicts.  VFS implementations should
// return [SQLITE_NOTFOUND] for file control opcodes that they do not
// recognize.
//
// The xSectorSize() method returns the sector size of the
// device that underlies the file.  The sector size is the
// minimum write that can be performed without disturbing
// other bytes in the file.  The xDeviceCharacteristics()
// method returns a bit vector describing behaviors of the
// underlying device:
//
// <ul>
// <li> [SQLITE_IOCAP_ATOMIC]
// <li> [SQLITE_IOCAP_ATOMIC512]
// <li> [SQLITE_IOCAP_ATOMIC1K]
// <li> [SQLITE_IOCAP_ATOMIC2K]
// <li> [SQLITE_IOCAP_ATOMIC4K]
// <li> [SQLITE_IOCAP_ATOMIC8K]
// <li> [SQLITE_IOCAP_ATOMIC16K]
// <li> [SQLITE_IOCAP_ATOMIC32K]
// <li> [SQLITE_IOCAP_ATOMIC64K]
// <li> [SQLITE_IOCAP_SAFE_APPEND]
// <li> [SQLITE_IOCAP_SEQUENTIAL]
// <li> [SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN]
// <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE]
// <li> [SQLITE_IOCAP_IMMUTABLE]
// <li> [SQLITE_IOCAP_BATCH_ATOMIC]
// </ul>
//
// The SQLITE_IOCAP_ATOMIC property means that all writes of
// any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
// mean that writes of blocks that are nnn bytes in size and
// are aligned to an address which is an integer multiple of
// nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
// that when data is appended to a file, the data is appended
// first then the size of the file is extended, never the other
// way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
// information is written to disk in the same order as calls
// to xWrite().
//
// If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill
// in the unread portions of the buffer with zeros.  A VFS that
// fails to zero-fill short reads might seem to work.  However,
// failure to zero-fill short reads will eventually lead to
// database corruption.
type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:782:35 */

// CAPI3REF: OS Interface Object
//
// An instance of the sqlite3_vfs object defines the interface between
// the SQLite core and the underlying operating system.  The "vfs"
// in the name of the object stands for "virtual file system".  See
// the [VFS | VFS documentation] for further information.
//
// The VFS interface is sometimes extended by adding new methods onto
// the end.  Each time such an extension occurs, the iVersion field
// is incremented.  The iVersion value started out as 1 in
// SQLite [version 3.5.0] on [dateof:3.5.0], then increased to 2
// with SQLite [version 3.7.0] on [dateof:3.7.0], and then increased
// to 3 with SQLite [version 3.7.6] on [dateof:3.7.6].  Additional fields
// may be appended to the sqlite3_vfs object and the iVersion value
// may increase again in future versions of SQLite.
// Note that due to an oversight, the structure
// of the sqlite3_vfs object changed in the transition from
// SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0]
// and yet the iVersion field was not increased.
//
// The szOsFile field is the size of the subclassed [sqlite3_file]
// structure used by this VFS.  mxPathname is the maximum length of
// a pathname in this VFS.
//
// Registered sqlite3_vfs objects are kept on a linked list formed by
// the pNext pointer.  The [sqlite3_vfs_register()]
// and [sqlite3_vfs_unregister()] interfaces manage this list
// in a thread-safe way.  The [sqlite3_vfs_find()] interface
// searches the list.  Neither the application code nor the VFS
// implementation should use the pNext pointer.
//
// The pNext field is the only field in the sqlite3_vfs
// structure that SQLite will ever modify.  SQLite will only access
// or modify this field while holding a particular static mutex.
// The application should never modify anything within the sqlite3_vfs
// object once the object has been registered.
//
// The zName field holds the name of the VFS module.  The name must
// be unique across all VFS modules.
//
// [[sqlite3_vfs.xOpen]]
// ^SQLite guarantees that the zFilename parameter to xOpen
// is either a NULL pointer or string obtained
// from xFullPathname() with an optional suffix added.
// ^If a suffix is added to the zFilename parameter, it will
// consist of a single "-" character followed by no more than
// 11 alphanumeric and/or "-" characters.
// ^SQLite further guarantees that
// the string will be valid and unchanged until xClose() is
// called. Because of the previous sentence,
// the [sqlite3_file] can safely store a pointer to the
// filename if it needs to remember the filename for some reason.
// If the zFilename parameter to xOpen is a NULL pointer then xOpen
// must invent its own temporary name for the file.  ^Whenever the
// xFilename parameter is NULL it will also be the case that the
// flags parameter will include [SQLITE_OPEN_DELETEONCLOSE].
//
// The flags argument to xOpen() includes all bits set in
// the flags argument to [sqlite3_open_v2()].  Or if [sqlite3_open()]
// or [sqlite3_open16()] is used, then flags includes at least
// [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE].
// If xOpen() opens a file read-only then it sets *pOutFlags to
// include [SQLITE_OPEN_READONLY].  Other bits in *pOutFlags may be set.
//
// ^(SQLite will also add one of the following flags to the xOpen()
// call, depending on the object being opened:
//
// <ul>
// <li>  [SQLITE_OPEN_MAIN_DB]
// <li>  [SQLITE_OPEN_MAIN_JOURNAL]
// <li>  [SQLITE_OPEN_TEMP_DB]
// <li>  [SQLITE_OPEN_TEMP_JOURNAL]
// <li>  [SQLITE_OPEN_TRANSIENT_DB]
// <li>  [SQLITE_OPEN_SUBJOURNAL]
// <li>  [SQLITE_OPEN_SUPER_JOURNAL]
// <li>  [SQLITE_OPEN_WAL]
// </ul>)^
//
// The file I/O implementation can use the object type flags to
// change the way it deals with files.  For example, an application
// that does not care about crash recovery or rollback might make
// the open of a journal file a no-op.  Writes to this journal would
// also be no-ops, and any attempt to read the journal would return
// SQLITE_IOERR.  Or the implementation might recognize that a database
// file will be doing page-aligned sector reads and writes in a random
// order and set up its I/O subsystem accordingly.
//
// SQLite might also add one of the following flags to the xOpen method:
//
// <ul>
// <li> [SQLITE_OPEN_DELETEONCLOSE]
// <li> [SQLITE_OPEN_EXCLUSIVE]
// </ul>
//
// The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be
// deleted when it is closed.  ^The [SQLITE_OPEN_DELETEONCLOSE]
// will be set for TEMP databases and their journals, transient
// databases, and subjournals.
//
// ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction
// with the [SQLITE_OPEN_CREATE] flag, which are both directly
// analogous to the O_EXCL and O_CREAT flags of the POSIX open()
// API.  The SQLITE_OPEN_EXCLUSIVE flag, when paired with the
// SQLITE_OPEN_CREATE, is used to indicate that file should always
// be created, and that it is an error if it already exists.
// It is <i>not</i> used to indicate the file should be opened
// for exclusive access.
//
// ^At least szOsFile bytes of memory are allocated by SQLite
// to hold the [sqlite3_file] structure passed as the third
// argument to xOpen.  The xOpen method does not have to
// allocate the structure; it should just fill it in.  Note that
// the xOpen method must set the sqlite3_file.pMethods to either
// a valid [sqlite3_io_methods] object or to NULL.  xOpen must do
// this even if the open fails.  SQLite expects that the sqlite3_file.pMethods
// element will be valid after xOpen returns regardless of the success
// or failure of the xOpen call.
//
// [[sqlite3_vfs.xAccess]]
// ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
// to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
// test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
// to test whether a file is at least readable.  The SQLITE_ACCESS_READ
// flag is never actually used and is not implemented in the built-in
// VFSes of SQLite.  The file is named by the second argument and can be a
// directory. The xAccess method returns [SQLITE_OK] on success or some
// non-zero error code if there is an I/O error or if the name of
// the file given in the second argument is illegal.  If SQLITE_OK
// is returned, then non-zero or zero is written into *pResOut to indicate
// whether or not the file is accessible.
//
// ^SQLite will always allocate at least mxPathname+1 bytes for the
// output buffer xFullPathname.  The exact size of the output buffer
// is also passed as a parameter to both  methods. If the output buffer
// is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
// handled as a fatal error by SQLite, vfs implementations should endeavor
// to prevent this by setting mxPathname to a sufficiently large value.
//
// The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64()
// interfaces are not strictly a part of the filesystem, but they are
// included in the VFS structure for completeness.
// The xRandomness() function attempts to return nBytes bytes
// of good-quality randomness into zOut.  The return value is
// the actual number of bytes of randomness obtained.
// The xSleep() method causes the calling thread to sleep for at
// least the number of microseconds given.  ^The xCurrentTime()
// method returns a Julian Day Number for the current date and time as
// a floating point value.
// ^The xCurrentTimeInt64() method returns, as an integer, the Julian
// Day Number multiplied by 86400000 (the number of milliseconds in
// a 24-hour day).
// ^SQLite will use the xCurrentTimeInt64() method to get the current
// date and time if that method is available (if iVersion is 2 or
// greater and the function pointer is not NULL) and will fall back
// to xCurrentTime() if xCurrentTimeInt64() is unavailable.
//
// ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces
// are not used by the SQLite core.  These optional interfaces are provided
// by some VFSes to facilitate testing of the VFS code. By overriding
// system calls with functions under its control, a test program can
// simulate faults and error conditions that would otherwise be difficult
// or impossible to induce.  The set of system calls that can be overridden
// varies from one VFS to another, and from one version of the same VFS to the
// next.  Applications that use these interfaces must be prepared for any
// or all of these interfaces to be NULL or for their behavior to change
// from one release to the next.  Applications must not attempt to access
// any of these methods if the iVersion of the VFS is less than 3.
type sqlite3_vfs1 = struct {
	iVersion          int32
	szOsFile          int32
	mxPathname        int32
	pNext             uintptr
	zName             uintptr
	pAppData          uintptr
	xOpen             uintptr
	xDelete           uintptr
	xAccess           uintptr
	xFullPathname     uintptr
	xDlOpen           uintptr
	xDlError          uintptr
	xDlSym            uintptr
	xDlClose          uintptr
	xRandomness       uintptr
	xSleep            uintptr
	xCurrentTime      uintptr
	xGetLastError     uintptr
	xCurrentTimeInt64 uintptr
	xSetSystemCall    uintptr
	xGetSystemCall    uintptr
	xNextSystemCall   uintptr
}

// CAPI3REF: OS Interface Object
//
// An instance of the sqlite3_vfs object defines the interface between
// the SQLite core and the underlying operating system.  The "vfs"
// in the name of the object stands for "virtual file system".  See
// the [VFS | VFS documentation] for further information.
//
// The VFS interface is sometimes extended by adding new methods onto
// the end.  Each time such an extension occurs, the iVersion field
// is incremented.  The iVersion value started out as 1 in
// SQLite [version 3.5.0] on [dateof:3.5.0], then increased to 2
// with SQLite [version 3.7.0] on [dateof:3.7.0], and then increased
// to 3 with SQLite [version 3.7.6] on [dateof:3.7.6].  Additional fields
// may be appended to the sqlite3_vfs object and the iVersion value
// may increase again in future versions of SQLite.
// Note that due to an oversight, the structure
// of the sqlite3_vfs object changed in the transition from
// SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0]
// and yet the iVersion field was not increased.
//
// The szOsFile field is the size of the subclassed [sqlite3_file]
// structure used by this VFS.  mxPathname is the maximum length of
// a pathname in this VFS.
//
// Registered sqlite3_vfs objects are kept on a linked list formed by
// the pNext pointer.  The [sqlite3_vfs_register()]
// and [sqlite3_vfs_unregister()] interfaces manage this list
// in a thread-safe way.  The [sqlite3_vfs_find()] interface
// searches the list.  Neither the application code nor the VFS
// implementation should use the pNext pointer.
//
// The pNext field is the only field in the sqlite3_vfs
// structure that SQLite will ever modify.  SQLite will only access
// or modify this field while holding a particular static mutex.
// The application should never modify anything within the sqlite3_vfs
// object once the object has been registered.
//
// The zName field holds the name of the VFS module.  The name must
// be unique across all VFS modules.
//
// [[sqlite3_vfs.xOpen]]
// ^SQLite guarantees that the zFilename parameter to xOpen
// is either a NULL pointer or string obtained
// from xFullPathname() with an optional suffix added.
// ^If a suffix is added to the zFilename parameter, it will
// consist of a single "-" character followed by no more than
// 11 alphanumeric and/or "-" characters.
// ^SQLite further guarantees that
// the string will be valid and unchanged until xClose() is
// called. Because of the previous sentence,
// the [sqlite3_file] can safely store a pointer to the
// filename if it needs to remember the filename for some reason.
// If the zFilename parameter to xOpen is a NULL pointer then xOpen
// must invent its own temporary name for the file.  ^Whenever the
// xFilename parameter is NULL it will also be the case that the
// flags parameter will include [SQLITE_OPEN_DELETEONCLOSE].
//
// The flags argument to xOpen() includes all bits set in
// the flags argument to [sqlite3_open_v2()].  Or if [sqlite3_open()]
// or [sqlite3_open16()] is used, then flags includes at least
// [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE].
// If xOpen() opens a file read-only then it sets *pOutFlags to
// include [SQLITE_OPEN_READONLY].  Other bits in *pOutFlags may be set.
//
// ^(SQLite will also add one of the following flags to the xOpen()
// call, depending on the object being opened:
//
// <ul>
// <li>  [SQLITE_OPEN_MAIN_DB]
// <li>  [SQLITE_OPEN_MAIN_JOURNAL]
// <li>  [SQLITE_OPEN_TEMP_DB]
// <li>  [SQLITE_OPEN_TEMP_JOURNAL]
// <li>  [SQLITE_OPEN_TRANSIENT_DB]
// <li>  [SQLITE_OPEN_SUBJOURNAL]
// <li>  [SQLITE_OPEN_SUPER_JOURNAL]
// <li>  [SQLITE_OPEN_WAL]
// </ul>)^
//
// The file I/O implementation can use the object type flags to
// change the way it deals with files.  For example, an application
// that does not care about crash recovery or rollback might make
// the open of a journal file a no-op.  Writes to this journal would
// also be no-ops, and any attempt to read the journal would return
// SQLITE_IOERR.  Or the implementation might recognize that a database
// file will be doing page-aligned sector reads and writes in a random
// order and set up its I/O subsystem accordingly.
//
// SQLite might also add one of the following flags to the xOpen method:
//
// <ul>
// <li> [SQLITE_OPEN_DELETEONCLOSE]
// <li> [SQLITE_OPEN_EXCLUSIVE]
// </ul>
//
// The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be
// deleted when it is closed.  ^The [SQLITE_OPEN_DELETEONCLOSE]
// will be set for TEMP databases and their journals, transient
// databases, and subjournals.
//
// ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction
// with the [SQLITE_OPEN_CREATE] flag, which are both directly
// analogous to the O_EXCL and O_CREAT flags of the POSIX open()
// API.  The SQLITE_OPEN_EXCLUSIVE flag, when paired with the
// SQLITE_OPEN_CREATE, is used to indicate that file should always
// be created, and that it is an error if it already exists.
// It is <i>not</i> used to indicate the file should be opened
// for exclusive access.
//
// ^At least szOsFile bytes of memory are allocated by SQLite
// to hold the [sqlite3_file] structure passed as the third
// argument to xOpen.  The xOpen method does not have to
// allocate the structure; it should just fill it in.  Note that
// the xOpen method must set the sqlite3_file.pMethods to either
// a valid [sqlite3_io_methods] object or to NULL.  xOpen must do
// this even if the open fails.  SQLite expects that the sqlite3_file.pMethods
// element will be valid after xOpen returns regardless of the success
// or failure of the xOpen call.
//
// [[sqlite3_vfs.xAccess]]
// ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
// to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
// test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
// to test whether a file is at least readable.  The SQLITE_ACCESS_READ
// flag is never actually used and is not implemented in the built-in
// VFSes of SQLite.  The file is named by the second argument and can be a
// directory. The xAccess method returns [SQLITE_OK] on success or some
// non-zero error code if there is an I/O error or if the name of
// the file given in the second argument is illegal.  If SQLITE_OK
// is returned, then non-zero or zero is written into *pResOut to indicate
// whether or not the file is accessible.
//
// ^SQLite will always allocate at least mxPathname+1 bytes for the
// output buffer xFullPathname.  The exact size of the output buffer
// is also passed as a parameter to both  methods. If the output buffer
// is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
// handled as a fatal error by SQLite, vfs implementations should endeavor
// to prevent this by setting mxPathname to a sufficiently large value.
//
// The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64()
// interfaces are not strictly a part of the filesystem, but they are
// included in the VFS structure for completeness.
// The xRandomness() function attempts to return nBytes bytes
// of good-quality randomness into zOut.  The return value is
// the actual number of bytes of randomness obtained.
// The xSleep() method causes the calling thread to sleep for at
// least the number of microseconds given.  ^The xCurrentTime()
// method returns a Julian Day Number for the current date and time as
// a floating point value.
// ^The xCurrentTimeInt64() method returns, as an integer, the Julian
// Day Number multiplied by 86400000 (the number of milliseconds in
// a 24-hour day).
// ^SQLite will use the xCurrentTimeInt64() method to get the current
// date and time if that method is available (if iVersion is 2 or
// greater and the function pointer is not NULL) and will fall back
// to xCurrentTime() if xCurrentTimeInt64() is unavailable.
//
// ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces
// are not used by the SQLite core.  These optional interfaces are provided
// by some VFSes to facilitate testing of the VFS code. By overriding
// system calls with functions under its control, a test program can
// simulate faults and error conditions that would otherwise be difficult
// or impossible to induce.  The set of system calls that can be overridden
// varies from one VFS to another, and from one version of the same VFS to the
// next.  Applications that use these interfaces must be prepared for any
// or all of these interfaces to be NULL or for their behavior to change
// from one release to the next.  Applications must not attempt to access
// any of these methods if the iVersion of the VFS is less than 3.
type sqlite3_vfs = sqlite3_vfs1    /* sqlite3.h:1367:28 */
type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1368:14 */

// CAPI3REF: Memory Allocation Routines
//
// An instance of this object defines the interface between SQLite
// and low-level memory allocation routines.
//
// This object is used in only one place in the SQLite interface.
// A pointer to an instance of this object is the argument to
// [sqlite3_config()] when the configuration option is
// [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC].
// By creating an instance of this object
// and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC])
// during configuration, an application can specify an alternative
// memory allocation subsystem for SQLite to use for all of its
// dynamic memory needs.
//
// Note that SQLite comes with several [built-in memory allocators]
// that are perfectly adequate for the overwhelming majority of applications
// and that this object is only useful to a tiny minority of applications
// with specialized memory allocation requirements.  This object is
// also used during testing of SQLite in order to specify an alternative
// memory allocator that simulates memory out-of-memory conditions in
// order to verify that SQLite recovers gracefully from such
// conditions.
//
// The xMalloc, xRealloc, and xFree methods must work like the
// malloc(), realloc() and free() functions from the standard C library.
// ^SQLite guarantees that the second argument to
// xRealloc is always a value returned by a prior call to xRoundup.
//
// xSize should return the allocated size of a memory allocation
// previously obtained from xMalloc or xRealloc.  The allocated size
// is always at least as big as the requested size but may be larger.
//
// The xRoundup method returns what would be the allocated size of
// a memory allocation given a particular requested size.  Most memory
// allocators round up memory allocations at least to the next multiple
// of 8.  Some allocators round up to a larger multiple or to a power of 2.
// Every memory allocation request coming in through [sqlite3_malloc()]
// or [sqlite3_realloc()] first calls xRoundup.  If xRoundup returns 0,
// that causes the corresponding memory allocation to fail.
//
// The xInit method initializes the memory allocator.  For example,
// it might allocate any required mutexes or initialize internal data
// structures.  The xShutdown method is invoked (indirectly) by
// [sqlite3_shutdown()] and should deallocate any resources acquired
// by xInit.  The pAppData pointer is used as the only parameter to
// xInit and xShutdown.
//
// SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
// the xInit method, so the xInit method need not be threadsafe.  The
// xShutdown method is only called from [sqlite3_shutdown()] so it does
// not need to be threadsafe either.  For all other methods, SQLite
// holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the
// [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which
// it is by default) and so the methods are automatically serialized.
// However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other
// methods must be threadsafe or else make their own arrangements for
// serialization.
//
// SQLite will never invoke xInit() more than once without an intervening
// call to xShutdown().
type sqlite3_mem_methods1 = struct {
	xMalloc   uintptr
	xFree     uintptr
	xRealloc  uintptr
	xSize     uintptr
	xRoundup  uintptr
	xInit     uintptr
	xShutdown uintptr
	pAppData  uintptr
}

// CAPI3REF: Memory Allocation Routines
//
// An instance of this object defines the interface between SQLite
// and low-level memory allocation routines.
//
// This object is used in only one place in the SQLite interface.
// A pointer to an instance of this object is the argument to
// [sqlite3_config()] when the configuration option is
// [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC].
// By creating an instance of this object
// and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC])
// during configuration, an application can specify an alternative
// memory allocation subsystem for SQLite to use for all of its
// dynamic memory needs.
//
// Note that SQLite comes with several [built-in memory allocators]
// that are perfectly adequate for the overwhelming majority of applications
// and that this object is only useful to a tiny minority of applications
// with specialized memory allocation requirements.  This object is
// also used during testing of SQLite in order to specify an alternative
// memory allocator that simulates memory out-of-memory conditions in
// order to verify that SQLite recovers gracefully from such
// conditions.
//
// The xMalloc, xRealloc, and xFree methods must work like the
// malloc(), realloc() and free() functions from the standard C library.
// ^SQLite guarantees that the second argument to
// xRealloc is always a value returned by a prior call to xRoundup.
//
// xSize should return the allocated size of a memory allocation
// previously obtained from xMalloc or xRealloc.  The allocated size
// is always at least as big as the requested size but may be larger.
//
// The xRoundup method returns what would be the allocated size of
// a memory allocation given a particular requested size.  Most memory
// allocators round up memory allocations at least to the next multiple
// of 8.  Some allocators round up to a larger multiple or to a power of 2.
// Every memory allocation request coming in through [sqlite3_malloc()]
// or [sqlite3_realloc()] first calls xRoundup.  If xRoundup returns 0,
// that causes the corresponding memory allocation to fail.
//
// The xInit method initializes the memory allocator.  For example,
// it might allocate any required mutexes or initialize internal data
// structures.  The xShutdown method is invoked (indirectly) by
// [sqlite3_shutdown()] and should deallocate any resources acquired
// by xInit.  The pAppData pointer is used as the only parameter to
// xInit and xShutdown.
//
// SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
// the xInit method, so the xInit method need not be threadsafe.  The
// xShutdown method is only called from [sqlite3_shutdown()] so it does
// not need to be threadsafe either.  For all other methods, SQLite
// holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the
// [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which
// it is by default) and so the methods are automatically serialized.
// However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other
// methods must be threadsafe or else make their own arrangements for
// serialization.
//
// SQLite will never invoke xInit() more than once without an intervening
// call to xShutdown().
type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1665:36 */

// CAPI3REF: Constants Defining Special Destructor Behavior
//
// These are special values for the destructor that is passed in as the
// final argument to routines like [sqlite3_result_blob()].  ^If the destructor
// argument is SQLITE_STATIC, it means that the content pointer is constant
// and will never change.  It does not need to be destroyed.  ^The
// SQLITE_TRANSIENT value means that the content will likely change in
// the near future and that SQLite should make its own private copy of
// the content before returning.
//
// The typedef is necessary to work around problems in certain
// C++ compilers.
type sqlite3_destructor_type = uintptr /* sqlite3.h:5621:14 */

// The interface to the virtual-table mechanism is currently considered
// to be experimental.  The interface might change in incompatible ways.
// If this is a problem for you, do not use the interface at this time.
//
// When the virtual-table mechanism stabilizes, we will declare the
// interface fixed, support it indefinitely, and remove this comment.

// Structures used by the virtual table interface
type sqlite3_vtab1 = struct {
	pModule uintptr
	nRef    int32
	zErrMsg uintptr
}

// The interface to the virtual-table mechanism is currently considered
// to be experimental.  The interface might change in incompatible ways.
// If this is a problem for you, do not use the interface at this time.
//
// When the virtual-table mechanism stabilizes, we will declare the
// interface fixed, support it indefinitely, and remove this comment.

// Structures used by the virtual table interface
type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6689:29 */
type sqlite3_index_info1 = struct {
	nConstraint      int32
	aConstraint      uintptr
	nOrderBy         int32
	aOrderBy         uintptr
	aConstraintUsage uintptr
	idxNum           int32
	idxStr           uintptr
	needToFreeIdxStr int32
	orderByConsumed  int32
	estimatedCost    float64
	estimatedRows    sqlite3_int64
	idxFlags         int32
	colUsed          sqlite3_uint64
}

type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6690:35 */
type sqlite3_vtab_cursor1 = struct{ pVtab uintptr }

type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6691:36 */
type sqlite3_module1 = struct {
	iVersion      int32
	xCreate       uintptr
	xConnect      uintptr
	xBestIndex    uintptr
	xDisconnect   uintptr
	xDestroy      uintptr
	xOpen         uintptr
	xClose        uintptr
	xFilter       uintptr
	xNext         uintptr
	xEof          uintptr
	xColumn       uintptr
	xRowid        uintptr
	xUpdate       uintptr
	xBegin        uintptr
	xSync         uintptr
	xCommit       uintptr
	xRollback     uintptr
	xFindFunction uintptr
	xRename       uintptr
	xSavepoint    uintptr
	xRelease      uintptr
	xRollbackTo   uintptr
	xShadowName   uintptr
}

type sqlite3_module = sqlite3_module1 /* sqlite3.h:6692:31 */

// CAPI3REF: Virtual Table Indexing Information
// KEYWORDS: sqlite3_index_info
//
// The sqlite3_index_info structure and its substructures is used as part
// of the [virtual table] interface to
// pass information into and receive the reply from the [xBestIndex]
// method of a [virtual table module].  The fields under **Inputs** are the
// inputs to xBestIndex and are read-only.  xBestIndex inserts its
// results into the **Outputs** fields.
//
// ^(The aConstraint[] array records WHERE clause constraints of the form:
//
// <blockquote>column OP expr</blockquote>
//
// where OP is =, &lt;, &lt;=, &gt;, or &gt;=.)^  ^(The particular operator is
// stored in aConstraint[].op using one of the
// [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^
// ^(The index of the column is stored in
// aConstraint[].iColumn.)^  ^(aConstraint[].usable is TRUE if the
// expr on the right-hand side can be evaluated (and thus the constraint
// is usable) and false if it cannot.)^
//
// ^The optimizer automatically inverts terms of the form "expr OP column"
// and makes other simplifications to the WHERE clause in an attempt to
// get as many WHERE clause terms into the form shown above as possible.
// ^The aConstraint[] array only reports WHERE clause terms that are
// relevant to the particular virtual table being queried.
//
// ^Information about the ORDER BY clause is stored in aOrderBy[].
// ^Each term of aOrderBy records a column of the ORDER BY clause.
//
// The colUsed field indicates which columns of the virtual table may be
// required by the current scan. Virtual table columns are numbered from
// zero in the order in which they appear within the CREATE TABLE statement
// passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62),
// the corresponding bit is set within the colUsed mask if the column may be
// required by SQLite. If the table has at least 64 columns and any column
// to the right of the first 63 is required, then bit 63 of colUsed is also
// set. In other words, column iCol may be required if the expression
// (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to
// non-zero.
//
// The [xBestIndex] method must fill aConstraintUsage[] with information
// about what parameters to pass to xFilter.  ^If argvIndex>0 then
// the right-hand side of the corresponding aConstraint[] is evaluated
// and becomes the argvIndex-th entry in argv.  ^(If aConstraintUsage[].omit
// is true, then the constraint is assumed to be fully handled by the
// virtual table and might not be checked again by the byte code.)^ ^(The
// aConstraintUsage[].omit flag is an optimization hint. When the omit flag
// is left in its default setting of false, the constraint will always be
// checked separately in byte code.  If the omit flag is change to true, then
// the constraint may or may not be checked in byte code.  In other words,
// when the omit flag is true there is no guarantee that the constraint will
// not be checked again using byte code.)^
//
// ^The idxNum and idxPtr values are recorded and passed into the
// [xFilter] method.
// ^[sqlite3_free()] is used to free idxPtr if and only if
// needToFreeIdxPtr is true.
//
// ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in
// the correct order to satisfy the ORDER BY clause so that no separate
// sorting step is required.
//
// ^The estimatedCost value is an estimate of the cost of a particular
// strategy. A cost of N indicates that the cost of the strategy is similar
// to a linear scan of an SQLite table with N rows. A cost of log(N)
// indicates that the expense of the operation is similar to that of a
// binary search on a unique indexed field of an SQLite table with N rows.
//
// ^The estimatedRows value is an estimate of the number of rows that
// will be returned by the strategy.
//
// The xBestIndex method may optionally populate the idxFlags field with a
// mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag -
// SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite
// assumes that the strategy may visit at most one row.
//
// Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then
// SQLite also assumes that if a call to the xUpdate() method is made as
// part of the same statement to delete or update a virtual table row and the
// implementation returns SQLITE_CONSTRAINT, then there is no need to rollback
// any database changes. In other words, if the xUpdate() returns
// SQLITE_CONSTRAINT, the database contents must be exactly as they were
// before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not
// set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by
// the xUpdate method are automatically rolled back by SQLite.
//
// IMPORTANT: The estimatedRows field was added to the sqlite3_index_info
// structure for SQLite [version 3.8.2] ([dateof:3.8.2]).
// If a virtual table extension is
// used with an SQLite version earlier than 3.8.2, the results of attempting
// to read or write the estimatedRows field are undefined (but are likely
// to include crashing the application). The estimatedRows field should
// therefore only be used if [sqlite3_libversion_number()] returns a
// value greater than or equal to 3008002. Similarly, the idxFlags field
// was added for [version 3.9.0] ([dateof:3.9.0]).
// It may therefore only be used if
// sqlite3_libversion_number() returns a value greater than or equal to
// 3009000.
type sqlite3_index_constraint = struct {
	iColumn     int32
	op          uint8
	usable      uint8
	iTermOffset int32
}

// CAPI3REF: Virtual Table Indexing Information
// KEYWORDS: sqlite3_index_info
//
// The sqlite3_index_info structure and its substructures is used as part
// of the [virtual table] interface to
// pass information into and receive the reply from the [xBestIndex]
// method of a [virtual table module].  The fields under **Inputs** are the
// inputs to xBestIndex and are read-only.  xBestIndex inserts its
// results into the **Outputs** fields.
//
// ^(The aConstraint[] array records WHERE clause constraints of the form:
//
// <blockquote>column OP expr</blockquote>
//
// where OP is =, &lt;, &lt;=, &gt;, or &gt;=.)^  ^(The particular operator is
// stored in aConstraint[].op using one of the
// [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^
// ^(The index of the column is stored in
// aConstraint[].iColumn.)^  ^(aConstraint[].usable is TRUE if the
// expr on the right-hand side can be evaluated (and thus the constraint
// is usable) and false if it cannot.)^
//
// ^The optimizer automatically inverts terms of the form "expr OP column"
// and makes other simplifications to the WHERE clause in an attempt to
// get as many WHERE clause terms into the form shown above as possible.
// ^The aConstraint[] array only reports WHERE clause terms that are
// relevant to the particular virtual table being queried.
//
// ^Information about the ORDER BY clause is stored in aOrderBy[].
// ^Each term of aOrderBy records a column of the ORDER BY clause.
//
// The colUsed field indicates which columns of the virtual table may be
// required by the current scan. Virtual table columns are numbered from
// zero in the order in which they appear within the CREATE TABLE statement
// passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62),
// the corresponding bit is set within the colUsed mask if the column may be
// required by SQLite. If the table has at least 64 columns and any column
// to the right of the first 63 is required, then bit 63 of colUsed is also
// set. In other words, column iCol may be required if the expression
// (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to
// non-zero.
//
// The [xBestIndex] method must fill aConstraintUsage[] with information
// about what parameters to pass to xFilter.  ^If argvIndex>0 then
// the right-hand side of the corresponding aConstraint[] is evaluated
// and becomes the argvIndex-th entry in argv.  ^(If aConstraintUsage[].omit
// is true, then the constraint is assumed to be fully handled by the
// virtual table and might not be checked again by the byte code.)^ ^(The
// aConstraintUsage[].omit flag is an optimization hint. When the omit flag
// is left in its default setting of false, the constraint will always be
// checked separately in byte code.  If the omit flag is change to true, then
// the constraint may or may not be checked in byte code.  In other words,
// when the omit flag is true there is no guarantee that the constraint will
// not be checked again using byte code.)^
//
// ^The idxNum and idxPtr values are recorded and passed into the
// [xFilter] method.
// ^[sqlite3_free()] is used to free idxPtr if and only if
// needToFreeIdxPtr is true.
//
// ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in
// the correct order to satisfy the ORDER BY clause so that no separate
// sorting step is required.
//
// ^The estimatedCost value is an estimate of the cost of a particular
// strategy. A cost of N indicates that the cost of the strategy is similar
// to a linear scan of an SQLite table with N rows. A cost of log(N)
// indicates that the expense of the operation is similar to that of a
// binary search on a unique indexed field of an SQLite table with N rows.
//
// ^The estimatedRows value is an estimate of the number of rows that
// will be returned by the strategy.
//
// The xBestIndex method may optionally populate the idxFlags field with a
// mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag -
// SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite
// assumes that the strategy may visit at most one row.
//
// Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then
// SQLite also assumes that if a call to the xUpdate() method is made as
// part of the same statement to delete or update a virtual table row and the
// implementation returns SQLITE_CONSTRAINT, then there is no need to rollback
// any database changes. In other words, if the xUpdate() returns
// SQLITE_CONSTRAINT, the database contents must be exactly as they were
// before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not
// set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by
// the xUpdate method are automatically rolled back by SQLite.
//
// IMPORTANT: The estimatedRows field was added to the sqlite3_index_info
// structure for SQLite [version 3.8.2] ([dateof:3.8.2]).
// If a virtual table extension is
// used with an SQLite version earlier than 3.8.2, the results of attempting
// to read or write the estimatedRows field are undefined (but are likely
// to include crashing the application). The estimatedRows field should
// therefore only be used if [sqlite3_libversion_number()] returns a
// value greater than or equal to 3008002. Similarly, the idxFlags field
// was added for [version 3.9.0] ([dateof:3.9.0]).
// It may therefore only be used if
// sqlite3_libversion_number() returns a value greater than or equal to
// 3009000.
type sqlite3_index_orderby = struct {
	iColumn int32
	desc    uint8
	_       [3]byte
}

// CAPI3REF: Virtual Table Indexing Information
// KEYWORDS: sqlite3_index_info
//
// The sqlite3_index_info structure and its substructures is used as part
// of the [virtual table] interface to
// pass information into and receive the reply from the [xBestIndex]
// method of a [virtual table module].  The fields under **Inputs** are the
// inputs to xBestIndex and are read-only.  xBestIndex inserts its
// results into the **Outputs** fields.
//
// ^(The aConstraint[] array records WHERE clause constraints of the form:
//
// <blockquote>column OP expr</blockquote>
//
// where OP is =, &lt;, &lt;=, &gt;, or &gt;=.)^  ^(The particular operator is
// stored in aConstraint[].op using one of the
// [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^
// ^(The index of the column is stored in
// aConstraint[].iColumn.)^  ^(aConstraint[].usable is TRUE if the
// expr on the right-hand side can be evaluated (and thus the constraint
// is usable) and false if it cannot.)^
//
// ^The optimizer automatically inverts terms of the form "expr OP column"
// and makes other simplifications to the WHERE clause in an attempt to
// get as many WHERE clause terms into the form shown above as possible.
// ^The aConstraint[] array only reports WHERE clause terms that are
// relevant to the particular virtual table being queried.
//
// ^Information about the ORDER BY clause is stored in aOrderBy[].
// ^Each term of aOrderBy records a column of the ORDER BY clause.
//
// The colUsed field indicates which columns of the virtual table may be
// required by the current scan. Virtual table columns are numbered from
// zero in the order in which they appear within the CREATE TABLE statement
// passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62),
// the corresponding bit is set within the colUsed mask if the column may be
// required by SQLite. If the table has at least 64 columns and any column
// to the right of the first 63 is required, then bit 63 of colUsed is also
// set. In other words, column iCol may be required if the expression
// (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to
// non-zero.
//
// The [xBestIndex] method must fill aConstraintUsage[] with information
// about what parameters to pass to xFilter.  ^If argvIndex>0 then
// the right-hand side of the corresponding aConstraint[] is evaluated
// and becomes the argvIndex-th entry in argv.  ^(If aConstraintUsage[].omit
// is true, then the constraint is assumed to be fully handled by the
// virtual table and might not be checked again by the byte code.)^ ^(The
// aConstraintUsage[].omit flag is an optimization hint. When the omit flag
// is left in its default setting of false, the constraint will always be
// checked separately in byte code.  If the omit flag is change to true, then
// the constraint may or may not be checked in byte code.  In other words,
// when the omit flag is true there is no guarantee that the constraint will
// not be checked again using byte code.)^
//
// ^The idxNum and idxPtr values are recorded and passed into the
// [xFilter] method.
// ^[sqlite3_free()] is used to free idxPtr if and only if
// needToFreeIdxPtr is true.
//
// ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in
// the correct order to satisfy the ORDER BY clause so that no separate
// sorting step is required.
//
// ^The estimatedCost value is an estimate of the cost of a particular
// strategy. A cost of N indicates that the cost of the strategy is similar
// to a linear scan of an SQLite table with N rows. A cost of log(N)
// indicates that the expense of the operation is similar to that of a
// binary search on a unique indexed field of an SQLite table with N rows.
//
// ^The estimatedRows value is an estimate of the number of rows that
// will be returned by the strategy.
//
// The xBestIndex method may optionally populate the idxFlags field with a
// mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag -
// SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite
// assumes that the strategy may visit at most one row.
//
// Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then
// SQLite also assumes that if a call to the xUpdate() method is made as
// part of the same statement to delete or update a virtual table row and the
// implementation returns SQLITE_CONSTRAINT, then there is no need to rollback
// any database changes. In other words, if the xUpdate() returns
// SQLITE_CONSTRAINT, the database contents must be exactly as they were
// before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not
// set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by
// the xUpdate method are automatically rolled back by SQLite.
//
// IMPORTANT: The estimatedRows field was added to the sqlite3_index_info
// structure for SQLite [version 3.8.2] ([dateof:3.8.2]).
// If a virtual table extension is
// used with an SQLite version earlier than 3.8.2, the results of attempting
// to read or write the estimatedRows field are undefined (but are likely
// to include crashing the application). The estimatedRows field should
// therefore only be used if [sqlite3_libversion_number()] returns a
// value greater than or equal to 3008002. Similarly, the idxFlags field
// was added for [version 3.9.0] ([dateof:3.9.0]).
// It may therefore only be used if
// sqlite3_libversion_number() returns a value greater than or equal to
// 3009000.
type sqlite3_index_constraint_usage = struct {
	argvIndex int32
	omit      uint8
	_         [3]byte
}

// CAPI3REF: Mutex Methods Object
//
// An instance of this structure defines the low-level routines
// used to allocate and use mutexes.
//
// Usually, the default mutex implementations provided by SQLite are
// sufficient, however the application has the option of substituting a custom
// implementation for specialized deployments or systems for which SQLite
// does not provide a suitable implementation. In this case, the application
// creates and populates an instance of this structure to pass
// to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option.
// Additionally, an instance of this structure can be used as an
// output variable when querying the system for the current mutex
// implementation, using the [SQLITE_CONFIG_GETMUTEX] option.
//
// ^The xMutexInit method defined by this structure is invoked as
// part of system initialization by the sqlite3_initialize() function.
// ^The xMutexInit routine is called by SQLite exactly once for each
// effective call to [sqlite3_initialize()].
//
// ^The xMutexEnd method defined by this structure is invoked as
// part of system shutdown by the sqlite3_shutdown() function. The
// implementation of this method is expected to release all outstanding
// resources obtained by the mutex methods implementation, especially
// those obtained by the xMutexInit method.  ^The xMutexEnd()
// interface is invoked exactly once for each call to [sqlite3_shutdown()].
//
// ^(The remaining seven methods defined by this structure (xMutexAlloc,
// xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and
// xMutexNotheld) implement the following interfaces (respectively):
//
// <ul>
//   <li>  [sqlite3_mutex_alloc()] </li>
//   <li>  [sqlite3_mutex_free()] </li>
//   <li>  [sqlite3_mutex_enter()] </li>
//   <li>  [sqlite3_mutex_try()] </li>
//   <li>  [sqlite3_mutex_leave()] </li>
//   <li>  [sqlite3_mutex_held()] </li>
//   <li>  [sqlite3_mutex_notheld()] </li>
// </ul>)^
//
// The only difference is that the public sqlite3_XXX functions enumerated
// above silently ignore any invocations that pass a NULL pointer instead
// of a valid mutex handle. The implementations of the methods defined
// by this structure are not required to handle this case. The results
// of passing a NULL pointer instead of a valid mutex handle are undefined
// (i.e. it is acceptable to provide an implementation that segfaults if
// it is passed a NULL pointer).
//
// The xMutexInit() method must be threadsafe.  It must be harmless to
// invoke xMutexInit() multiple times within the same process and without
// intervening calls to xMutexEnd().  Second and subsequent calls to
// xMutexInit() must be no-ops.
//
// xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()]
// and its associates).  Similarly, xMutexAlloc() must not use SQLite memory
// allocation for a static mutex.  ^However xMutexAlloc() may use SQLite
// memory allocation for a fast or recursive mutex.
//
// ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is
// called, but only if the prior call to xMutexInit returned SQLITE_OK.
// If xMutexInit fails in any way, it is expected to clean up after itself
// prior to returning.
type sqlite3_mutex_methods1 = struct {
	xMutexInit    uintptr
	xMutexEnd     uintptr
	xMutexAlloc   uintptr
	xMutexFree    uintptr
	xMutexEnter   uintptr
	xMutexTry     uintptr
	xMutexLeave   uintptr
	xMutexHeld    uintptr
	xMutexNotheld uintptr
}

// CAPI3REF: Mutex Methods Object
//
// An instance of this structure defines the low-level routines
// used to allocate and use mutexes.
//
// Usually, the default mutex implementations provided by SQLite are
// sufficient, however the application has the option of substituting a custom
// implementation for specialized deployments or systems for which SQLite
// does not provide a suitable implementation. In this case, the application
// creates and populates an instance of this structure to pass
// to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option.
// Additionally, an instance of this structure can be used as an
// output variable when querying the system for the current mutex
// implementation, using the [SQLITE_CONFIG_GETMUTEX] option.
//
// ^The xMutexInit method defined by this structure is invoked as
// part of system initialization by the sqlite3_initialize() function.
// ^The xMutexInit routine is called by SQLite exactly once for each
// effective call to [sqlite3_initialize()].
//
// ^The xMutexEnd method defined by this structure is invoked as
// part of system shutdown by the sqlite3_shutdown() function. The
// implementation of this method is expected to release all outstanding
// resources obtained by the mutex methods implementation, especially
// those obtained by the xMutexInit method.  ^The xMutexEnd()
// interface is invoked exactly once for each call to [sqlite3_shutdown()].
//
// ^(The remaining seven methods defined by this structure (xMutexAlloc,
// xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and
// xMutexNotheld) implement the following interfaces (respectively):
//
// <ul>
//   <li>  [sqlite3_mutex_alloc()] </li>
//   <li>  [sqlite3_mutex_free()] </li>
//   <li>  [sqlite3_mutex_enter()] </li>
//   <li>  [sqlite3_mutex_try()] </li>
//   <li>  [sqlite3_mutex_leave()] </li>
//   <li>  [sqlite3_mutex_held()] </li>
//   <li>  [sqlite3_mutex_notheld()] </li>
// </ul>)^
//
// The only difference is that the public sqlite3_XXX functions enumerated
// above silently ignore any invocations that pass a NULL pointer instead
// of a valid mutex handle. The implementations of the methods defined
// by this structure are not required to handle this case. The results
// of passing a NULL pointer instead of a valid mutex handle are undefined
// (i.e. it is acceptable to provide an implementation that segfaults if
// it is passed a NULL pointer).
//
// The xMutexInit() method must be threadsafe.  It must be harmless to
// invoke xMutexInit() multiple times within the same process and without
// intervening calls to xMutexEnd().  Second and subsequent calls to
// xMutexInit() must be no-ops.
//
// xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()]
// and its associates).  Similarly, xMutexAlloc() must not use SQLite memory
// allocation for a static mutex.  ^However xMutexAlloc() may use SQLite
// memory allocation for a fast or recursive mutex.
//
// ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is
// called, but only if the prior call to xMutexInit returned SQLITE_OK.
// If xMutexInit fails in any way, it is expected to clean up after itself
// prior to returning.
type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7524:38 */

// CAPI3REF: Custom Page Cache Object
//
// The sqlite3_pcache_page object represents a single page in the
// page cache.  The page cache will allocate instances of this
// object.  Various methods of the page cache use pointers to instances
// of this object as parameters or as their return value.
//
// See [sqlite3_pcache_methods2] for additional information.
type sqlite3_pcache_page1 = struct {
	pBuf   uintptr
	pExtra uintptr
}

// CAPI3REF: Custom Page Cache Object
//
// The sqlite3_pcache_page object represents a single page in the
// page cache.  The page cache will allocate instances of this
// object.  Various methods of the page cache use pointers to instances
// of this object as parameters or as their return value.
//
// See [sqlite3_pcache_methods2] for additional information.
type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8277:36 */

// CAPI3REF: Application Defined Page Cache.
// KEYWORDS: {page cache}
//
// ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can
// register an alternative page cache implementation by passing in an
// instance of the sqlite3_pcache_methods2 structure.)^
// In many applications, most of the heap memory allocated by
// SQLite is used for the page cache.
// By implementing a
// custom page cache using this API, an application can better control
// the amount of memory consumed by SQLite, the way in which
// that memory is allocated and released, and the policies used to
// determine exactly which parts of a database file are cached and for
// how long.
//
// The alternative page cache mechanism is an
// extreme measure that is only needed by the most demanding applications.
// The built-in page cache is recommended for most uses.
//
// ^(The contents of the sqlite3_pcache_methods2 structure are copied to an
// internal buffer by SQLite within the call to [sqlite3_config].  Hence
// the application may discard the parameter after the call to
// [sqlite3_config()] returns.)^
//
// [[the xInit() page cache method]]
// ^(The xInit() method is called once for each effective
// call to [sqlite3_initialize()])^
// (usually only once during the lifetime of the process). ^(The xInit()
// method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^
// The intent of the xInit() method is to set up global data structures
// required by the custom page cache implementation.
// ^(If the xInit() method is NULL, then the
// built-in default page cache is used instead of the application defined
// page cache.)^
//
// [[the xShutdown() page cache method]]
// ^The xShutdown() method is called by [sqlite3_shutdown()].
// It can be used to clean up
// any outstanding resources before process shutdown, if required.
// ^The xShutdown() method may be NULL.
//
// ^SQLite automatically serializes calls to the xInit method,
// so the xInit method need not be threadsafe.  ^The
// xShutdown method is only called from [sqlite3_shutdown()] so it does
// not need to be threadsafe either.  All other methods must be threadsafe
// in multithreaded applications.
//
// ^SQLite will never invoke xInit() more than once without an intervening
// call to xShutdown().
//
// [[the xCreate() page cache methods]]
// ^SQLite invokes the xCreate() method to construct a new cache instance.
// SQLite will typically create one cache instance for each open database file,
// though this is not guaranteed. ^The
// first parameter, szPage, is the size in bytes of the pages that must
// be allocated by the cache.  ^szPage will always a power of two.  ^The
// second parameter szExtra is a number of bytes of extra storage
// associated with each page cache entry.  ^The szExtra parameter will
// a number less than 250.  SQLite will use the
// extra szExtra bytes on each page to store metadata about the underlying
// database page on disk.  The value passed into szExtra depends
// on the SQLite version, the target platform, and how SQLite was compiled.
// ^The third argument to xCreate(), bPurgeable, is true if the cache being
// created will be used to cache database pages of a file stored on disk, or
// false if it is used for an in-memory database. The cache implementation
// does not have to do anything special based with the value of bPurgeable;
// it is purely advisory.  ^On a cache where bPurgeable is false, SQLite will
// never invoke xUnpin() except to deliberately delete a page.
// ^In other words, calls to xUnpin() on a cache with bPurgeable set to
// false will always have the "discard" flag set to true.
// ^Hence, a cache created with bPurgeable false will
// never contain any unpinned pages.
//
// [[the xCachesize() page cache method]]
// ^(The xCachesize() method may be called at any time by SQLite to set the
// suggested maximum cache-size (number of pages stored by) the cache
// instance passed as the first argument. This is the value configured using
// the SQLite "[PRAGMA cache_size]" command.)^  As with the bPurgeable
// parameter, the implementation is not required to do anything with this
// value; it is advisory only.
//
// [[the xPagecount() page cache methods]]
// The xPagecount() method must return the number of pages currently
// stored in the cache, both pinned and unpinned.
//
// [[the xFetch() page cache methods]]
// The xFetch() method locates a page in the cache and returns a pointer to
// an sqlite3_pcache_page object associated with that page, or a NULL pointer.
// The pBuf element of the returned sqlite3_pcache_page object will be a
// pointer to a buffer of szPage bytes used to store the content of a
// single database page.  The pExtra element of sqlite3_pcache_page will be
// a pointer to the szExtra bytes of extra storage that SQLite has requested
// for each entry in the page cache.
//
// The page to be fetched is determined by the key. ^The minimum key value
// is 1.  After it has been retrieved using xFetch, the page is considered
// to be "pinned".
//
// If the requested page is already in the page cache, then the page cache
// implementation must return a pointer to the page buffer with its content
// intact.  If the requested page is not already in the cache, then the
// cache implementation should use the value of the createFlag
// parameter to help it determined what action to take:
//
// <table border=1 width=85% align=center>
// <tr><th> createFlag <th> Behavior when page is not already in cache
// <tr><td> 0 <td> Do not allocate a new page.  Return NULL.
// <tr><td> 1 <td> Allocate a new page if it easy and convenient to do so.
//                 Otherwise return NULL.
// <tr><td> 2 <td> Make every effort to allocate a new page.  Only return
//                 NULL if allocating a new page is effectively impossible.
// </table>
//
// ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1.  SQLite
// will only use a createFlag of 2 after a prior call with a createFlag of 1
// failed.)^  In between the xFetch() calls, SQLite may
// attempt to unpin one or more cache pages by spilling the content of
// pinned pages to disk and synching the operating system disk cache.
//
// [[the xUnpin() page cache method]]
// ^xUnpin() is called by SQLite with a pointer to a currently pinned page
// as its second argument.  If the third parameter, discard, is non-zero,
// then the page must be evicted from the cache.
// ^If the discard parameter is
// zero, then the page may be discarded or retained at the discretion of
// page cache implementation. ^The page cache implementation
// may choose to evict unpinned pages at any time.
//
// The cache must not perform any reference counting. A single
// call to xUnpin() unpins the page regardless of the number of prior calls
// to xFetch().
//
// [[the xRekey() page cache methods]]
// The xRekey() method is used to change the key value associated with the
// page passed as the second argument. If the cache
// previously contains an entry associated with newKey, it must be
// discarded. ^Any prior cache entry associated with newKey is guaranteed not
// to be pinned.
//
// When SQLite calls the xTruncate() method, the cache must discard all
// existing cache entries with page numbers (keys) greater than or equal
// to the value of the iLimit parameter passed to xTruncate(). If any
// of these pages are pinned, they are implicitly unpinned, meaning that
// they can be safely discarded.
//
// [[the xDestroy() page cache method]]
// ^The xDestroy() method is used to delete a cache allocated by xCreate().
// All resources associated with the specified cache should be freed. ^After
// calling the xDestroy() method, SQLite considers the [sqlite3_pcache*]
// handle invalid, and will not use it with any other sqlite3_pcache_methods2
// functions.
//
// [[the xShrink() page cache method]]
// ^SQLite invokes the xShrink() method when it wants the page cache to
// free up as much of heap memory as possible.  The page cache implementation
// is not obligated to free any memory, but well-behaved implementations should
// do their best.
type sqlite3_pcache_methods21 = struct {
	iVersion   int32
	pArg       uintptr
	xInit      uintptr
	xShutdown  uintptr
	xCreate    uintptr
	xCachesize uintptr
	xPagecount uintptr
	xFetch     uintptr
	xUnpin     uintptr
	xRekey     uintptr
	xTruncate  uintptr
	xDestroy   uintptr
	xShrink    uintptr
}

// CAPI3REF: Application Defined Page Cache.
// KEYWORDS: {page cache}
//
// ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can
// register an alternative page cache implementation by passing in an
// instance of the sqlite3_pcache_methods2 structure.)^
// In many applications, most of the heap memory allocated by
// SQLite is used for the page cache.
// By implementing a
// custom page cache using this API, an application can better control
// the amount of memory consumed by SQLite, the way in which
// that memory is allocated and released, and the policies used to
// determine exactly which parts of a database file are cached and for
// how long.
//
// The alternative page cache mechanism is an
// extreme measure that is only needed by the most demanding applications.
// The built-in page cache is recommended for most uses.
//
// ^(The contents of the sqlite3_pcache_methods2 structure are copied to an
// internal buffer by SQLite within the call to [sqlite3_config].  Hence
// the application may discard the parameter after the call to
// [sqlite3_config()] returns.)^
//
// [[the xInit() page cache method]]
// ^(The xInit() method is called once for each effective
// call to [sqlite3_initialize()])^
// (usually only once during the lifetime of the process). ^(The xInit()
// method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^
// The intent of the xInit() method is to set up global data structures
// required by the custom page cache implementation.
// ^(If the xInit() method is NULL, then the
// built-in default page cache is used instead of the application defined
// page cache.)^
//
// [[the xShutdown() page cache method]]
// ^The xShutdown() method is called by [sqlite3_shutdown()].
// It can be used to clean up
// any outstanding resources before process shutdown, if required.
// ^The xShutdown() method may be NULL.
//
// ^SQLite automatically serializes calls to the xInit method,
// so the xInit method need not be threadsafe.  ^The
// xShutdown method is only called from [sqlite3_shutdown()] so it does
// not need to be threadsafe either.  All other methods must be threadsafe
// in multithreaded applications.
//
// ^SQLite will never invoke xInit() more than once without an intervening
// call to xShutdown().
//
// [[the xCreate() page cache methods]]
// ^SQLite invokes the xCreate() method to construct a new cache instance.
// SQLite will typically create one cache instance for each open database file,
// though this is not guaranteed. ^The
// first parameter, szPage, is the size in bytes of the pages that must
// be allocated by the cache.  ^szPage will always a power of two.  ^The
// second parameter szExtra is a number of bytes of extra storage
// associated with each page cache entry.  ^The szExtra parameter will
// a number less than 250.  SQLite will use the
// extra szExtra bytes on each page to store metadata about the underlying
// database page on disk.  The value passed into szExtra depends
// on the SQLite version, the target platform, and how SQLite was compiled.
// ^The third argument to xCreate(), bPurgeable, is true if the cache being
// created will be used to cache database pages of a file stored on disk, or
// false if it is used for an in-memory database. The cache implementation
// does not have to do anything special based with the value of bPurgeable;
// it is purely advisory.  ^On a cache where bPurgeable is false, SQLite will
// never invoke xUnpin() except to deliberately delete a page.
// ^In other words, calls to xUnpin() on a cache with bPurgeable set to
// false will always have the "discard" flag set to true.
// ^Hence, a cache created with bPurgeable false will
// never contain any unpinned pages.
//
// [[the xCachesize() page cache method]]
// ^(The xCachesize() method may be called at any time by SQLite to set the
// suggested maximum cache-size (number of pages stored by) the cache
// instance passed as the first argument. This is the value configured using
// the SQLite "[PRAGMA cache_size]" command.)^  As with the bPurgeable
// parameter, the implementation is not required to do anything with this
// value; it is advisory only.
//
// [[the xPagecount() page cache methods]]
// The xPagecount() method must return the number of pages currently
// stored in the cache, both pinned and unpinned.
//
// [[the xFetch() page cache methods]]
// The xFetch() method locates a page in the cache and returns a pointer to
// an sqlite3_pcache_page object associated with that page, or a NULL pointer.
// The pBuf element of the returned sqlite3_pcache_page object will be a
// pointer to a buffer of szPage bytes used to store the content of a
// single database page.  The pExtra element of sqlite3_pcache_page will be
// a pointer to the szExtra bytes of extra storage that SQLite has requested
// for each entry in the page cache.
//
// The page to be fetched is determined by the key. ^The minimum key value
// is 1.  After it has been retrieved using xFetch, the page is considered
// to be "pinned".
//
// If the requested page is already in the page cache, then the page cache
// implementation must return a pointer to the page buffer with its content
// intact.  If the requested page is not already in the cache, then the
// cache implementation should use the value of the createFlag
// parameter to help it determined what action to take:
//
// <table border=1 width=85% align=center>
// <tr><th> createFlag <th> Behavior when page is not already in cache
// <tr><td> 0 <td> Do not allocate a new page.  Return NULL.
// <tr><td> 1 <td> Allocate a new page if it easy and convenient to do so.
//                 Otherwise return NULL.
// <tr><td> 2 <td> Make every effort to allocate a new page.  Only return
//                 NULL if allocating a new page is effectively impossible.
// </table>
//
// ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1.  SQLite
// will only use a createFlag of 2 after a prior call with a createFlag of 1
// failed.)^  In between the xFetch() calls, SQLite may
// attempt to unpin one or more cache pages by spilling the content of
// pinned pages to disk and synching the operating system disk cache.
//
// [[the xUnpin() page cache method]]
// ^xUnpin() is called by SQLite with a pointer to a currently pinned page
// as its second argument.  If the third parameter, discard, is non-zero,
// then the page must be evicted from the cache.
// ^If the discard parameter is
// zero, then the page may be discarded or retained at the discretion of
// page cache implementation. ^The page cache implementation
// may choose to evict unpinned pages at any time.
//
// The cache must not perform any reference counting. A single
// call to xUnpin() unpins the page regardless of the number of prior calls
// to xFetch().
//
// [[the xRekey() page cache methods]]
// The xRekey() method is used to change the key value associated with the
// page passed as the second argument. If the cache
// previously contains an entry associated with newKey, it must be
// discarded. ^Any prior cache entry associated with newKey is guaranteed not
// to be pinned.
//
// When SQLite calls the xTruncate() method, the cache must discard all
// existing cache entries with page numbers (keys) greater than or equal
// to the value of the iLimit parameter passed to xTruncate(). If any
// of these pages are pinned, they are implicitly unpinned, meaning that
// they can be safely discarded.
//
// [[the xDestroy() page cache method]]
// ^The xDestroy() method is used to delete a cache allocated by xCreate().
// All resources associated with the specified cache should be freed. ^After
// calling the xDestroy() method, SQLite considers the [sqlite3_pcache*]
// handle invalid, and will not use it with any other sqlite3_pcache_methods2
// functions.
//
// [[the xShrink() page cache method]]
// ^SQLite invokes the xShrink() method when it wants the page cache to
// free up as much of heap memory as possible.  The page cache implementation
// is not obligated to free any memory, but well-behaved implementations should
// do their best.
type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8442:40 */

// This is the obsolete pcache_methods object that has now been replaced
// by sqlite3_pcache_methods2.  This object is not used by SQLite.  It is
// retained in the header file for backwards compatibility only.
type sqlite3_pcache_methods1 = struct {
	pArg       uintptr
	xInit      uintptr
	xShutdown  uintptr
	xCreate    uintptr
	xCachesize uintptr
	xPagecount uintptr
	xFetch     uintptr
	xUnpin     uintptr
	xRekey     uintptr
	xTruncate  uintptr
	xDestroy   uintptr
}

// This is the obsolete pcache_methods object that has now been replaced
// by sqlite3_pcache_methods2.  This object is not used by SQLite.  It is
// retained in the header file for backwards compatibility only.
type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8465:39 */

// CAPI3REF: Database Snapshot
// KEYWORDS: {snapshot} {sqlite3_snapshot}
//
// An instance of the snapshot object records the state of a [WAL mode]
// database for some specific point in history.
//
// In [WAL mode], multiple [database connections] that are open on the
// same database file can each be reading a different historical version
// of the database file.  When a [database connection] begins a read
// transaction, that connection sees an unchanging copy of the database
// as it existed for the point in time when the transaction first started.
// Subsequent changes to the database from other connections are not seen
// by the reader until a new read transaction is started.
//
// The sqlite3_snapshot object records state information about an historical
// version of the database file so that it is possible to later open a new read
// transaction that sees that historical version of the database rather than
// the most recent version.
type sqlite3_snapshot1 = struct{ hidden [48]uint8 }

// CAPI3REF: Database Snapshot
// KEYWORDS: {snapshot} {sqlite3_snapshot}
//
// An instance of the snapshot object records the state of a [WAL mode]
// database for some specific point in history.
//
// In [WAL mode], multiple [database connections] that are open on the
// same database file can each be reading a different historical version
// of the database file.  When a [database connection] begins a read
// transaction, that connection sees an unchanging copy of the database
// as it existed for the point in time when the transaction first started.
// Subsequent changes to the database from other connections are not seen
// by the reader until a new read transaction is started.
//
// The sqlite3_snapshot object records state information about an historical
// version of the database file so that it is possible to later open a new read
// transaction that sees that historical version of the database rather than
// the most recent version.
type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9514:3 */

// CAPI3REF: Flags for sqlite3_deserialize()
//
// The following are allowed values for 6th argument (the F argument) to
// the [sqlite3_deserialize(D,S,P,N,M,F)] interface.
//
// The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization
// in the P argument is held in memory obtained from [sqlite3_malloc64()]
// and that SQLite should take ownership of this memory and automatically
// free it when it has finished using it.  Without this flag, the caller
// is responsible for freeing any dynamically allocated memory.
//
// The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to
// grow the size of the database using calls to [sqlite3_realloc64()].  This
// flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used.
// Without this flag, the deserialized database cannot increase in size beyond
// the number of bytes specified by the M parameter.
//
// The SQLITE_DESERIALIZE_READONLY flag means that the deserialized database
// should be treated as read-only.

// Undo the hack that converts floating point types to integer for
// builds on processors without floating point support.

//******* Begin file sqlite3rtree.h ********
// 2010 August 30
//
// The author disclaims copyright to this source code.  In place of
// a legal notice, here is a blessing:
//
//    May you do good and not evil.
//    May you find forgiveness for yourself and forgive others.
//    May you share freely, never taking more than you give.
//
//

type sqlite3_rtree_geometry1 = struct {
	pContext uintptr
	nParam   int32
	aParam   uintptr
	pUser    uintptr
	xDelUser uintptr
}

// CAPI3REF: Flags for sqlite3_deserialize()
//
// The following are allowed values for 6th argument (the F argument) to
// the [sqlite3_deserialize(D,S,P,N,M,F)] interface.
//
// The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization
// in the P argument is held in memory obtained from [sqlite3_malloc64()]
// and that SQLite should take ownership of this memory and automatically
// free it when it has finished using it.  Without this flag, the caller
// is responsible for freeing any dynamically allocated memory.
//
// The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to
// grow the size of the database using calls to [sqlite3_realloc64()].  This
// flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used.
// Without this flag, the deserialized database cannot increase in size beyond
// the number of bytes specified by the M parameter.
//
// The SQLITE_DESERIALIZE_READONLY flag means that the deserialized database
// should be treated as read-only.

// Undo the hack that converts floating point types to integer for
// builds on processors without floating point support.

//******* Begin file sqlite3rtree.h ********
// 2010 August 30
//
// The author disclaims copyright to this source code.  In place of
// a legal notice, here is a blessing:
//
//    May you do good and not evil.
//    May you find forgiveness for yourself and forgive others.
//    May you share freely, never taking more than you give.
//
//

type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9839:39 */
type sqlite3_rtree_query_info1 = struct {
	pContext      uintptr
	nParam        int32
	aParam        uintptr
	pUser         uintptr
	xDelUser      uintptr
	aCoord        uintptr
	anQueue       uintptr
	nCoord        int32
	iLevel        int32
	mxLevel       int32
	iRowid        sqlite3_int64
	rParentScore  sqlite3_rtree_dbl
	eParentWithin int32
	eWithin       int32
	rScore        sqlite3_rtree_dbl
	apSqlParam    uintptr
}

type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9840:41 */

// The double-precision datatype used by RTree depends on the
// SQLITE_RTREE_INT_ONLY compile-time option.
type sqlite3_rtree_dbl = float64 /* sqlite3.h:9848:18 */

// Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin.

//******* End of sqlite3rtree.h ********
//******* Begin file sqlite3session.h ********

//******* End of sqlite3session.h ********
//******* Begin file fts5.h ********
// 2014 May 31
//
// The author disclaims copyright to this source code.  In place of
// a legal notice, here is a blessing:
//
//    May you do good and not evil.
//    May you find forgiveness for yourself and forgive others.
//    May you share freely, never taking more than you give.
//
//
//
// Interfaces to extend FTS5. Using the interfaces defined in this file,
// FTS5 may be extended with:
//
//     * custom tokenizers, and
//     * custom auxiliary functions.

// ************************************************************************
//
// CUSTOM AUXILIARY FUNCTIONS
//
// Virtual table implementations may overload SQL functions by implementing
// the sqlite3_module.xFindFunction() method.

type Fts5ExtensionApi1 = struct {
	iVersion           int32
	xUserData          uintptr
	xColumnCount       uintptr
	xRowCount          uintptr
	xColumnTotalSize   uintptr
	xTokenize          uintptr
	xPhraseCount       uintptr
	xPhraseSize        uintptr
	xInstCount         uintptr
	xInst              uintptr
	xRowid             uintptr
	xColumnText        uintptr
	xColumnSize        uintptr
	xQueryPhrase       uintptr
	xSetAuxdata        uintptr
	xGetAuxdata        uintptr
	xPhraseFirst       uintptr
	xPhraseNext        uintptr
	xPhraseFirstColumn uintptr
	xPhraseNextColumn  uintptr
}

// Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin.

//******* End of sqlite3rtree.h ********
//******* Begin file sqlite3session.h ********

//******* End of sqlite3session.h ********
//******* Begin file fts5.h ********
// 2014 May 31
//
// The author disclaims copyright to this source code.  In place of
// a legal notice, here is a blessing:
//
//    May you do good and not evil.
//    May you find forgiveness for yourself and forgive others.
//    May you share freely, never taking more than you give.
//
//
//
// Interfaces to extend FTS5. Using the interfaces defined in this file,
// FTS5 may be extended with:
//
//     * custom tokenizers, and
//     * custom auxiliary functions.

// ************************************************************************
//
// CUSTOM AUXILIARY FUNCTIONS
//
// Virtual table implementations may overload SQL functions by implementing
// the sqlite3_module.xFindFunction() method.

type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11634:33 */
type Fts5PhraseIter1 = struct {
	a uintptr
	b uintptr
}

type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11636:31 */

type fts5_extension_function = uintptr /* sqlite3.h:11638:14 */
type fts5_tokenizer1 = struct {
	xCreate   uintptr
	xDelete   uintptr
	xTokenize uintptr
}

type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12097:31 */

// Flags that may be passed as the third argument to xTokenize()

// Flags that may be passed by the tokenizer implementation back to FTS5
// as the third argument to the supplied xToken callback.

//
// END OF CUSTOM TOKENIZERS
//

// ************************************************************************
//
// FTS5 EXTENSION REGISTRATION API
type fts5_api1 = struct {
	iVersion         int32
	xCreateTokenizer uintptr
	xFindTokenizer   uintptr
	xCreateFunction  uintptr
}

// Flags that may be passed as the third argument to xTokenize()

// Flags that may be passed by the tokenizer implementation back to FTS5
// as the third argument to the supplied xToken callback.

//
// END OF CUSTOM TOKENIZERS
//

// ************************************************************************
//
// FTS5 EXTENSION REGISTRATION API
type fts5_api = fts5_api1 /* sqlite3.h:12133:25 */

// The tag name of this struct is _G_fpos_t to preserve historic
//   C++ mangled names for functions taking fpos_t arguments.
//   That name should not be used in new code.
type _G_fpos_t = struct {
	__pos   int64
	__state struct {
		__count int32
		__value struct{ __wch uint32 }
	}
}

// bits/types.h -- definitions of __*_t types underlying *_t types.
//   Copyright (C) 2002-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

// The tag name of this struct is _G_fpos64_t to preserve historic
//   C++ mangled names for functions taking fpos_t and/or fpos64_t
//   arguments.  That name should not be used in new code.
type _G_fpos64_t = struct {
	__pos   int64
	__state struct {
		__count int32
		__value struct{ __wch uint32 }
	}
}

type _IO_FILE = struct {
	_flags          int32
	_IO_read_ptr    uintptr
	_IO_read_end    uintptr
	_IO_read_base   uintptr
	_IO_write_base  uintptr
	_IO_write_ptr   uintptr
	_IO_write_end   uintptr
	_IO_buf_base    uintptr
	_IO_buf_end     uintptr
	_IO_save_base   uintptr
	_IO_backup_base uintptr
	_IO_save_end    uintptr
	_markers        uintptr
	_chain          uintptr
	_fileno         int32
	_flags2         int32
	_old_offset     int64
	_cur_column     uint16
	_vtable_offset  int8
	_shortbuf       [1]int8
	_lock           uintptr
	_offset         int64
	_codecvt        uintptr
	_wide_data      uintptr
	_freeres_list   uintptr
	_freeres_buf    uintptr
	__pad5          size_t
	_mode           int32
	_unused2        [20]int8
}

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

// These macros are used by bits/stdio.h and internal headers.

// Many more flag bits are defined internally.

// Copyright (C) 1989-2018 Free Software Foundation, Inc.
//
//This file is part of GCC.
//
//GCC is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 3, or (at your option)
//any later version.
//
//GCC is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//Under Section 7 of GPL version 3, you are granted additional
//permissions described in the GCC Runtime Library Exception, version
//3.1, as published by the Free Software Foundation.
//
//You should have received a copy of the GNU General Public License and
//a copy of the GCC Runtime Library Exception along with this program;
//see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
//<http://www.gnu.org/licenses/>.

// ISO C Standard:  7.15  Variable arguments  <stdarg.h>

type off_t = int64 /* stdio.h:63:17 */

type ssize_t = int64 /* stdio.h:77:19 */

// The type of the second argument to `fgetpos' and `fsetpos'.
type fpos_t = _G_fpos_t /* stdio.h:84:18 */

//  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
//    are already defined.
//  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
//  NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.

// A null pointer constant.

// XPG requires a few symbols from <sys/wait.h> being defined.
// Definitions of flag bits for `waitpid' et al.
//   Copyright (C) 1992-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

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

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

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

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

// Returned by `div'.
type div_t = struct {
	quot int32
	rem  int32
} /* stdlib.h:62:5 */

// Returned by `ldiv'.
type ldiv_t = struct {
	quot int64
	rem  int64
} /* stdlib.h:70:5 */

// Returned by `lldiv'.
type lldiv_t = struct {
	quot int64
	rem  int64
} /* stdlib.h:80:5 */

// Copyright (C) 1991-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

// Copyright (C) 1991-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//   Copyright (C) 2002-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

type u_char = uint8                    /* types.h:33:18 */
type u_short = uint16                  /* types.h:34:19 */
type u_int = uint32                    /* types.h:35:17 */
type u_long = uint64                   /* types.h:36:18 */
type quad_t = int64                    /* types.h:37:18 */
type u_quad_t = uint64                 /* types.h:38:20 */
type fsid_t = struct{ __val [2]int32 } /* types.h:39:18 */
type loff_t = int64                    /* types.h:42:18 */

type ino_t = uint64 /* types.h:47:17 */

type dev_t = uint64 /* types.h:59:17 */

type gid_t = uint32 /* types.h:64:17 */

type mode_t = uint32 /* types.h:69:18 */

type nlink_t = uint64 /* types.h:74:19 */

type uid_t = uint32 /* types.h:79:17 */

type pid_t = int32 /* types.h:97:17 */

type id_t = uint32 /* types.h:103:16 */

type daddr_t = int32   /* types.h:114:19 */
type caddr_t = uintptr /* types.h:115:19 */

type key_t = int32 /* types.h:121:17 */

// bits/types.h -- definitions of __*_t types underlying *_t types.
//   Copyright (C) 2002-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

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

// bits/types.h -- definitions of __*_t types underlying *_t types.
//   Copyright (C) 2002-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

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

// bits/types.h -- definitions of __*_t types underlying *_t types.
//   Copyright (C) 2002-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

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

// bits/types.h -- definitions of __*_t types underlying *_t types.
//   Copyright (C) 2002-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

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

// Copyright (C) 1989-2018 Free Software Foundation, Inc.
//
//This file is part of GCC.
//
//GCC is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 3, or (at your option)
//any later version.
//
//GCC is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//Under Section 7 of GPL version 3, you are granted additional
//permissions described in the GCC Runtime Library Exception, version
//3.1, as published by the Free Software Foundation.
//
//You should have received a copy of the GNU General Public License and
//a copy of the GCC Runtime Library Exception along with this program;
//see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
//<http://www.gnu.org/licenses/>.

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

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

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

// On 4.3bsd-net2, make sure ansi.h is included, so we have
//   one less case to deal with in the following.
// On FreeBSD 5, machine/ansi.h does not exist anymore...

// In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
//   defined if the corresponding type is *not* defined.
//   FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
//   NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_

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

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

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

// Signed type of difference of two pointers.

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

// Unsigned type of `sizeof' something.

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

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

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

//  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
//    are already defined.
//  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
//  NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.

// A null pointer constant.

// Old compatibility names for C types.
type ulong = uint64  /* types.h:148:27 */
type ushort = uint16 /* types.h:149:28 */
type uint = uint32   /* types.h:150:22 */

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

// Define intN_t types.
//   Copyright (C) 2017-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//   Copyright (C) 2002-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

type int8_t = int8   /* stdint-intn.h:24:18 */
type int16_t = int16 /* stdint-intn.h:25:19 */
type int32_t = int32 /* stdint-intn.h:26:19 */
type int64_t = int64 /* stdint-intn.h:27:19 */

// These were defined by ISO C without the first `_'.
type u_int8_t = uint8   /* types.h:160:23 */
type u_int16_t = uint16 /* types.h:161:28 */
type u_int32_t = uint32 /* types.h:162:22 */
type u_int64_t = uint64 /* types.h:164:27 */

type register_t = int32 /* types.h:169:13 */

// A set of signals to be blocked, unblocked, or waited for.
type sigset_t = struct{ __val [16]uint64 } /* sigset_t.h:7:20 */

// Get definition of timer specification structures.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//   Copyright (C) 2002-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

// A time value that is accurate to the nearest
//   microsecond but also has a range of years.
type timeval = struct {
	tv_sec  int64
	tv_usec int64
}

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

// bits/types.h -- definitions of __*_t types underlying *_t types.
//   Copyright (C) 2002-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

// POSIX.1b structure for a time value.  This is like a `struct timeval' but
//   has nanoseconds instead of microseconds.
type timespec = struct {
	tv_sec  int64
	tv_nsec int64
}

type suseconds_t = int64 /* select.h:43:23 */

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

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

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

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

// Define some inlines helping to catch common problems.

type blksize_t = int64 /* types.h:202:21 */

// Types from the Large File Support interface.
type blkcnt_t = int64    /* types.h:209:20 */ // Type to count number of disk blocks.
type fsblkcnt_t = uint64 /* types.h:213:22 */ // Type to count file system blocks.
type fsfilcnt_t = uint64 /* types.h:217:22 */ // Type to count file system inodes.

// Now add the thread types.
// Declaration of common pthread types for all architectures.
//   Copyright (C) 2017-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

// For internal mutex and condition variable definitions.
// Common threading primitives definitions for both POSIX and C11.
//   Copyright (C) 2017-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

// Arch-specific definitions.  Each architecture must define the following
//   macros to define the expected sizes of pthread data types:
//
//   __SIZEOF_PTHREAD_ATTR_T        - size of pthread_attr_t.
//   __SIZEOF_PTHREAD_MUTEX_T       - size of pthread_mutex_t.
//   __SIZEOF_PTHREAD_MUTEXATTR_T   - size of pthread_mutexattr_t.
//   __SIZEOF_PTHREAD_COND_T        - size of pthread_cond_t.
//   __SIZEOF_PTHREAD_CONDATTR_T    - size of pthread_condattr_t.
//   __SIZEOF_PTHREAD_RWLOCK_T      - size of pthread_rwlock_t.
//   __SIZEOF_PTHREAD_RWLOCKATTR_T  - size of pthread_rwlockattr_t.
//   __SIZEOF_PTHREAD_BARRIER_T     - size of pthread_barrier_t.
//   __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t.
//
//   Also, the following macros must be define for internal pthread_mutex_t
//   struct definitions (struct __pthread_mutex_s):
//
//   __PTHREAD_COMPAT_PADDING_MID   - any additional members after 'kind'
//				    and before '__spin' (for 64 bits) or
//				    '__nusers' (for 32 bits).
//   __PTHREAD_COMPAT_PADDING_END   - any additional members at the end of
//				    the internal structure.
//   __PTHREAD_MUTEX_LOCK_ELISION   - 1 if the architecture supports lock
//				    elision or 0 otherwise.
//   __PTHREAD_MUTEX_NUSERS_AFTER_KIND - control where to put __nusers.  The
//				       preferred value for new architectures
//				       is 0.
//   __PTHREAD_MUTEX_USE_UNION      - control whether internal __spins and
//				    __list will be place inside a union for
//				    linuxthreads compatibility.
//				    The preferred value for new architectures
//				    is 0.
//
//   For a new port the preferred values for the required defines are:
//
//   #define __PTHREAD_COMPAT_PADDING_MID
//   #define __PTHREAD_COMPAT_PADDING_END
//   #define __PTHREAD_MUTEX_LOCK_ELISION         0
//   #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND    0
//   #define __PTHREAD_MUTEX_USE_UNION            0
//
//   __PTHREAD_MUTEX_LOCK_ELISION can be set to 1 if the hardware plans to
//   eventually support lock elision using transactional memory.
//
//   The additional macro defines any constraint for the lock alignment
//   inside the thread structures:
//
//   __LOCK_ALIGNMENT - for internal lock/futex usage.
//
//   Same idea but for the once locking primitive:
//
//   __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition.
//
//   And finally the internal pthread_rwlock_t (struct __pthread_rwlock_arch_t)
//   must be defined.
//
// Copyright (C) 2002-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

// Determine the wordsize from the preprocessor defines.

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

// Definitions for internal mutex struct.

type __pthread_rwlock_arch_t = struct {
	__readers       uint32
	__writers       uint32
	__wrphase_futex uint32
	__writers_futex uint32
	__pad3          uint32
	__pad4          uint32
	__cur_writer    int32
	__shared        int32
	__rwelision     int8
	__pad1          [7]uint8
	__pad2          uint64
	__flags         uint32
	_               [4]byte
}

// Common definition of pthread_mutex_t.

type __pthread_internal_list = struct {
	__prev uintptr
	__next uintptr
}

// Lock elision support.

type __pthread_mutex_s = struct {
	__lock    int32
	__count   uint32
	__owner   int32
	__nusers  uint32
	__kind    int32
	__spins   int16
	__elision int16
	__list    struct {
		__prev uintptr
		__next uintptr
	}
}

// Common definition of pthread_cond_t.

type __pthread_cond_s = struct {
	__0            struct{ __wseq uint64 }
	__8            struct{ __g1_start uint64 }
	__g_refs       [2]uint32
	__g_size       [2]uint32
	__g1_orig_size uint32
	__wrefs        uint32
	__g_signals    [2]uint32
}

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

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

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

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

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

type pthread_attr_t1 = struct {
	_      [0]uint64
	__size [56]int8
}

type pthread_attr_t = pthread_attr_t1 /* pthreadtypes.h:62:30 */

type pthread_mutex_t = struct{ __data __pthread_mutex_s } /* pthreadtypes.h:72:3 */

type pthread_cond_t = struct{ __data __pthread_cond_s } /* pthreadtypes.h:80:3 */

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

type pthread_rwlockattr_t = struct {
	_      [0]uint64
	__size [8]int8
} /* pthreadtypes.h:97:3 */

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

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

type pthread_barrierattr_t = struct {
	_      [0]uint32
	__size [4]int8
} /* pthreadtypes.h:118:3 */

// Reentrant versions of the `random' family of functions.
//   These functions all use the following data structure to contain
//   state, rather than global state variables.

type random_data = struct {
	fptr      uintptr
	rptr      uintptr
	state     uintptr
	rand_type int32
	rand_deg  int32
	rand_sep  int32
	end_ptr   uintptr
}

// Data structure for communication with thread safe versions.  This
//   type is to be regarded as opaque.  It's only exported because users
//   have to allocate objects of this type.
type drand48_data = struct {
	__x     [3]uint16
	__old_x [3]uint16
	__c     uint16
	__init  uint16
	__a     uint64
}

// POSIX.1-2008 extended locale interface (see locale.h).
// Definition of locale_t.
//   Copyright (C) 2017-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

// Definition of struct __locale_struct and __locale_t.
//   Copyright (C) 1997-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

type __locale_struct = struct {
	__locales       [13]uintptr
	__ctype_b       uintptr
	__ctype_tolower uintptr
	__ctype_toupper uintptr
	__names         [13]uintptr
}

type locale_t = uintptr /* locale_t.h:24:20 */

// Copyright (C) 1991-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

// Copyright (C) 1991-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

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

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

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

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

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

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

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

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

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

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

// Commands and utilities from XPG4 are available.

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

// The X/Open Unix extensions are available.

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

// The legacy interfaces are also available.

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

// Define POSIX options for Linux.
//   Copyright (C) 1996-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public License as
//   published by the Free Software Foundation; either version 2.1 of the
//   License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; see the file COPYING.LIB.  If
//   not, see <http://www.gnu.org/licenses/>.

// Job control is supported.

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

// Priority scheduling is supported.

// Synchronizing file data is supported.

// The fsync function is present.

// Mapping of files to memory is supported.

// Locking of all memory is supported.

// Locking of ranges of memory is supported.

// Setting of memory protections is supported.

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

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

// Filenames are not silently truncated.

// X/Open realtime support is available.

// X/Open thread realtime support is available.

// XPG4.2 shared memory is supported.

// Tell we have POSIX threads.

// We have the reentrant functions described in POSIX.

// We provide priority scheduling for threads.

// We support user-defined stack sizes.

// We support user-defined stacks.

// We support priority inheritence.

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

// We support priority inheritence for robust mutexes.

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

// We support POSIX.1b semaphores.

// Real-time signals are supported.

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

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

// The rest of the LFS is also available.

// POSIX shared memory objects are implemented.

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

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

// GNU libc provides regular expression handling.

// Reader/Writer locks are available.

// We have a POSIX shell.

// We support the Timeouts option.

// We support spinlocks.

// The `spawn' function family is supported.

// We have POSIX timers.

// The barrier functions are available.

// POSIX message queues are available.

// Thread process-shared synchronization is supported.

// The monotonic clock might be available.

// The clock selection interfaces are available.

// Advisory information interfaces are available.

// IPv6 support is available.

// Raw socket support is available.

// We have at least one terminal.

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

// trace.h is not available.

// Typed memory objects are not available.

// Get the environment definitions from Unix98.
// Copyright (C) 1999-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

// Determine the wordsize from the preprocessor defines.

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

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

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

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

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

// Standard file descriptors.

// All functions that are not declared anywhere else.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//   Copyright (C) 2002-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

// Copyright (C) 1989-2018 Free Software Foundation, Inc.
//
//This file is part of GCC.
//
//GCC is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 3, or (at your option)
//any later version.
//
//GCC is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//Under Section 7 of GPL version 3, you are granted additional
//permissions described in the GCC Runtime Library Exception, version
//3.1, as published by the Free Software Foundation.
//
//You should have received a copy of the GNU General Public License and
//a copy of the GCC Runtime Library Exception along with this program;
//see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
//<http://www.gnu.org/licenses/>.

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

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

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

// On 4.3bsd-net2, make sure ansi.h is included, so we have
//   one less case to deal with in the following.
// On FreeBSD 5, machine/ansi.h does not exist anymore...

// In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
//   defined if the corresponding type is *not* defined.
//   FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
//   NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_

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

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

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

// Signed type of difference of two pointers.

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

// Unsigned type of `sizeof' something.

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

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

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

//  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
//    are already defined.
//  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
//  NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.

// A null pointer constant.

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

type useconds_t = uint32 /* unistd.h:255:22 */

type intptr_t = int64 /* unistd.h:267:20 */

type socklen_t = uint32 /* unistd.h:274:21 */

// Define some macros helping to catch buffer overflows.

type u64 = sqlite3_uint64 /* speedtest1.c:66:24 */

// State structure for a Hash hash in progress
type HashContext1 = struct {
	isInit uint8
	i      uint8
	j      uint8
	s      [256]uint8
	r      [32]uint8
}

// State structure for a Hash hash in progress
type HashContext = HashContext1 /* speedtest1.c:71:28 */

// All global state is held in this structure
type Global = struct {
	db            uintptr
	pStmt         uintptr
	iStart        sqlite3_int64
	iTotal        sqlite3_int64
	bWithoutRowid int32
	bReprepare    int32
	bSqlOnly      int32
	bExplain      int32
	bVerify       int32
	bMemShrink    int32
	eTemp         int32
	szTest        int32
	nRepeat       int32
	doCheckpoint  int32
	zWR           uintptr
	zNN           uintptr
	zPK           uintptr
	x             uint32
	y             uint32
	nResByte      u64
	nResult       int32
	zResult       [3000]int8
	hashFile      uintptr
	hash          HashContext
	_             [5]byte
}

// All global state is held in this structure
var g Global /* speedtest1.c:107:3: */

// Return " TEMP" or "", as appropriate for creating a table.
func isTemp(tls *libc.TLS, N int32) uintptr { /* speedtest1.c:111:19: */
	if g.eTemp >= N {
		return ts + 2146 /* " TEMP" */
	}
	return ts + 2152 /* "" */
}

// Print an error message and exit
func fatal_error(tls *libc.TLS, zMsg uintptr, va uintptr) { /* speedtest1.c:116:13: */
	var ap va_list
	_ = ap
	ap = va
	libc.Xvfprintf(tls, libc.Xstderr, zMsg, ap)
	_ = ap
	libc.Xexit(tls, 1)
}

// ***************************************************************************
//
// Hash algorithm used to verify that compilation is not miscompiled
// in such a was as to generate an incorrect result.

// Initialize a new hash.  iSize determines the size of the hash
// in bits and should be one of 224, 256, 384, or 512.  Or iSize
// can be zero to use the default hash size of 256 bits.
func HashInit(tls *libc.TLS) { /* speedtest1.c:135:13: */
	var k uint32
	g.hash.i = uint8(0)
	g.hash.j = uint8(0)
	for k = uint32(0); k < uint32(256); k++ {
		*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(k))) = uint8(k)
	}
}

// Make consecutive calls to the HashUpdate function to add new content
// to the hash
func HashUpdate(tls *libc.TLS, aData uintptr, nData uint32) { /* speedtest1.c:146:13: */
	var t uint8
	var i uint8 = g.hash.i
	var j uint8 = g.hash.j
	var k uint32
	if g.hashFile != 0 {
		libc.Xfwrite(tls, aData, uint64(1), uint64(nData), g.hashFile)
	}
	for k = uint32(0); k < nData; k++ {
		j = uint8(int32(j) + (int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i)))) + int32(*(*uint8)(unsafe.Pointer(aData + uintptr(k))))))
		t = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(j)))
		*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(j))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i)))
		*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i))) = t
		i++
	}
	g.hash.i = i
	g.hash.j = j
}

// After all content has been added, invoke HashFinal() to compute
// the final hash.  The hash result is stored in g.hash.r[].
func HashFinal(tls *libc.TLS) { /* speedtest1.c:170:13: */
	var k uint32
	var t uint8
	var i uint8
	var j uint8
	i = g.hash.i
	j = g.hash.j
	for k = uint32(0); k < uint32(32); k++ {
		i++
		t = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i)))
		j = uint8(int32(j) + (int32(t)))
		*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(j)))
		*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(j))) = t
		t = uint8(int32(t) + (int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i))))))
		*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 259 /* &.r */) + uintptr(k))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(t)))
	}
}

// End of the Hash hashing logic
//

// Return the value of a hexadecimal digit.  Return -1 if the input
// is not a hex digit.
func hexDigitValue(tls *libc.TLS, c int8) int32 { /* speedtest1.c:194:12: */
	if (int32(c) >= '0') && (int32(c) <= '9') {
		return (int32(c) - '0')
	}
	if (int32(c) >= 'a') && (int32(c) <= 'f') {
		return ((int32(c) - 'a') + 10)
	}
	if (int32(c) >= 'A') && (int32(c) <= 'F') {
		return ((int32(c) - 'A') + 10)
	}
	return -1
}

// Provide an alternative to sqlite3_stricmp() in older versions of
// SQLite

// Interpret zArg as an integer value, possibly with suffixes.
func integerValue(tls *libc.TLS, zArg uintptr) int32 { /* speedtest1.c:210:12: */
	var v sqlite3_int64 = int64(0)
	var i int32
	var isNeg int32 = 0
	if int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) == '-' {
		isNeg = 1
		zArg++
	} else if int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) == '+' {
		zArg++
	}
	if (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) == '0') && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(1)))) == 'x') {
		var x int32
		zArg += uintptr(2)
		for (libc.AssignInt32(&x, hexDigitValue(tls, *(*int8)(unsafe.Pointer(zArg + uintptr(0)))))) >= 0 {
			v = ((v << 4) + sqlite3_int64(x))
			zArg++
		}
	} else {
		for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))))*2))) & int32(_ISdigit)) != 0 {
			v = (((v * int64(10)) + sqlite3_int64(*(*int8)(unsafe.Pointer(zArg + uintptr(0))))) - int64('0'))
			zArg++
		}
	}
	for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aMult)) / uint64(unsafe.Sizeof(struct {
		zSuffix uintptr
		iMult   int32
		_       [4]byte
	}{}))); i++ {
		if sqlite3.Xsqlite3_stricmp(tls, aMult[i].zSuffix, zArg) == 0 {
			v = v * (sqlite3_int64(aMult[i].iMult))
			break
		}
	}
	if v > int64(0x7fffffff) {
		fatal_error(tls, ts+2153 /* "parameter too la..." */, 0)
	}
	return func() int32 {
		if isNeg != 0 {
			return int32(-v)
		}
		return int32(v)
	}()
}

var aMult = [9]struct {
	zSuffix uintptr
	iMult   int32
	_       [4]byte
}{
	{zSuffix: ts + 2190 /* "KiB" */, iMult: 1024},
	{zSuffix: ts + 2194 /* "MiB" */, iMult: (1024 * 1024)},
	{zSuffix: ts + 2198 /* "GiB" */, iMult: ((1024 * 1024) * 1024)},
	{zSuffix: ts + 2202 /* "KB" */, iMult: 1000},
	{zSuffix: ts + 2205 /* "MB" */, iMult: 1000000},
	{zSuffix: ts + 2208 /* "GB" */, iMult: 1000000000},
	{zSuffix: ts + 2211 /* "K" */, iMult: 1000},
	{zSuffix: ts + 2213 /* "M" */, iMult: 1000000},
	{zSuffix: ts + 2215 /* "G" */, iMult: 1000000000},
} /* speedtest1.c:212:53 */

// Return the current wall-clock time, in milliseconds
func speedtest1_timestamp(tls *libc.TLS) sqlite3_int64 { /* speedtest1.c:255:15: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var t sqlite3_int64 at bp, 8

	if clockVfs == uintptr(0) {
		clockVfs = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0))
	}
	if ((*sqlite3_vfs)(unsafe.Pointer(clockVfs)).iVersion >= 2) && ((*sqlite3_vfs)(unsafe.Pointer(clockVfs)).xCurrentTimeInt64 != uintptr(0)) {
		(*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((clockVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, clockVfs, bp /* &t */)
	} else {
		// var r float64 at bp+8, 8

		(*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((clockVfs + 120 /* &.xCurrentTime */))))(tls, clockVfs, bp+8 /* &r */)
		*(*sqlite3_int64)(unsafe.Pointer(bp /* t */)) = (sqlite3_int64(*(*float64)(unsafe.Pointer(bp + 8 /* r */)) * 86400000.0))
	}
	return *(*sqlite3_int64)(unsafe.Pointer(bp /* t */))
}

var clockVfs uintptr = uintptr(0) /* speedtest1.c:259:22 */

// Return a pseudo-random unsigned integer
func speedtest1_random(tls *libc.TLS) uint32 { /* speedtest1.c:277:14: */
	g.x = ((g.x >> 1) ^ ((uint32(1) + ^(g.x & uint32(1))) & 0xd0000001))
	g.y = ((g.y * uint32(1103515245)) + uint32(12345))
	return (g.x ^ g.y)
}

// Map the value in within the range of 1...limit into another
// number in a way that is chatic and invertable.
func swizzle(tls *libc.TLS, in uint32, limit uint32) uint32 { /* speedtest1.c:286:10: */
	var out uint32 = uint32(0)
	for limit != 0 {
		out = ((out << 1) | (in & uint32(1)))
		in >>= 1
		limit >>= 1
	}
	return out
}

// Round up a number so that it is a power of two minus one
func roundup_allones(tls *libc.TLS, limit uint32) uint32 { /* speedtest1.c:298:10: */
	var m uint32 = uint32(1)
	for m < limit {
		m = ((m << 1) + uint32(1))
	}
	return m
}

// The speedtest1_numbername procedure below converts its argment (an integer)
// into a string which is the English-language name for that number.
// The returned string should be freed with sqlite3_free().
//
// Example:
//
//     speedtest1_numbername(123)   ->  "one hundred twenty three"
func speedtest1_numbername(tls *libc.TLS, n uint32, zOut uintptr, nOut int32) int32 { /* speedtest1.c:312:5: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var i int32 = 0

	if n >= uint32(1000000000) {
		i = i + (speedtest1_numbername(tls, (n / uint32(1000000000)), (zOut + uintptr(i)), (nOut - i)))
		sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2217 /* " billion" */, 0)
		i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i)))))
		n = (n % uint32(1000000000))
	}
	if n >= uint32(1000000) {
		if (i != 0) && (i < (nOut - 1)) {
			*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ')
		}
		i = i + (speedtest1_numbername(tls, (n / uint32(1000000)), (zOut + uintptr(i)), (nOut - i)))
		sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2226 /* " million" */, 0)
		i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i)))))
		n = (n % uint32(1000000))
	}
	if n >= uint32(1000) {
		if (i != 0) && (i < (nOut - 1)) {
			*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ')
		}
		i = i + (speedtest1_numbername(tls, (n / uint32(1000)), (zOut + uintptr(i)), (nOut - i)))
		sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2235 /* " thousand" */, 0)
		i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i)))))
		n = (n % uint32(1000))
	}
	if n >= uint32(100) {
		if (i != 0) && (i < (nOut - 1)) {
			*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ')
		}
		sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2245 /* "%s hundred" */, libc.VaList(bp, ones[(n/uint32(100))]))
		i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i)))))
		n = (n % uint32(100))
	}
	if n >= uint32(20) {
		if (i != 0) && (i < (nOut - 1)) {
			*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ')
		}
		sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2256 /* "%s" */, libc.VaList(bp+8, tens[(n/uint32(10))]))
		i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i)))))
		n = (n % uint32(10))
	}
	if n > uint32(0) {
		if (i != 0) && (i < (nOut - 1)) {
			*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ')
		}
		sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2256 /* "%s" */, libc.VaList(bp+16, ones[n]))
		i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i)))))
	}
	if i == 0 {
		sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2259 /* "zero" */, 0)
		i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i)))))
	}
	return i
}

var ones = [20]uintptr{ts + 2259 /* "zero" */, ts + 2264 /* "one" */, ts + 2268 /* "two" */, ts + 2272 /* "three" */, ts + 2278 /* "four" */, ts + 2283, /* "five" */
	ts + 2288 /* "six" */, ts + 2292 /* "seven" */, ts + 2298 /* "eight" */, ts + 2304 /* "nine" */, ts + 2309 /* "ten" */, ts + 2313 /* "eleven" */, ts + 2320, /* "twelve" */
	ts + 2327 /* "thirteen" */, ts + 2336 /* "fourteen" */, ts + 2345 /* "fifteen" */, ts + 2353 /* "sixteen" */, ts + 2361, /* "seventeen" */
																	ts + 2371 /* "eighteen" */, ts + 2380 /* "nineteen" */} /* speedtest1.c:313:21 */
var tens = [10]uintptr{ts + 2152 /* "" */, ts + 2309 /* "ten" */, ts + 2389 /* "twenty" */, ts + 2396 /* "thirty" */, ts + 2403, /* "forty" */
	ts + 2409 /* "fifty" */, ts + 2415 /* "sixty" */, ts + 2421 /* "seventy" */, ts + 2429 /* "eighty" */, ts + 2436 /* "ninety" */} /* speedtest1.c:317:21 */

// Start a new test case
var zDots = *(*[72]int8)(unsafe.Pointer(ts + 2443 /* "..................." */)) /* speedtest1.c:368:19 */
func speedtest1_begin_test(tls *libc.TLS, iTestNum int32, zTestName uintptr, va uintptr) { /* speedtest1.c:370:6: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	var n int32 = int32(libc.Xstrlen(tls, zTestName))
	var zName uintptr
	var ap va_list
	_ = ap
	ap = va
	zName = sqlite3.Xsqlite3_vmprintf(tls, zTestName, ap)
	_ = ap
	n = int32(libc.Xstrlen(tls, zName))
	if n > 60 {
		*(*int8)(unsafe.Pointer(zName + uintptr(60))) = int8(0)
		n = 60
	}
	if g.bSqlOnly != 0 {
		libc.Xprintf(tls, ts+2515 /* "/* %4d - %s%.*s ..." */, libc.VaList(bp, iTestNum, zName, (60-n), uintptr(unsafe.Pointer(&zDots))))
	} else {
		libc.Xprintf(tls, ts+2535 /* "%4d - %s%.*s " */, libc.VaList(bp+32, iTestNum, zName, (60-n), uintptr(unsafe.Pointer(&zDots))))
		libc.Xfflush(tls, libc.Xstdout)
	}
	sqlite3.Xsqlite3_free(tls, zName)
	g.nResult = 0
	g.iStart = speedtest1_timestamp(tls)
	g.x = 0xad131d0b
	g.y = uint32(0x44f9eac8)
}

// Complete a test case
func speedtest1_end_test(tls *libc.TLS) { /* speedtest1.c:399:6: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var iElapseTime sqlite3_int64 = (speedtest1_timestamp(tls) - g.iStart)
	if g.doCheckpoint != 0 {
		speedtest1_exec(tls, ts+2549 /* "PRAGMA wal_check..." */, 0)
	}
	if !(g.bSqlOnly != 0) {
		*(*sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 24 /* &.iTotal */)) += (iElapseTime)
		libc.Xprintf(tls, ts+2572 /* "%4d.%03ds\n" */, libc.VaList(bp, (int32(iElapseTime/int64(1000))), (int32(iElapseTime%int64(1000)))))
	}
	if g.pStmt != 0 {
		sqlite3.Xsqlite3_finalize(tls, g.pStmt)
		g.pStmt = uintptr(0)
	}
}

// Report end of testing
func speedtest1_final(tls *libc.TLS) { /* speedtest1.c:413:6: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	if !(g.bSqlOnly != 0) {
		libc.Xprintf(tls, ts+2583 /* "       TOTAL%.*s..." */, libc.VaList(bp, (60-5), uintptr(unsafe.Pointer(&zDots)),
			(int32(g.iTotal/int64(1000))), (int32(g.iTotal%int64(1000)))))
	}
	if g.bVerify != 0 {
		var i int32
		libc.Xprintf(tls, ts+2611 /* "Verification Has..." */, libc.VaList(bp+32, g.nResByte))
		HashUpdate(tls, ts+2636 /* "\n" */, uint32(1))
		HashFinal(tls)
		for i = 0; i < 24; i++ {
			libc.Xprintf(tls, ts+2638 /* "%02x" */, libc.VaList(bp+40, int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 259 /* &.r */) + uintptr(i))))))
		}
		if (g.hashFile != 0) && (g.hashFile != libc.Xstdout) {
			libc.Xfclose(tls, g.hashFile)
		}
		libc.Xprintf(tls, ts+2636 /* "\n" */, 0)
	}
}

// Print an SQL statement to standard output
func printSql(tls *libc.TLS, zSql uintptr) { /* speedtest1.c:436:13: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var n int32 = int32(libc.Xstrlen(tls, zSql))
	for (n > 0) && ((int32(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1))))) == ';') || ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0)) {
		n--
	}
	if g.bExplain != 0 {
		libc.Xprintf(tls, ts+2643 /* "EXPLAIN " */, 0)
	}
	libc.Xprintf(tls, ts+2652 /* "%.*s;\n" */, libc.VaList(bp, n, zSql))
	if (g.bExplain != 0) &&
		(((sqlite3.Xsqlite3_strglob(tls, ts+2659 /* "CREATE *" */, zSql) == 0) ||
			(sqlite3.Xsqlite3_strglob(tls, ts+2668 /* "DROP *" */, zSql) == 0)) ||
			(sqlite3.Xsqlite3_strglob(tls, ts+2675 /* "ALTER *" */, zSql) == 0)) {
		libc.Xprintf(tls, ts+2652 /* "%.*s;\n" */, libc.VaList(bp+16, n, zSql))
	}
}

// Shrink memory used, if appropriate and if the SQLite version is capable
// of doing so.
func speedtest1_shrink_memory(tls *libc.TLS) { /* speedtest1.c:456:6: */
	if g.bMemShrink != 0 {
		sqlite3.Xsqlite3_db_release_memory(tls, g.db)
	}
}

// Run SQL
func speedtest1_exec(tls *libc.TLS, zFormat uintptr, va uintptr) { /* speedtest1.c:463:6: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var ap va_list
	_ = ap
	var zSql uintptr
	ap = va
	zSql = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
	_ = ap
	if g.bSqlOnly != 0 {
		printSql(tls, zSql)
	} else {
		*(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) = uintptr(0)
		var rc int32 = sqlite3.Xsqlite3_exec(tls, g.db, zSql, uintptr(0), uintptr(0), bp+24 /* &zErrMsg */)
		if *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) != 0 {
			fatal_error(tls, ts+2683 /* "SQL error: %s\n%s..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)), zSql))
		}
		if rc != 0 {
			fatal_error(tls, ts+2701 /* "exec error: %s\n" */, libc.VaList(bp+16, sqlite3.Xsqlite3_errmsg(tls, g.db)))
		}
	}
	sqlite3.Xsqlite3_free(tls, zSql)
	speedtest1_shrink_memory(tls)
}

// Run SQL and return the first column of the first row as a string.  The
// returned string is obtained from sqlite_malloc() and must be freed by
// the caller.
func speedtest1_once(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* speedtest1.c:485:6: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var ap va_list
	_ = ap
	var zSql uintptr
	// var pStmt uintptr at bp+16, 8

	var zResult uintptr = uintptr(0)
	ap = va
	zSql = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
	_ = ap
	if g.bSqlOnly != 0 {
		printSql(tls, zSql)
	} else {
		var rc int32 = sqlite3.Xsqlite3_prepare_v2(tls, g.db, zSql, -1, bp+16 /* &pStmt */, uintptr(0))
		if rc != 0 {
			fatal_error(tls, ts+2717 /* "SQL error: %s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
		}
		if sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */))) == 100 {
			var z uintptr = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 0)
			if z != 0 {
				zResult = sqlite3.Xsqlite3_mprintf(tls, ts+2256 /* "%s" */, libc.VaList(bp+8, z))
			}
		}
		sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)))
	}
	sqlite3.Xsqlite3_free(tls, zSql)
	speedtest1_shrink_memory(tls)
	return zResult
}

// Prepare an SQL statement
func speedtest1_prepare(tls *libc.TLS, zFormat uintptr, va uintptr) { /* speedtest1.c:512:6: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var ap va_list
	_ = ap
	var zSql uintptr
	ap = va
	zSql = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
	_ = ap
	if g.bSqlOnly != 0 {
		printSql(tls, zSql)
	} else {
		var rc int32
		if g.pStmt != 0 {
			sqlite3.Xsqlite3_finalize(tls, g.pStmt)
		}
		rc = sqlite3.Xsqlite3_prepare_v2(tls, g.db, zSql, -1, (uintptr(unsafe.Pointer(&g)) + 8 /* &.pStmt */), uintptr(0))
		if rc != 0 {
			fatal_error(tls, ts+2717 /* "SQL error: %s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
		}
	}
	sqlite3.Xsqlite3_free(tls, zSql)
}

// Run an SQL statement previously prepared
func speedtest1_run(tls *libc.TLS) { /* speedtest1.c:532:6: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var i int32
	var n int32
	var len int32
	if g.bSqlOnly != 0 {
		return
	}

	g.nResult = 0
	for sqlite3.Xsqlite3_step(tls, g.pStmt) == 100 {
		n = sqlite3.Xsqlite3_column_count(tls, g.pStmt)
		for i = 0; i < n; i++ {
			var z uintptr = sqlite3.Xsqlite3_column_text(tls, g.pStmt, i)
			if z == uintptr(0) {
				z = ts + 2732 /* "nil" */
			}
			len = int32(libc.Xstrlen(tls, z))
			if g.bVerify != 0 {
				var eType int32 = sqlite3.Xsqlite3_column_type(tls, g.pStmt, i)
				// var zPrefix [2]uint8 at bp, 2

				*(*uint8)(unsafe.Pointer(bp /* &zPrefix[0] */ + uintptr(0))) = uint8('\n')
				*(*uint8)(unsafe.Pointer(bp /* &zPrefix[0] */ + uintptr(1))) = uint8(*(*int8)(unsafe.Pointer(ts + 2736 /* "-IFTBN" */ + uintptr(eType))))
				if g.nResByte != 0 {
					HashUpdate(tls, bp /* &zPrefix[0] */, uint32(2))
				} else {
					HashUpdate(tls, (bp /* &zPrefix[0] */ + uintptr(1)), uint32(1))
				}
				if eType == 2 {
					// Omit the value of floating-point results from the verification
					// hash.  The only thing we record is the fact that the result was
					// a floating-point value.
					*(*u64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 104 /* &.nResByte */)) += (uint64(2))
				} else if eType == 4 {
					var nBlob int32 = sqlite3.Xsqlite3_column_bytes(tls, g.pStmt, i)
					var iBlob int32
					// var zChar [2]uint8 at bp+2, 2

					var aBlob uintptr = sqlite3.Xsqlite3_column_blob(tls, g.pStmt, i)
					for iBlob = 0; iBlob < nBlob; iBlob++ {
						*(*uint8)(unsafe.Pointer(bp + 2 /* &zChar[0] */ + uintptr(0))) = uint8(*(*int8)(unsafe.Pointer(ts + 2743 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer(aBlob + uintptr(iBlob)))) >> 4)))))
						*(*uint8)(unsafe.Pointer(bp + 2 /* &zChar[0] */ + uintptr(1))) = uint8(*(*int8)(unsafe.Pointer(ts + 2743 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer(aBlob + uintptr(iBlob)))) & 15)))))
						HashUpdate(tls, bp+2 /* &zChar[0] */, uint32(2))
					}
					*(*u64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 104 /* &.nResByte */)) += (u64((nBlob * 2) + 2))
				} else {
					HashUpdate(tls, z, uint32(len))
					*(*u64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 104 /* &.nResByte */)) += (u64(len + 2))
				}
			}
			if (uint64(g.nResult + len)) < (uint64(unsafe.Sizeof([3000]int8{})) - uint64(2)) {
				if g.nResult > 0 {
					*(*int8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 116 /* &.zResult */) + uintptr(libc.PostIncInt32(&g.nResult, 1)))) = int8(' ')
				}
				libc.Xmemcpy(tls, ((uintptr(unsafe.Pointer(&g)) + 116 /* &.zResult */) + uintptr(g.nResult)), z, (uint64(len + 1)))
				*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 112 /* &.nResult */)) += (len)
			}
		}
	}
	if g.bReprepare != 0 {
		// var pNew uintptr at bp+8, 8

		sqlite3.Xsqlite3_prepare_v2(tls, g.db, sqlite3.Xsqlite3_sql(tls, g.pStmt), -1, bp+8 /* &pNew */, uintptr(0))
		sqlite3.Xsqlite3_finalize(tls, g.pStmt)
		g.pStmt = *(*uintptr)(unsafe.Pointer(bp + 8 /* pNew */))
	} else {
		sqlite3.Xsqlite3_reset(tls, g.pStmt)
	}
	speedtest1_shrink_memory(tls)
}

// The sqlite3_trace() callback function
func traceCallback(tls *libc.TLS, NotUsed uintptr, zSql uintptr) { /* speedtest1.c:599:13: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var n int32 = int32(libc.Xstrlen(tls, zSql))
	for (n > 0) && ((int32(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1))))) == ';') || ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0)) {
		n--
	}
	libc.Xfprintf(tls, libc.Xstderr, ts+2652 /* "%.*s;\n" */, libc.VaList(bp, n, zSql))
}

// Substitute random() function that gives the same random
// sequence on each run, for repeatability.
func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* speedtest1.c:608:13: */
	sqlite3.Xsqlite3_result_int64(tls, context, sqlite3_int64(speedtest1_random(tls)))
}

// Estimate the square root of an integer
func est_square_root(tls *libc.TLS, x int32) int32 { /* speedtest1.c:617:12: */
	var y0 int32 = (x / 2)
	var y1 int32
	var n int32
	for n = 0; (y0 > 0) && (n < 10); n++ {
		y1 = ((y0 + (x / y0)) / 2)
		if y1 == y0 {
			break
		}
		y0 = y1
	}
	return y0
}

// The main and default testset
func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */
	bp := tls.Alloc(2568)
	defer tls.Free(2568)

	var i int32    // Loop counter
	var n int32    // iteration count
	var sz int32   // Size of the tables
	var maxb int32 // Maximum swizzled value
	var x1 uint32 = uint32(0)
	var x2 uint32 = uint32(0) // Parameters
	var len int32 = 0         // Length of the zNum[] string
	// var zNum [2000]int8 at bp+568, 2000
	// A number name

	sz = libc.AssignInt32(&n, (g.szTest * 500))
	*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr(0))) = int8(0)
	maxb = int32(roundup_allones(tls, uint32(sz)))
	speedtest1_begin_test(tls, 100, ts+2760 /* "%d INSERTs into ..." */, libc.VaList(bp, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_exec(tls, ts+2802, /* "CREATE%s TABLE t..." */
		libc.VaList(bp+8, isTemp(tls, 9), g.zNN, g.zNN, g.zNN))
	speedtest1_prepare(tls, ts+2860 /* "INSERT INTO t1 V..." */, libc.VaList(bp+40, n))
	for i = 1; i <= n; i++ {
		x1 = swizzle(tls, uint32(i), uint32(maxb))
		speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
		sqlite3.Xsqlite3_bind_int64(tls, g.pStmt, 1, sqlite3_int64(x1))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, i)
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 3, bp+568 /* &zNum[0] */, -1, uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	n = sz
	speedtest1_begin_test(tls, 110, ts+2913 /* "%d ordered INSER..." */, libc.VaList(bp+48, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_exec(tls,
		ts+2950, /* "CREATE%s TABLE t..." */
		libc.VaList(bp+56, isTemp(tls, 5), g.zNN, g.zPK, g.zNN, g.zNN, g.zWR))
	speedtest1_prepare(tls, ts+3013 /* "INSERT INTO t2 V..." */, libc.VaList(bp+104, n))
	for i = 1; i <= n; i++ {
		x1 = swizzle(tls, uint32(i), uint32(maxb))
		speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, i)
		sqlite3.Xsqlite3_bind_int64(tls, g.pStmt, 2, sqlite3_int64(x1))
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 3, bp+568 /* &zNum[0] */, -1, uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	n = sz
	speedtest1_begin_test(tls, 120, ts+3058 /* "%d unordered INS..." */, libc.VaList(bp+112, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_exec(tls,
		ts+3097, /* "CREATE%s TABLE t..." */
		libc.VaList(bp+120, isTemp(tls, 3), g.zNN, g.zPK, g.zNN, g.zNN, g.zWR))
	speedtest1_prepare(tls, ts+3160 /* "INSERT INTO t3 V..." */, libc.VaList(bp+168, n))
	for i = 1; i <= n; i++ {
		x1 = swizzle(tls, uint32(i), uint32(maxb))
		speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, i)
		sqlite3.Xsqlite3_bind_int64(tls, g.pStmt, 1, sqlite3_int64(x1))
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 3, bp+568 /* &zNum[0] */, -1, uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	n = 25
	speedtest1_begin_test(tls, 130, ts+3205 /* "%d SELECTS, nume..." */, libc.VaList(bp+176, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_prepare(tls,

		ts+3244 /* "SELECT count(*),..." */, libc.VaList(bp+184, n))
	for i = 1; i <= n; i++ {
		if ((i - 1) % g.nRepeat) == 0 {
			x1 = (speedtest1_random(tls) % uint32(maxb))
			x2 = (((speedtest1_random(tls) % uint32(10)) + (uint32(sz / 5000))) + x1)
		}
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	n = 10
	speedtest1_begin_test(tls, 140, ts+3349 /* "%d SELECTS, LIKE..." */, libc.VaList(bp+192, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_prepare(tls,

		ts+3377 /* "SELECT count(*),..." */, libc.VaList(bp+200, n))
	for i = 1; i <= n; i++ {
		if ((i - 1) % g.nRepeat) == 0 {
			x1 = (speedtest1_random(tls) % uint32(maxb))
			*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr(0))) = int8('%')
			len = speedtest1_numbername(tls, uint32(i), (bp + 568 /* &zNum[0] */ + uintptr(1)), (int32(uint64(unsafe.Sizeof([2000]int8{})) - uint64(2))))
			*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr(len))) = int8('%')
			*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr((len + 1)))) = int8(0)
		}
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, (len + 1), uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	n = 10
	speedtest1_begin_test(tls, 142, ts+3472 /* "%d SELECTS w/ORD..." */, libc.VaList(bp+208, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_prepare(tls,

		ts+3505 /* "SELECT a, b, c F..." */, libc.VaList(bp+216, n))
	for i = 1; i <= n; i++ {
		if ((i - 1) % g.nRepeat) == 0 {
			x1 = (speedtest1_random(tls) % uint32(maxb))
			*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr(0))) = int8('%')
			len = speedtest1_numbername(tls, uint32(i), (bp + 568 /* &zNum[0] */ + uintptr(1)), (int32(uint64(unsafe.Sizeof([2000]int8{})) - uint64(2))))
			*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr(len))) = int8('%')
			*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr((len + 1)))) = int8(0)
		}
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, (len + 1), uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	n = 10 // g.szTest/5;
	speedtest1_begin_test(tls, 145, ts+3569 /* "%d SELECTS w/ORD..." */, libc.VaList(bp+224, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_prepare(tls,

		ts+3612 /* "SELECT a, b, c F..." */, libc.VaList(bp+232, n))
	for i = 1; i <= n; i++ {
		if ((i - 1) % g.nRepeat) == 0 {
			x1 = (speedtest1_random(tls) % uint32(maxb))
			*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr(0))) = int8('%')
			len = speedtest1_numbername(tls, uint32(i), (bp + 568 /* &zNum[0] */ + uintptr(1)), (int32(uint64(unsafe.Sizeof([2000]int8{})) - uint64(2))))
			*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr(len))) = int8('%')
			*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr((len + 1)))) = int8(0)
		}
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, (len + 1), uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 150, ts+3685 /* "CREATE INDEX fiv..." */, 0)
	speedtest1_exec(tls, ts+3709 /* "BEGIN;" */, 0)
	speedtest1_exec(tls, ts+3716 /* "CREATE UNIQUE IN..." */, 0)
	speedtest1_exec(tls, ts+3750 /* "CREATE INDEX t1c..." */, 0)
	speedtest1_exec(tls, ts+3777 /* "CREATE UNIQUE IN..." */, 0)
	speedtest1_exec(tls, ts+3811 /* "CREATE INDEX t2c..." */, 0)
	speedtest1_exec(tls, ts+3843 /* "CREATE INDEX t3b..." */, 0)
	speedtest1_exec(tls, ts+3873 /* "COMMIT;" */, 0)
	speedtest1_end_test(tls)

	n = (sz / 5)
	speedtest1_begin_test(tls, 160, ts+3881 /* "%d SELECTS, nume..." */, libc.VaList(bp+240, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_prepare(tls,

		ts+3918 /* "SELECT count(*),..." */, libc.VaList(bp+248, n))
	for i = 1; i <= n; i++ {
		if ((i - 1) % g.nRepeat) == 0 {
			x1 = (speedtest1_random(tls) % uint32(maxb))
			x2 = (((speedtest1_random(tls) % uint32(10)) + (uint32(sz / 5000))) + x1)
		}
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	n = (sz / 5)
	speedtest1_begin_test(tls, 161, ts+4023 /* "%d SELECTS, nume..." */, libc.VaList(bp+256, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_prepare(tls,

		ts+4055 /* "SELECT count(*),..." */, libc.VaList(bp+264, n))
	for i = 1; i <= n; i++ {
		if ((i - 1) % g.nRepeat) == 0 {
			x1 = (speedtest1_random(tls) % uint32(maxb))
			x2 = (((speedtest1_random(tls) % uint32(10)) + (uint32(sz / 5000))) + x1)
		}
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	n = (sz / 5)
	speedtest1_begin_test(tls, 170, ts+4160 /* "%d SELECTS, text..." */, libc.VaList(bp+272, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_prepare(tls,

		ts+4194 /* "SELECT count(*),..." */, libc.VaList(bp+280, n))
	for i = 1; i <= n; i++ {
		if ((i - 1) % g.nRepeat) == 0 {
			x1 = swizzle(tls, uint32(i), uint32(maxb))
			len = speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, (int32(uint64(unsafe.Sizeof([2000]int8{})) - uint64(1))))
		}
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, len, uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	n = sz
	speedtest1_begin_test(tls, 180, ts+4306 /* "%d INSERTS with ..." */, libc.VaList(bp+288, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_exec(tls,

		ts+4336, /* "CREATE%s TABLE t..." */
		libc.VaList(bp+296, isTemp(tls, 1), g.zNN, g.zPK, g.zNN, g.zNN, g.zWR))
	speedtest1_exec(tls, ts+4407 /* "CREATE INDEX t4b..." */, 0)
	speedtest1_exec(tls, ts+4433 /* "CREATE INDEX t4c..." */, 0)
	speedtest1_exec(tls, ts+4459 /* "INSERT INTO t4 S..." */, 0)
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	n = sz
	speedtest1_begin_test(tls, 190, ts+4491 /* "DELETE and REFIL..." */, libc.VaList(bp+344, n))
	speedtest1_exec(tls, ts+4519 /* "DELETE FROM t2;" */, 0)
	speedtest1_exec(tls, ts+4535 /* "INSERT INTO t2 S..." */, 0)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 200, ts+4568 /* "VACUUM" */, 0)
	speedtest1_exec(tls, ts+4568 /* "VACUUM" */, 0)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 210, ts+4575 /* "ALTER TABLE ADD ..." */, 0)
	speedtest1_exec(tls, ts+4609 /* "ALTER TABLE t2 A..." */, 0)
	speedtest1_exec(tls, ts+4649 /* "SELECT sum(d) FR..." */, 0)
	speedtest1_end_test(tls)

	n = (sz / 5)
	speedtest1_begin_test(tls, 230, ts+4671 /* "%d UPDATES, nume..." */, libc.VaList(bp+352, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_prepare(tls,
		ts+4708 /* "UPDATE t2 SET d=..." */, libc.VaList(bp+360, n))
	for i = 1; i <= n; i++ {
		x1 = (speedtest1_random(tls) % uint32(maxb))
		x2 = (((speedtest1_random(tls) % uint32(10)) + (uint32(sz / 5000))) + x1)
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	n = sz
	speedtest1_begin_test(tls, 240, ts+4767 /* "%d UPDATES of in..." */, libc.VaList(bp+368, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_prepare(tls,
		ts+4797 /* "UPDATE t2 SET d=..." */, libc.VaList(bp+376, n))
	for i = 1; i <= n; i++ {
		x1 = ((speedtest1_random(tls) % uint32(sz)) + uint32(1))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 250, ts+4841 /* "One big UPDATE o..." */, libc.VaList(bp+384, sz))
	speedtest1_exec(tls, ts+4882 /* "UPDATE t2 SET d=..." */, 0)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 260, ts+4902 /* "Query added colu..." */, 0)
	speedtest1_exec(tls, ts+4649 /* "SELECT sum(d) FR..." */, 0)
	speedtest1_end_test(tls)

	n = (sz / 5)
	speedtest1_begin_test(tls, 270, ts+4935 /* "%d DELETEs, nume..." */, libc.VaList(bp+392, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_prepare(tls,
		ts+4972 /* "DELETE FROM t2 W..." */, libc.VaList(bp+400, n))
	for i = 1; i <= n; i++ {
		x1 = ((speedtest1_random(tls) % uint32(maxb)) + uint32(1))
		x2 = (((speedtest1_random(tls) % uint32(10)) + (uint32(sz / 5000))) + x1)
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	n = sz
	speedtest1_begin_test(tls, 280, ts+5026 /* "%d DELETEs of in..." */, libc.VaList(bp+408, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_prepare(tls,
		ts+5056 /* "DELETE FROM t3 W..." */, libc.VaList(bp+416, n))
	for i = 1; i <= n; i++ {
		x1 = ((speedtest1_random(tls) % uint32(sz)) + uint32(1))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 290, ts+5095 /* "Refill two %d-ro..." */, libc.VaList(bp+424, sz))
	speedtest1_exec(tls, ts+5134 /* "REPLACE INTO t2(..." */, 0)
	speedtest1_exec(tls, ts+5178 /* "REPLACE INTO t3(..." */, 0)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 300, ts+5222 /* "Refill a %d-row ..." */, libc.VaList(bp+432, sz))
	speedtest1_exec(tls, ts+4519 /* "DELETE FROM t2;" */, 0)
	speedtest1_exec(tls,
		ts+5263 /* "INSERT INTO t2(a..." */, 0)
	speedtest1_exec(tls,
		ts+5328 /* "INSERT INTO t2(a..." */, 0)
	speedtest1_end_test(tls)

	n = (sz / 5)
	speedtest1_begin_test(tls, 310, ts+5393 /* "%d four-ways joi..." */, libc.VaList(bp+440, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_prepare(tls,

		ts+5412 /* "SELECT t1.c FROM..." */, 0)
	for i = 1; i <= n; i++ {
		x1 = ((speedtest1_random(tls) % uint32(sz)) + uint32(1))
		x2 = (((speedtest1_random(tls) % uint32(10)) + x1) + uint32(4))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 320, ts+5525 /* "subquery in resu..." */, libc.VaList(bp+448, n))
	speedtest1_prepare(tls,

		ts+5548 /* "SELECT sum(a), m..." */, 0)
	sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (est_square_root(tls, g.szTest) * 50))
	speedtest1_run(tls)
	speedtest1_end_test(tls)

	sz = libc.AssignInt32(&n, (g.szTest * 700))
	*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr(0))) = int8(0)
	maxb = int32(roundup_allones(tls, (uint32(sz / 3))))
	speedtest1_begin_test(tls, 400, ts+5666 /* "%d REPLACE ops o..." */, libc.VaList(bp+456, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_exec(tls, ts+5691, /* "CREATE%s TABLE t..." */
		libc.VaList(bp+464, isTemp(tls, 9), g.zNN))
	speedtest1_prepare(tls, ts+5739 /* "REPLACE INTO t5 ..." */, libc.VaList(bp+480, n))
	for i = 1; i <= n; i++ {
		x1 = swizzle(tls, uint32(i), uint32(maxb))
		speedtest1_numbername(tls, uint32(i), bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(sqlite3_int64(x1)))
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 2, bp+568 /* &zNum[0] */, -1, uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)
	speedtest1_begin_test(tls, 410, ts+5783 /* "%d SELECTS on an..." */, libc.VaList(bp+488, n))
	speedtest1_prepare(tls, ts+5804 /* "SELECT b FROM t5..." */, libc.VaList(bp+496, n))
	for i = 1; i <= n; i++ {
		x1 = swizzle(tls, uint32(i), uint32(maxb))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(sqlite3_int64(x1)))
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)

	sz = libc.AssignInt32(&n, (g.szTest * 700))
	*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr(0))) = int8(0)
	maxb = int32(roundup_allones(tls, (uint32(sz / 3))))
	speedtest1_begin_test(tls, 500, ts+5846 /* "%d REPLACE on TE..." */, libc.VaList(bp+504, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_exec(tls, ts+5868, /* "CREATE%s TABLE t..." */
		libc.VaList(bp+512, isTemp(tls, 9), g.zNN,
			func() uintptr {
				if sqlite3.Xsqlite3_libversion_number(tls) >= 3008002 {
					return ts + 5915 /* "WITHOUT ROWID" */
				}
				return ts + 2152 /* "" */
			}()))
	speedtest1_prepare(tls, ts+5929 /* "REPLACE INTO t6 ..." */, libc.VaList(bp+536, n))
	for i = 1; i <= n; i++ {
		x1 = swizzle(tls, uint32(i), uint32(maxb))
		speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, i)
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, -1, uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)
	speedtest1_begin_test(tls, 510, ts+5973 /* "%d SELECTS on a ..." */, libc.VaList(bp+544, n))
	speedtest1_prepare(tls, ts+5997 /* "SELECT b FROM t6..." */, libc.VaList(bp+552, n))
	for i = 1; i <= n; i++ {
		x1 = swizzle(tls, uint32(i), uint32(maxb))
		speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, -1, uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)
	speedtest1_begin_test(tls, 520, ts+6039 /* "%d SELECT DISTIN..." */, libc.VaList(bp+560, n))
	speedtest1_exec(tls, ts+6058 /* "SELECT DISTINCT ..." */, 0)
	speedtest1_exec(tls, ts+6085 /* "SELECT DISTINCT ..." */, 0)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 980, ts+6112 /* "PRAGMA integrity..." */, 0)
	speedtest1_exec(tls, ts+6112 /* "PRAGMA integrity..." */, 0)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 990, ts+6135 /* "ANALYZE" */, 0)
	speedtest1_exec(tls, ts+6135 /* "ANALYZE" */, 0)
	speedtest1_end_test(tls)
}

// A testset for common table expressions.  This exercises code
// for views, subqueries, co-routines, etc.
func testset_cte(tls *libc.TLS) { /* speedtest1.c:1144:6: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var zPuz uintptr
	var rSpacing float64
	var nElem int32

	if g.szTest < 25 {
		zPuz = azPuzzle[0]
	} else if g.szTest < 70 {
		zPuz = azPuzzle[1]
	} else {
		zPuz = azPuzzle[2]
	}
	speedtest1_begin_test(tls, 100, ts+6143 /* "Sudoku with recu..." */, 0)
	speedtest1_prepare(tls,

		ts+6174 /* "WITH RECURSIVE\n ..." */, 0)
	sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, zPuz, -1, uintptr(0))
	speedtest1_run(tls)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 200, ts+6978 /* "Sudoku with VALU..." */, 0)
	speedtest1_prepare(tls,

		ts+7006 /* "WITH RECURSIVE\n ..." */, 0)
	sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, zPuz, -1, uintptr(0))
	speedtest1_run(tls)
	speedtest1_end_test(tls)

	rSpacing = (5.0 / float64(g.szTest))
	speedtest1_begin_test(tls, 300, ts+7818 /* "Mandelbrot Set w..." */, libc.VaList(bp, rSpacing))
	speedtest1_prepare(tls,

		ts+7849 /* "WITH RECURSIVE \n..." */, 0)
	sqlite3.Xsqlite3_bind_double(tls, g.pStmt, 1, (rSpacing * .05))
	sqlite3.Xsqlite3_bind_double(tls, g.pStmt, 2, rSpacing)
	speedtest1_run(tls)
	speedtest1_end_test(tls)

	nElem = (10000 * g.szTest)
	speedtest1_begin_test(tls, 400, ts+8445 /* "EXCEPT operator ..." */, libc.VaList(bp+8, nElem))
	speedtest1_prepare(tls,

		ts+8482, /* "WITH RECURSIVE \n..." */
		libc.VaList(bp+16, nElem, nElem))
	speedtest1_run(tls)
	speedtest1_end_test(tls)
}

var azPuzzle = [3]uintptr{
	// Easy

	ts + 8713, /* "534...9..67.195...." */

	// Medium

	ts + 8795, /* "53....9..6..195...." */

	// Hard

	ts + 8877, /* "53.......6..195...." */
} /* speedtest1.c:1145:21 */

// Compute a pseudo-random floating point ascii number.
func speedtest1_random_ascii_fp(tls *libc.TLS, zFP uintptr) { /* speedtest1.c:1297:6: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var x int32 = int32(speedtest1_random(tls))
	var y int32 = int32(speedtest1_random(tls))
	var z int32
	z = (y % 10)
	if z < 0 {
		z = -z
	}
	y = y / (10)
	sqlite3.Xsqlite3_snprintf(tls, 100, zFP, ts+8959 /* "%d.%de%d" */, libc.VaList(bp, y, z, (x%200)))
}

// A testset for floating-point numbers.
func testset_fp(tls *libc.TLS) { /* speedtest1.c:1310:6: */
	bp := tls.Alloc(272)
	defer tls.Free(272)

	var n int32
	var i int32
	// var zFP1 [100]int8 at bp+72, 100

	// var zFP2 [100]int8 at bp+172, 100

	n = (g.szTest * 5000)
	speedtest1_begin_test(tls, 100, ts+8968 /* "Fill a table wit..." */, libc.VaList(bp, (n*2)))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_exec(tls, ts+8999, /* "CREATE%s TABLE t..." */
		libc.VaList(bp+8, isTemp(tls, 1), g.zNN, g.zNN))
	speedtest1_prepare(tls, ts+9040 /* "INSERT INTO t1 V..." */, libc.VaList(bp+32, n))
	for i = 1; i <= n; i++ {
		speedtest1_random_ascii_fp(tls, bp+72 /* &zFP1[0] */)
		speedtest1_random_ascii_fp(tls, bp+172 /* &zFP2[0] */)
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+72 /* &zFP1[0] */, -1, uintptr(0))
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 2, bp+172 /* &zFP2[0] */, -1, uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	n = ((g.szTest / 25) + 2)
	speedtest1_begin_test(tls, 110, ts+9082 /* "%d range queries" */, libc.VaList(bp+40, n))
	speedtest1_prepare(tls, ts+9099 /* "SELECT sum(b) FR..." */, 0)
	for i = 1; i <= n; i++ {
		speedtest1_random_ascii_fp(tls, bp+72 /* &zFP1[0] */)
		speedtest1_random_ascii_fp(tls, bp+172 /* &zFP2[0] */)
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+72 /* &zFP1[0] */, -1, uintptr(0))
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 2, bp+172 /* &zFP2[0] */, -1, uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 120, ts+9147 /* "CREATE INDEX thr..." */, 0)
	speedtest1_exec(tls, ts+3709 /* "BEGIN;" */, 0)
	speedtest1_exec(tls, ts+9172 /* "CREATE INDEX t1a..." */, 0)
	speedtest1_exec(tls, ts+9199 /* "CREATE INDEX t1b..." */, 0)
	speedtest1_exec(tls, ts+9226 /* "CREATE INDEX t1a..." */, 0)
	speedtest1_exec(tls, ts+3873 /* "COMMIT;" */, 0)
	speedtest1_end_test(tls)

	n = ((g.szTest / 3) + 2)
	speedtest1_begin_test(tls, 130, ts+9256 /* "%d indexed range..." */, libc.VaList(bp+48, n))
	speedtest1_prepare(tls, ts+9099 /* "SELECT sum(b) FR..." */, 0)
	for i = 1; i <= n; i++ {
		speedtest1_random_ascii_fp(tls, bp+72 /* &zFP1[0] */)
		speedtest1_random_ascii_fp(tls, bp+172 /* &zFP2[0] */)
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+72 /* &zFP1[0] */, -1, uintptr(0))
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 2, bp+172 /* &zFP2[0] */, -1, uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)

	n = (g.szTest * 5000)
	speedtest1_begin_test(tls, 140, ts+9281 /* "%d calls to roun..." */, libc.VaList(bp+56, n))
	speedtest1_exec(tls, ts+9301 /* "SELECT sum(round..." */, 0)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 150, ts+9344 /* "%d printf() call..." */, libc.VaList(bp+64, (n*4)))
	speedtest1_exec(tls,

		ts+9362 /* "WITH c(fmt) AS (..." */, 0)
	speedtest1_end_test(tls)
}

// Generate two numbers between 1 and mx.  The first number is less than
// the second.  Usually the numbers are near each other but can sometimes
// be far apart.
func twoCoords(tls *libc.TLS, p1 int32, p2 int32, mx uint32, pX0 uintptr, pX1 uintptr) { /* speedtest1.c:1383:13: */
	var d uint32
	var x0 uint32
	var x1 uint32
	var span uint32

	span = ((mx / uint32(100)) + uint32(1))
	if (speedtest1_random(tls) % uint32(3)) == uint32(0) {
		span = span * (uint32(p1))
	}
	if (speedtest1_random(tls) % uint32(p2)) == uint32(0) {
		span = (mx / uint32(2))
	}
	d = ((speedtest1_random(tls) % span) + uint32(1))
	x0 = ((speedtest1_random(tls) % (mx - d)) + uint32(1))
	x1 = (x0 + d)
	*(*uint32)(unsafe.Pointer(pX0)) = x0
	*(*uint32)(unsafe.Pointer(pX1)) = x1
}

// The following routine is an R-Tree geometry callback.  It returns
// true if the object overlaps a slice on the Y coordinate between the
// two values given as arguments.  In other words
//
//     SELECT count(*) FROM rt1 WHERE id MATCH xslice(10,20);
//
// Is the same as saying:
//
//     SELECT count(*) FROM rt1 WHERE y1>=10 AND y0<=20;
func xsliceGeometryCallback(tls *libc.TLS, p uintptr, nCoord int32, aCoord uintptr, pRes uintptr) int32 { /* speedtest1.c:1412:12: */
	*(*int32)(unsafe.Pointer(pRes)) = (libc.Bool32((*(*float64)(unsafe.Pointer(aCoord + uintptr(3)*8)) >= *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).aParam + uintptr(0)*8))) && (*(*float64)(unsafe.Pointer(aCoord + uintptr(2)*8)) <= *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).aParam + uintptr(1)*8)))))
	return 0
}

// A testset for the R-Tree virtual table
func testset_rtree(tls *libc.TLS, p1 int32, p2 int32) { /* speedtest1.c:1427:6: */
	bp := tls.Alloc(224)
	defer tls.Free(224)

	var i uint32
	var n uint32
	var mxCoord uint32
	// var x0 uint32 at bp+200, 4

	// var x1 uint32 at bp+204, 4

	// var y0 uint32 at bp+208, 4

	// var y1 uint32 at bp+212, 4

	// var z0 uint32 at bp+216, 4

	// var z1 uint32 at bp+220, 4

	var iStep uint32
	var mxRowid uint32
	var aCheck uintptr = sqlite3.Xsqlite3_malloc(tls, (int32((uint64(unsafe.Sizeof(int32(0))) * uint64(g.szTest)) * uint64(500))))

	mxCoord = uint32(15000)
	mxRowid = libc.AssignUint32(&n, (uint32(g.szTest * 500)))
	speedtest1_begin_test(tls, 100, ts+9457 /* "%d INSERTs into ..." */, libc.VaList(bp, n))
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_exec(tls, ts+9483 /* "CREATE VIRTUAL T..." */, 0)
	speedtest1_prepare(tls,
		ts+9542 /* "INSERT INTO rt1(..." */, 0)
	for i = uint32(1); i <= n; i++ {
		twoCoords(tls, p1, p2, mxCoord, bp+200 /* &x0 */, bp+204 /* &x1 */)
		twoCoords(tls, p1, p2, mxCoord, bp+208 /* &y0 */, bp+212 /* &y1 */)
		twoCoords(tls, p1, p2, mxCoord, bp+216 /* &z0 */, bp+220 /* &z1 */)
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(i))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(*(*uint32)(unsafe.Pointer(bp + 200 /* x0 */))))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 3, int32(*(*uint32)(unsafe.Pointer(bp + 204 /* x1 */))))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 4, int32(*(*uint32)(unsafe.Pointer(bp + 208 /* y0 */))))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 5, int32(*(*uint32)(unsafe.Pointer(bp + 212 /* y1 */))))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 6, int32(*(*uint32)(unsafe.Pointer(bp + 216 /* z0 */))))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 7, int32(*(*uint32)(unsafe.Pointer(bp + 220 /* z1 */))))
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 101, ts+9608 /* "Copy from rtree ..." */, 0)
	speedtest1_exec(tls, ts+9643 /* "CREATE TABLE t1(..." */, 0)
	speedtest1_exec(tls, ts+9701 /* "INSERT INTO t1 S..." */, 0)
	speedtest1_end_test(tls)

	n = (uint32(g.szTest * 200))
	speedtest1_begin_test(tls, 110, ts+9734 /* "%d one-dimension..." */, libc.VaList(bp+8, n))
	speedtest1_prepare(tls, ts+9777 /* "SELECT count(*) ..." */, 0)
	iStep = (mxCoord / n)
	for i = uint32(0); i < n; i++ {
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep)))
		speedtest1_run(tls)
		*(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)
	}
	speedtest1_end_test(tls)

	if g.bVerify != 0 {
		n = (uint32(g.szTest * 200))
		speedtest1_begin_test(tls, 111, ts+9826 /* "Verify result fr..." */, 0)
		speedtest1_prepare(tls, ts+9873 /* "SELECT count(*) ..." */, 0)
		iStep = (mxCoord / n)
		for i = uint32(0); i < n; i++ {
			sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
			sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep)))
			speedtest1_run(tls)
			if *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) != libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */) {
				fatal_error(tls, ts+9921, /* "Count disagree s..." */
					libc.VaList(bp+16, i, (i*iStep), ((i+uint32(1))*iStep), *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)), libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)))
			}
		}
		speedtest1_end_test(tls)
	}

	n = (uint32(g.szTest * 200))
	speedtest1_begin_test(tls, 120, ts+9963 /* "%d one-dimension..." */, libc.VaList(bp+56, n))
	speedtest1_prepare(tls, ts+10004 /* "SELECT count(*) ..." */, 0)
	iStep = (mxCoord / n)
	for i = uint32(0); i < n; i++ {
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep)))
		speedtest1_run(tls)
		*(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)
	}
	speedtest1_end_test(tls)

	if g.bVerify != 0 {
		n = (uint32(g.szTest * 200))
		speedtest1_begin_test(tls, 121, ts+10053 /* "Verify result fr..." */, 0)
		speedtest1_prepare(tls, ts+10098 /* "SELECT count(*) ..." */, 0)
		iStep = (mxCoord / n)
		for i = uint32(0); i < n; i++ {
			sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
			sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep)))
			speedtest1_run(tls)
			if *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) != libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */) {
				fatal_error(tls, ts+9921, /* "Count disagree s..." */
					libc.VaList(bp+64, i, (i*iStep), ((i+uint32(1))*iStep), *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)), libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)))
			}
		}
		speedtest1_end_test(tls)
	}

	n = (uint32(g.szTest * 200))
	speedtest1_begin_test(tls, 125, ts+10146 /* "%d custom geomet..." */, libc.VaList(bp+104, n))
	sqlite3.Xsqlite3_rtree_geometry_callback(tls, g.db, ts+10182 /* "xslice" */, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
	}{xsliceGeometryCallback})), uintptr(0))
	speedtest1_prepare(tls, ts+10189 /* "SELECT count(*) ..." */, 0)
	iStep = (mxCoord / n)
	for i = uint32(0); i < n; i++ {
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep)))
		speedtest1_run(tls)
		if *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) != libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */) {
			fatal_error(tls, ts+9921, /* "Count disagree s..." */
				libc.VaList(bp+112, i, (i*iStep), ((i+uint32(1))*iStep), *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)), libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)))
		}
	}
	speedtest1_end_test(tls)

	n = (uint32(g.szTest * 400))
	speedtest1_begin_test(tls, 130, ts+10243 /* "%d three-dimensi..." */, libc.VaList(bp+152, n))
	speedtest1_prepare(tls,
		ts+10286 /* "SELECT count(*) ..." */, 0)
	iStep = (mxCoord / n)
	for i = uint32(0); i < n; i++ {
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep)))
		speedtest1_run(tls)
		*(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)
	}
	speedtest1_end_test(tls)

	n = (uint32(g.szTest * 500))
	speedtest1_begin_test(tls, 140, ts+10379 /* "%d rowid queries" */, libc.VaList(bp+160, n))
	speedtest1_prepare(tls, ts+10396 /* "SELECT * FROM rt..." */, 0)
	for i = uint32(1); i <= n; i++ {
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(i))
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)

	n = (uint32(g.szTest * 50))
	speedtest1_begin_test(tls, 150, ts+10426 /* "%d UPDATEs using..." */, libc.VaList(bp+168, n))
	speedtest1_prepare(tls, ts+10449 /* "UPDATE rt1 SET x..." */, 0)
	for i = uint32(1); i <= n; i++ {
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(((i * uint32(251)) % mxRowid) + uint32(1))))
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)

	n = (uint32(g.szTest * 5))
	speedtest1_begin_test(tls, 155, ts+10497 /* "%d UPDATEs using..." */, libc.VaList(bp+176, n))
	speedtest1_prepare(tls,
		ts+10538 /* "UPDATE rt1 SET x..." */, 0)
	iStep = (mxCoord / n)
	for i = uint32(0); i < n; i++ {
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
		speedtest1_run(tls)
		*(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)
	}
	speedtest1_end_test(tls)

	n = (uint32(g.szTest * 50))
	speedtest1_begin_test(tls, 160, ts+10600 /* "%d DELETEs using..." */, libc.VaList(bp+184, n))
	speedtest1_prepare(tls, ts+10623 /* "DELETE FROM rt1 ..." */, 0)
	for i = uint32(1); i <= n; i++ {
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(((i * uint32(257)) % mxRowid) + uint32(1))))
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)

	n = (uint32(g.szTest * 5))
	speedtest1_begin_test(tls, 165, ts+10651 /* "%d DELETEs using..." */, libc.VaList(bp+192, n))
	speedtest1_prepare(tls, ts+10692 /* "DELETE FROM rt1 ..." */, 0)
	iStep = (mxCoord / n)
	for i = uint32(0); i < n; i++ {
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
		speedtest1_run(tls)
		*(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)
	}
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 170, ts+10734 /* "Restore deleted ..." */, 0)
	speedtest1_exec(tls, ts+10781 /* "INSERT OR IGNORE..." */, 0)
	speedtest1_end_test(tls)
}

// A testset that does key/value storage on tables with many columns.
// This is the kind of workload generated by ORMs such as CoreData.
func testset_orm(tls *libc.TLS) { /* speedtest1.c:1612:6: */
	bp := tls.Alloc(2016)
	defer tls.Free(2016)

	var i uint32
	var j uint32
	var n uint32
	var nRow uint32
	var x1 uint32
	var len uint32
	// var zNum [2000]int8 at bp+16, 2000

	nRow = libc.AssignUint32(&n, (uint32(g.szTest * 250)))
	speedtest1_begin_test(tls, 100, ts+10824 /* "Fill %d rows" */, libc.VaList(bp, n))
	speedtest1_exec(tls,

		ts+10837 /* "BEGIN;CREATE TAB..." */, 0)
	speedtest1_prepare(tls,

		ts+14737 /* "INSERT INTO ZLOO..." */, 0)
	for i = uint32(0); i < n; i++ {
		x1 = speedtest1_random(tls)
		speedtest1_numbername(tls, (x1 % uint32(1000)), bp+16 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
		len = uint32(int32(libc.Xstrlen(tls, bp+16 /* &zNum[0] */)))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i ^ uint32(0xf))))
		for j = uint32(0); zType[j] != 0; j++ {
			switch int32(zType[j]) {
			case 'I':
				fallthrough
			case 'T':
				sqlite3.Xsqlite3_bind_int64(tls, g.pStmt, (int32(j + uint32(2))), int64(x1))
				break
			case 'F':
				sqlite3.Xsqlite3_bind_double(tls, g.pStmt, (int32(j + uint32(2))), float64(x1))
				break
			case 'V':
				fallthrough
			case 'B':
				sqlite3.Xsqlite3_bind_text64(tls, g.pStmt, (int32(j + uint32(2))), bp+16 /* &zNum[0] */, uint64(len),
					uintptr(0), uint8(1))
				break
			}
		}
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+3873 /* "COMMIT;" */, 0)
	speedtest1_end_test(tls)

	n = (uint32(g.szTest * 250))
	speedtest1_begin_test(tls, 110, ts+17981 /* "Query %d rows by..." */, libc.VaList(bp+8, n))
	speedtest1_prepare(tls,

		ts+18004 /* "SELECT ZCYANBASE..." */, 0)
	for i = uint32(0); i < n; i++ {
		x1 = (speedtest1_random(tls) % nRow)
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1))
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)
}

var zType = *(*[120]int8)(unsafe.Pointer(ts + 20757 /* "IBBIIITIVVITBTBF..." */)) /* speedtest1.c:1617:21 */

//
func testset_trigger(tls *libc.TLS) { /* speedtest1.c:1879:6: */
	bp := tls.Alloc(2032)
	defer tls.Free(2032)

	var jj int32
	var ii int32
	// var zNum [2000]int8 at bp+32, 2000
	// A number name

	var NROW int32 = (500 * g.szTest)
	var NROW2 int32 = (100 * g.szTest)

	speedtest1_exec(tls,

		ts+20877 /* "BEGIN;CREATE TAB..." */, 0)
	for jj = 1; jj <= 3; jj++ {
		speedtest1_prepare(tls, ts+21205 /* "INSERT INTO t%d ..." */, libc.VaList(bp, jj))
		for ii = 0; ii < NROW; ii++ {
			var x1 int32 = (int32(speedtest1_random(tls) % uint32(NROW)))
			speedtest1_numbername(tls, uint32(x1), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
			sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, x1)
			sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 2, bp+32 /* &zNum[0] */, -1, uintptr(0))
			speedtest1_run(tls)
		}
	}
	speedtest1_exec(tls,

		ts+21240 /* "CREATE INDEX i1 ..." */, 0)

	speedtest1_begin_test(tls, 100, ts+21323 /* "speed4p-join1" */, 0)
	speedtest1_prepare(tls,
		ts+21337 /* "SELECT * FROM t1..." */, 0)
	speedtest1_run(tls)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 110, ts+21404 /* "speed4p-join2" */, 0)
	speedtest1_prepare(tls,
		ts+21418 /* "SELECT * FROM t1..." */, 0)
	speedtest1_run(tls)
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 120, ts+21477 /* "speed4p-view1" */, 0)
	for jj = 1; jj <= 3; jj++ {
		speedtest1_prepare(tls, ts+21491 /* "SELECT * FROM v%..." */, libc.VaList(bp+8, jj))
		for ii = 0; ii < NROW2; ii = ii + (3) {
			sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (ii * 3))
			speedtest1_run(tls)
		}
	}
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 130, ts+21525 /* "speed4p-table1" */, 0)
	for jj = 1; jj <= 3; jj++ {
		speedtest1_prepare(tls, ts+21540 /* "SELECT * FROM t%..." */, libc.VaList(bp+16, jj))
		for ii = 0; ii < NROW2; ii = ii + (3) {
			sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (ii * 3))
			speedtest1_run(tls)
		}
	}
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 140, ts+21525 /* "speed4p-table1" */, 0)
	for jj = 1; jj <= 3; jj++ {
		speedtest1_prepare(tls, ts+21540 /* "SELECT * FROM t%..." */, libc.VaList(bp+24, jj))
		for ii = 0; ii < NROW2; ii = ii + (3) {
			sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (ii * 3))
			speedtest1_run(tls)
		}
	}
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 150, ts+21574 /* "speed4p-subselec..." */, 0)
	speedtest1_prepare(tls,

		ts+21593 /* "SELECT (SELECT t..." */, 0)
	for jj = 0; jj < NROW2; jj++ {
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 3))
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)

	speedtest1_begin_test(tls, 160, ts+21708 /* "speed4p-rowid-up..." */, 0)
	speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
	speedtest1_prepare(tls, ts+21729 /* "UPDATE t1 SET i=..." */, 0)
	for jj = 0; jj < NROW2; jj++ {
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, jj)
		speedtest1_run(tls)
	}
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
	speedtest1_end_test(tls)

	speedtest1_exec(tls, ts+21764 /* "CREATE TABLE t5(..." */, 0)
	speedtest1_begin_test(tls, 170, ts+21812 /* "speed4p-insert-i..." */, 0)
	speedtest1_exec(tls, ts+21834 /* "INSERT OR IGNORE..." */, 0)
	speedtest1_end_test(tls)

	speedtest1_exec(tls,

		ts+21879 /* "CREATE TABLE log..." */, 0)

	speedtest1_begin_test(tls, 180, ts+22369 /* "speed4p-trigger1" */, 0)
	speedtest1_prepare(tls, ts+22386 /* "INSERT INTO t4 V..." */, 0)
	for jj = 0; jj < NROW2; jj++ {
		speedtest1_numbername(tls, uint32(jj), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, jj)
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 2, bp+32 /* &zNum[0] */, -1, uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)

	// Note: Of the queries, only half actually update a row. This property
	// was copied over from speed4p.test, where it was probably introduced
	// inadvertantly.
	speedtest1_begin_test(tls, 190, ts+22422 /* "speed4p-trigger2" */, 0)
	speedtest1_prepare(tls, ts+22439 /* "UPDATE t4 SET i ..." */, 0)
	for jj = 1; jj <= (NROW2 * 2); jj = jj + (2) {
		speedtest1_numbername(tls, (uint32(jj * 2)), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 2))
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 2, bp+32 /* &zNum[0] */, -1, uintptr(0))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 3, jj)
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)

	// Note: Same again.
	speedtest1_begin_test(tls, 200, ts+22485 /* "speed4p-trigger3" */, 0)
	speedtest1_prepare(tls, ts+22502 /* "DELETE FROM t4 W..." */, 0)
	for jj = 1; jj <= (NROW2 * 2); jj = jj + (2) {
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 2))
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)

	// The following block contains the same tests as the above block that
	// tests triggers, with one crucial difference: no triggers are defined.
	// So the difference in speed between these tests and the preceding ones
	// is the amount of time taken to compile and execute the trigger programs.
	speedtest1_exec(tls,

		ts+22534 /* "DROP TABLE t4;DR..." */, 0)
	speedtest1_begin_test(tls, 210, ts+22639 /* "speed4p-notrigge..." */, 0)
	speedtest1_prepare(tls, ts+22386 /* "INSERT INTO t4 V..." */, 0)
	for jj = 0; jj < NROW2; jj++ {
		speedtest1_numbername(tls, uint32(jj), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, jj)
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 2, bp+32 /* &zNum[0] */, -1, uintptr(0))
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)
	speedtest1_begin_test(tls, 210, ts+22658 /* "speed4p-notrigge..." */, 0)
	speedtest1_prepare(tls, ts+22439 /* "UPDATE t4 SET i ..." */, 0)
	for jj = 1; jj <= (NROW2 * 2); jj = jj + (2) {
		speedtest1_numbername(tls, (uint32(jj * 2)), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 2))
		sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 2, bp+32 /* &zNum[0] */, -1, uintptr(0))
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 3, jj)
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)
	speedtest1_begin_test(tls, 220, ts+22677 /* "speed4p-notrigge..." */, 0)
	speedtest1_prepare(tls, ts+22502 /* "DELETE FROM t4 W..." */, 0)
	for jj = 1; jj <= (NROW2 * 2); jj = jj + (2) {
		sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 2))
		speedtest1_run(tls)
	}
	speedtest1_end_test(tls)
	speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
}

// A testset used for debugging speedtest1 itself.
func testset_debug1(tls *libc.TLS) { /* speedtest1.c:2081:6: */
	bp := tls.Alloc(2032)
	defer tls.Free(2032)

	var i uint32
	var n uint32
	var x1 uint32
	var x2 uint32
	// var zNum [2000]int8 at bp+32, 2000
	// A number name

	n = uint32(g.szTest)
	for i = uint32(1); i <= n; i++ {
		x1 = swizzle(tls, i, n)
		x2 = swizzle(tls, x1, n)
		speedtest1_numbername(tls, x1, bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
		libc.Xprintf(tls, ts+22696 /* "%5d %5d %5d %s\n" */, libc.VaList(bp, i, x1, x2, bp+32 /* &zNum[0] */))
	}
}

// Copyright (C) 1991-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

// Copyright (C) 1991-2018 Free Software Foundation, Inc.
//   This file is part of the GNU C Library.
//
//   The GNU C Library is free software; you can redistribute it and/or
//   modify it under the terms of the GNU Lesser General Public
//   License as published by the Free Software Foundation; either
//   version 2.1 of the License, or (at your option) any later version.
//
//   The GNU C Library is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//   Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public
//   License along with the GNU C Library; if not, see
//   <http://www.gnu.org/licenses/>.

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

// Attempt to display I/O stats on Linux using /proc/PID/io
func displayLinuxIoStats(tls *libc.TLS, out uintptr) { /* speedtest1.c:2102:13: */
	bp := tls.Alloc(224)
	defer tls.Free(224)

	var in uintptr
	// var z [200]int8 at bp+24, 200

	sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+24 /* &z[0] */, ts+22712 /* "/proc/%d/io" */, libc.VaList(bp, libc.Xgetpid(tls)))
	in = libc.Xfopen(tls, bp+24 /* &z[0] */, ts+22724 /* "rb" */)
	if in == uintptr(0) {
		return
	}
	for libc.Xfgets(tls, bp+24 /* &z[0] */, int32(unsafe.Sizeof([200]int8{})), in) != uintptr(0) {
		var i int32
		for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aTrans)) / uint64(unsafe.Sizeof(struct {
			zPattern uintptr
			zDesc    uintptr
		}{}))); i++ {
			var n int32 = int32(libc.Xstrlen(tls, aTrans[i].zPattern))
			if libc.Xstrncmp(tls, aTrans[i].zPattern, bp+24 /* &z[0] */, uint64(n)) == 0 {
				libc.Xfprintf(tls, out, ts+22727 /* "-- %-28s %s" */, libc.VaList(bp+8, aTrans[i].zDesc, (bp+24 /* &z */ +uintptr(n))))
				break
			}
		}
	}
	libc.Xfclose(tls, in)
}

var aTrans = [7]struct {
	zPattern uintptr
	zDesc    uintptr
}{
	{zPattern: ts + 22739 /* "rchar: " */, zDesc: ts + 22747 /* "Bytes received b..." */},
	{zPattern: ts + 22773 /* "wchar: " */, zDesc: ts + 22781 /* "Bytes sent to wr..." */},
	{zPattern: ts + 22804 /* "syscr: " */, zDesc: ts + 22812 /* "Read() system ca..." */},
	{zPattern: ts + 22833 /* "syscw: " */, zDesc: ts + 22841 /* "Write() system c..." */},
	{zPattern: ts + 22863 /* "read_bytes: " */, zDesc: ts + 22876 /* "Bytes rcvd from ..." */},
	{zPattern: ts + 22901 /* "write_bytes: " */, zDesc: ts + 22915 /* "Bytes sent to st..." */},
	{zPattern: ts + 22938 /* "cancelled_write_..." */, zDesc: ts + 22962 /* "Cancelled write ..." */},
} /* speedtest1.c:2112:7 */

func xCompileOptions(tls *libc.TLS, pCtx uintptr, nVal int32, azVal uintptr, azCol uintptr) int32 { /* speedtest1.c:2138:12: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	libc.Xprintf(tls, ts+22985 /* "-- Compile optio..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azVal + uintptr(0)*8))))
	return 0
}

func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2143:5: */
	bp := tls.Alloc(568)
	defer tls.Free(568)

	var doAutovac int32 = 0   // True for --autovacuum
	var cacheSize int32 = 0   // Desired cache size.  0 means default
	var doExclusive int32 = 0 // True for --exclusive
	var nHeap int32 = 0
	var mnHeap int32 = 0            // Heap size from --heap
	var doIncrvac int32 = 0         // True for --incrvacuum
	var zJMode uintptr = uintptr(0) // Journal mode
	var zKey uintptr = uintptr(0)   // Encryption key
	var nLook int32 = -1
	var szLook int32 = 0   // --lookaside configuration
	var noSync int32 = 0   // True for --nosync
	var pageSize int32 = 0 // Desired page size.  0 means default
	var nPCache int32 = 0
	var szPCache int32 = 0             // --pcache configuration
	var doPCache int32 = 0             // True if --pcache is seen
	var showStats int32 = 0            // True for --stats
	var nThread int32 = 0              // --threads value
	var mmapSize int32 = 0             // How big of a memory map to use
	var memDb int32 = 0                // --memdb.  Use an in-memory database
	var zTSet uintptr = ts + 23008     /* "main" */ // Which --testset torun
	var doTrace int32 = 0              // True for --trace
	var zEncoding uintptr = uintptr(0) // --utf16be or --utf16le
	var zDbName uintptr = uintptr(0)   // Name of the test database

	var pHeap uintptr = uintptr(0)   // Allocated heap space
	var pLook uintptr = uintptr(0)   // Allocated lookaside space
	var pPCache uintptr = uintptr(0) // Allocated storage for pcache
	// var iCur int32 at bp+560, 4

	// var iHi int32 at bp+564, 4
	// Stats values, current and "highwater"
	var i int32  // Loop counter
	var rc int32 // API return code

	// Display the version of SQLite being tested
	libc.Xprintf(tls, ts+23013, /* "-- Speedtest1 fo..." */
		libc.VaList(bp, sqlite3.Xsqlite3_libversion(tls), sqlite3.Xsqlite3_sourceid(tls)))

	// Process command-line arguments
	g.zWR = ts + 2152  /* "" */
	g.zNN = ts + 2152  /* "" */
	g.zPK = ts + 23048 /* "UNIQUE" */
	g.szTest = 100
	g.nRepeat = 1
	for i = 1; i < argc; i++ {
		var z uintptr = *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))
		if int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '-' {
			for ok := true; ok; ok = (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '-') {
				z++
			}
			if libc.Xstrcmp(tls, z, ts+23055 /* "autovacuum" */) == 0 {
				doAutovac = 1
			} else if libc.Xstrcmp(tls, z, ts+23066 /* "cachesize" */) == 0 {
				if i >= (argc - 1) {
					fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
				}
				i++
				cacheSize = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
			} else if libc.Xstrcmp(tls, z, ts+23100 /* "exclusive" */) == 0 {
				doExclusive = 1
			} else if libc.Xstrcmp(tls, z, ts+23110 /* "checkpoint" */) == 0 {
				g.doCheckpoint = 1
			} else if libc.Xstrcmp(tls, z, ts+23121 /* "explain" */) == 0 {
				g.bSqlOnly = 1
				g.bExplain = 1
			} else if libc.Xstrcmp(tls, z, ts+23129 /* "heap" */) == 0 {
				if i >= (argc - 2) {
					fatal_error(tls, ts+23134 /* "missing argument..." */, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
				}
				nHeap = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+1))*8)))
				mnHeap = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+2))*8)))
				i = i + (2)
			} else if libc.Xstrcmp(tls, z, ts+23159 /* "incrvacuum" */) == 0 {
				doIncrvac = 1
			} else if libc.Xstrcmp(tls, z, ts+23170 /* "journal" */) == 0 {
				if i >= (argc - 1) {
					fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
				}
				zJMode = *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8))
			} else if libc.Xstrcmp(tls, z, ts+23178 /* "key" */) == 0 {
				if i >= (argc - 1) {
					fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
				}
				zKey = *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8))
			} else if libc.Xstrcmp(tls, z, ts+23182 /* "lookaside" */) == 0 {
				if i >= (argc - 2) {
					fatal_error(tls, ts+23134 /* "missing argument..." */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
				}
				nLook = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+1))*8)))
				szLook = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+2))*8)))
				i = i + (2)
			} else if libc.Xstrcmp(tls, z, ts+23192 /* "memdb" */) == 0 {
				memDb = 1
			} else if libc.Xstrcmp(tls, z, ts+23198 /* "multithread" */) == 0 {
				sqlite3.Xsqlite3_config(tls, 2, 0)
			} else if libc.Xstrcmp(tls, z, ts+23210 /* "nomemstat" */) == 0 {
				sqlite3.Xsqlite3_config(tls, 9, libc.VaList(bp+56, 0))
			} else if libc.Xstrcmp(tls, z, ts+23220 /* "mmap" */) == 0 {
				if i >= (argc - 1) {
					fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
				}
				mmapSize = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8)))
			} else if libc.Xstrcmp(tls, z, ts+23225 /* "nosync" */) == 0 {
				noSync = 1
			} else if libc.Xstrcmp(tls, z, ts+23232 /* "notnull" */) == 0 {
				g.zNN = ts + 23240 /* "NOT NULL" */
			} else if libc.Xstrcmp(tls, z, ts+23249 /* "output" */) == 0 {
				if i >= (argc - 1) {
					fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
				}
				i++
				if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ts+23256 /* "-" */) == 0 {
					g.hashFile = libc.Xstdout
				} else {
					g.hashFile = libc.Xfopen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ts+23258 /* "wb" */)
					if g.hashFile == uintptr(0) {
						fatal_error(tls, ts+23261 /* "cannot open \"%s\"..." */, libc.VaList(bp+80, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
					}
				}
			} else if libc.Xstrcmp(tls, z, ts+23291 /* "pagesize" */) == 0 {
				if i >= (argc - 1) {
					fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+88, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
				}
				pageSize = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8)))
			} else if libc.Xstrcmp(tls, z, ts+23300 /* "pcache" */) == 0 {
				if i >= (argc - 2) {
					fatal_error(tls, ts+23134 /* "missing argument..." */, libc.VaList(bp+96, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
				}
				nPCache = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+1))*8)))
				szPCache = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+2))*8)))
				doPCache = 1
				i = i + (2)
			} else if libc.Xstrcmp(tls, z, ts+23307 /* "primarykey" */) == 0 {
				g.zPK = ts + 23318 /* "PRIMARY KEY" */
			} else if libc.Xstrcmp(tls, z, ts+23330 /* "repeat" */) == 0 {
				if i >= (argc - 1) {
					fatal_error(tls, ts+23134 /* "missing argument..." */, libc.VaList(bp+104, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
				}
				g.nRepeat = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+1))*8)))
				i = i + (1)
			} else if libc.Xstrcmp(tls, z, ts+23337 /* "reprepare" */) == 0 {
				g.bReprepare = 1
			} else if libc.Xstrcmp(tls, z, ts+23347 /* "serialized" */) == 0 {
				sqlite3.Xsqlite3_config(tls, 3, 0)
			} else if libc.Xstrcmp(tls, z, ts+23358 /* "singlethread" */) == 0 {
				sqlite3.Xsqlite3_config(tls, 1, 0)
			} else if libc.Xstrcmp(tls, z, ts+23371 /* "sqlonly" */) == 0 {
				g.bSqlOnly = 1
			} else if libc.Xstrcmp(tls, z, ts+23379 /* "shrink-memory" */) == 0 {
				g.bMemShrink = 1
			} else if libc.Xstrcmp(tls, z, ts+23393 /* "size" */) == 0 {
				if i >= (argc - 1) {
					fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
				}
				g.szTest = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8)))
			} else if libc.Xstrcmp(tls, z, ts+23398 /* "stats" */) == 0 {
				showStats = 1
			} else if libc.Xstrcmp(tls, z, ts+23404 /* "temp" */) == 0 {
				if i >= (argc - 1) {
					fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+120, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
				}
				i++
				if ((int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) + uintptr(0)))) < '0') || (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) + uintptr(0)))) > '9')) || (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) + uintptr(1)))) != 0) {
					fatal_error(tls, ts+23409 /* "argument to --te..." */, 0)
				}
				g.eTemp = (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) + uintptr(0)))) - '0')
			} else if libc.Xstrcmp(tls, z, ts+23462 /* "testset" */) == 0 {
				if i >= (argc - 1) {
					fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+128, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
				}
				zTSet = *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8))
			} else if libc.Xstrcmp(tls, z, ts+23470 /* "trace" */) == 0 {
				doTrace = 1
			} else if libc.Xstrcmp(tls, z, ts+23476 /* "threads" */) == 0 {
				if i >= (argc - 1) {
					fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+136, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
				}
				nThread = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8)))
			} else if libc.Xstrcmp(tls, z, ts+23484 /* "utf16le" */) == 0 {
				zEncoding = ts + 23484 /* "utf16le" */
			} else if libc.Xstrcmp(tls, z, ts+23492 /* "utf16be" */) == 0 {
				zEncoding = ts + 23492 /* "utf16be" */
			} else if libc.Xstrcmp(tls, z, ts+23500 /* "verify" */) == 0 {
				g.bVerify = 1
				HashInit(tls)
			} else if libc.Xstrcmp(tls, z, ts+23507 /* "without-rowid" */) == 0 {
				g.zWR = ts + 5915  /* "WITHOUT ROWID" */
				g.zPK = ts + 23318 /* "PRIMARY KEY" */
			} else if (libc.Xstrcmp(tls, z, ts+23521 /* "help" */) == 0) || (libc.Xstrcmp(tls, z, ts+23526 /* "?" */) == 0) {
				libc.Xprintf(tls, uintptr(unsafe.Pointer(&zHelp)), libc.VaList(bp+144, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
				libc.Xexit(tls, 0)
			} else {
				fatal_error(tls, ts+23528, /* "unknown option: ..." */
					libc.VaList(bp+152, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
			}
		} else if zDbName == uintptr(0) {
			zDbName = *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))
		} else {
			fatal_error(tls, ts+23569, /* "surplus argument..." */
				libc.VaList(bp+168, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
		}
	}
	if zDbName != uintptr(0) {
		libc.Xunlink(tls, zDbName)
	}
	if nHeap > 0 {
		pHeap = libc.Xmalloc(tls, uint64(nHeap))
		if pHeap == uintptr(0) {
			fatal_error(tls, ts+23612 /* "cannot allocate ..." */, libc.VaList(bp+184, nHeap))
		}
		rc = sqlite3.Xsqlite3_config(tls, 8, libc.VaList(bp+192, pHeap, nHeap, mnHeap))
		if rc != 0 {
			fatal_error(tls, ts+23642 /* "heap configurati..." */, libc.VaList(bp+216, rc))
		}
	}
	if doPCache != 0 {
		if (nPCache > 0) && (szPCache > 0) {
			pPCache = libc.Xmalloc(tls, (uint64(sqlite3_int64(nPCache) * sqlite3_int64(szPCache))))
			if pPCache == uintptr(0) {
				fatal_error(tls, ts+23673, /* "cannot allocate ..." */
					libc.VaList(bp+224, (sqlite3_int64(nPCache)*sqlite3_int64(szPCache))))
			}
		}
		rc = sqlite3.Xsqlite3_config(tls, 7, libc.VaList(bp+232, pPCache, szPCache, nPCache))
		if rc != 0 {
			fatal_error(tls, ts+23707 /* "pcache configura..." */, libc.VaList(bp+256, rc))
		}
	}
	if nLook >= 0 {
		sqlite3.Xsqlite3_config(tls, 13, libc.VaList(bp+264, 0, 0))
	}
	sqlite3.Xsqlite3_initialize(tls)

	// Open the database and the input file
	if sqlite3.Xsqlite3_open(tls, func() uintptr {
		if memDb != 0 {
			return ts + 23740 /* ":memory:" */
		}
		return zDbName
	}(), (uintptr(unsafe.Pointer(&g)) /* &.db */)) != 0 {
		fatal_error(tls, ts+23749 /* "Cannot open data..." */, libc.VaList(bp+280, zDbName))
	}
	if (nLook > 0) && (szLook > 0) {
		pLook = libc.Xmalloc(tls, (uint64(nLook * szLook)))
		rc = sqlite3.Xsqlite3_db_config(tls, g.db, 1001, libc.VaList(bp+288, pLook, szLook, nLook))
		if rc != 0 {
			fatal_error(tls, ts+23780 /* "lookaside config..." */, libc.VaList(bp+312, rc))
		}
	}

	// Set database connection options
	sqlite3.Xsqlite3_create_function(tls, g.db, ts+23816 /* "random" */, 0, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, int32, uintptr)
	}{randomFunc})), uintptr(0), uintptr(0))
	if doTrace != 0 {
		sqlite3.Xsqlite3_trace(tls, g.db, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr)
		}{traceCallback})), uintptr(0))
	}
	if memDb > 0 {
		speedtest1_exec(tls, ts+23823 /* "PRAGMA temp_stor..." */, 0)
	}
	if mmapSize > 0 {
		speedtest1_exec(tls, ts+23848 /* "PRAGMA mmap_size..." */, libc.VaList(bp+320, mmapSize))
	}
	speedtest1_exec(tls, ts+23868 /* "PRAGMA threads=%..." */, libc.VaList(bp+328, nThread))
	if zKey != 0 {
		speedtest1_exec(tls, ts+23886 /* "PRAGMA key('%s')" */, libc.VaList(bp+336, zKey))
	}
	if zEncoding != 0 {
		speedtest1_exec(tls, ts+23903 /* "PRAGMA encoding=..." */, libc.VaList(bp+344, zEncoding))
	}
	if doAutovac != 0 {
		speedtest1_exec(tls, ts+23922 /* "PRAGMA auto_vacu..." */, 0)
	} else if doIncrvac != 0 {
		speedtest1_exec(tls, ts+23946 /* "PRAGMA auto_vacu..." */, 0)
	}
	if pageSize != 0 {
		speedtest1_exec(tls, ts+23977 /* "PRAGMA page_size..." */, libc.VaList(bp+352, pageSize))
	}
	if cacheSize != 0 {
		speedtest1_exec(tls, ts+23997 /* "PRAGMA cache_siz..." */, libc.VaList(bp+360, cacheSize))
	}
	if noSync != 0 {
		speedtest1_exec(tls, ts+24018 /* "PRAGMA synchrono..." */, 0)
	}
	if doExclusive != 0 {
		speedtest1_exec(tls, ts+24041 /* "PRAGMA locking_m..." */, 0)
	}
	if zJMode != 0 {
		speedtest1_exec(tls, ts+24071 /* "PRAGMA journal_m..." */, libc.VaList(bp+368, zJMode))
	}

	if g.bExplain != 0 {
		libc.Xprintf(tls, ts+24094 /* ".explain\n.echo o..." */, 0)
	}
	for ok1 := true; ok1; ok1 = *(*int8)(unsafe.Pointer(zTSet + uintptr(0))) != 0 {
		var zThisTest uintptr = zTSet
		var zComma uintptr = libc.Xstrchr(tls, zThisTest, ',')
		if zComma != 0 {
			*(*int8)(unsafe.Pointer(zComma)) = int8(0)
			zTSet = (zComma + uintptr(1))
		} else {
			zTSet = ts + 2152 /* "" */
		}
		if (g.iTotal > int64(0)) || (zComma != uintptr(0)) {
			libc.Xprintf(tls, ts+24113 /* "       Begin tes..." */, libc.VaList(bp+376, zThisTest))
		}
		if libc.Xstrcmp(tls, zThisTest, ts+23008 /* "main" */) == 0 {
			testset_main(tls)
		} else if libc.Xstrcmp(tls, zThisTest, ts+24140 /* "debug1" */) == 0 {
			testset_debug1(tls)
		} else if libc.Xstrcmp(tls, zThisTest, ts+24147 /* "orm" */) == 0 {
			testset_orm(tls)
		} else if libc.Xstrcmp(tls, zThisTest, ts+24151 /* "cte" */) == 0 {
			testset_cte(tls)
		} else if libc.Xstrcmp(tls, zThisTest, ts+24155 /* "fp" */) == 0 {
			testset_fp(tls)
		} else if libc.Xstrcmp(tls, zThisTest, ts+24158 /* "trigger" */) == 0 {
			testset_trigger(tls)
		} else if libc.Xstrcmp(tls, zThisTest, ts+24166 /* "rtree" */) == 0 {
			testset_rtree(tls, 6, 147)
		} else {
			fatal_error(tls,
				ts+24172, /* "unknown testset:..." */
				libc.VaList(bp+384, zThisTest))
		}
		if *(*int8)(unsafe.Pointer(zTSet + uintptr(0))) != 0 {
			var zSql uintptr
			var zObj uintptr
			speedtest1_begin_test(tls, 999, ts+24241 /* "Reset the databa..." */, 0)
			for 1 != 0 {
				zObj = speedtest1_once(tls,

					ts+24260 /* "SELECT name FROM..." */, 0)
				if zObj == uintptr(0) {
					break
				}
				zSql = sqlite3.Xsqlite3_mprintf(tls, ts+24330 /* "DROP TABLE main...." */, libc.VaList(bp+392, zObj))
				speedtest1_exec(tls, zSql, 0)
				sqlite3.Xsqlite3_free(tls, zSql)
				sqlite3.Xsqlite3_free(tls, zObj)
			}
			for 1 != 0 {
				zObj = speedtest1_once(tls,

					ts+24351 /* "SELECT name FROM..." */, 0)
				if zObj == uintptr(0) {
					break
				}
				zSql = sqlite3.Xsqlite3_mprintf(tls, ts+24330 /* "DROP TABLE main...." */, libc.VaList(bp+400, zObj))
				speedtest1_exec(tls, zSql, 0)
				sqlite3.Xsqlite3_free(tls, zSql)
				sqlite3.Xsqlite3_free(tls, zObj)
			}
			speedtest1_end_test(tls)
		}
	}
	speedtest1_final(tls)

	if showStats != 0 {
		sqlite3.Xsqlite3_exec(tls, g.db, ts+24421 /* "PRAGMA compile_o..." */, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
		}{xCompileOptions})), uintptr(0), uintptr(0))
	}

	// Database connection statistics printed after both prepared statements
	// have been finalized
	if showStats != 0 {
		sqlite3.Xsqlite3_db_status(tls, g.db, 0, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
		libc.Xprintf(tls, ts+24444 /* "-- Lookaside Slo..." */, libc.VaList(bp+408, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
		sqlite3.Xsqlite3_db_status(tls, g.db, 4, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
		libc.Xprintf(tls, ts+24489 /* "-- Successful lo..." */, libc.VaList(bp+424, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
		sqlite3.Xsqlite3_db_status(tls, g.db, 5, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
		libc.Xprintf(tls, ts+24525 /* "-- Lookaside siz..." */, libc.VaList(bp+432, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
		sqlite3.Xsqlite3_db_status(tls, g.db, 6, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
		libc.Xprintf(tls, ts+24561 /* "-- Lookaside OOM..." */, libc.VaList(bp+440, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
		sqlite3.Xsqlite3_db_status(tls, g.db, 1, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
		libc.Xprintf(tls, ts+24597 /* "-- Pager Heap Us..." */, libc.VaList(bp+448, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */))))
		sqlite3.Xsqlite3_db_status(tls, g.db, 7, bp+560 /* &iCur */, bp+564 /* &iHi */, 1)
		libc.Xprintf(tls, ts+24639 /* "-- Page cache hi..." */, libc.VaList(bp+456, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */))))
		sqlite3.Xsqlite3_db_status(tls, g.db, 8, bp+560 /* &iCur */, bp+564 /* &iHi */, 1)
		libc.Xprintf(tls, ts+24675 /* "-- Page cache mi..." */, libc.VaList(bp+464, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */))))
		sqlite3.Xsqlite3_db_status(tls, g.db, 9, bp+560 /* &iCur */, bp+564 /* &iHi */, 1)
		libc.Xprintf(tls, ts+24711 /* "-- Page cache wr..." */, libc.VaList(bp+472, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */))))
		sqlite3.Xsqlite3_db_status(tls, g.db, 2, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
		libc.Xprintf(tls, ts+24747 /* "-- Schema Heap U..." */, libc.VaList(bp+480, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */))))
		sqlite3.Xsqlite3_db_status(tls, g.db, 3, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
		libc.Xprintf(tls, ts+24789 /* "-- Statement Hea..." */, libc.VaList(bp+488, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */))))
	}

	sqlite3.Xsqlite3_close(tls, g.db)

	// Global memory usage statistics printed after the database connection
	// has closed.  Memory usage should be zero at this point.
	if showStats != 0 {
		sqlite3.Xsqlite3_status(tls, 0, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
		libc.Xprintf(tls, ts+24831 /* "-- Memory Used (..." */, libc.VaList(bp+496, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
		sqlite3.Xsqlite3_status(tls, 9, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
		libc.Xprintf(tls, ts+24876 /* "-- Outstanding A..." */, libc.VaList(bp+512, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
		sqlite3.Xsqlite3_status(tls, 2, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
		libc.Xprintf(tls, ts+24921 /* "-- Pcache Overfl..." */, libc.VaList(bp+528, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
		sqlite3.Xsqlite3_status(tls, 5, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
		libc.Xprintf(tls, ts+24966 /* "-- Largest Alloc..." */, libc.VaList(bp+544, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
		sqlite3.Xsqlite3_status(tls, 7, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
		libc.Xprintf(tls, ts+25008 /* "-- Largest Pcach..." */, libc.VaList(bp+552, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
	}

	if showStats != 0 {
		displayLinuxIoStats(tls, libc.Xstdout)
	}

	// Release memory
	libc.Xfree(tls, pLook)
	libc.Xfree(tls, pPCache)
	libc.Xfree(tls, pHeap)
	return 0
}

var ts1 = "Usage: %s [--options] DATABASE\nOptions:\n  --autovacuum        Enable AUTOVACUUM mode\n  --cachesize N       Set the cache size to N\n  --checkpoint        Run PRAGMA wal_checkpoint after each test case\n  --exclusive         Enable locking_mode=EXCLUSIVE\n  --explain           Like --sqlonly but with added EXPLAIN keywords\n  --heap SZ MIN       Memory allocator uses SZ bytes & min allocation MIN\n  --incrvacuum        Enable incremenatal vacuum mode\n  --journal M         Set the journal_mode to M\n  --key KEY           Set the encryption key to KEY\n  --lookaside N SZ    Configure lookaside for N slots of SZ bytes each\n  --memdb             Use an in-memory database\n  --mmap SZ           MMAP the first SZ bytes of the database file\n  --multithread       Set multithreaded mode\n  --nomemstat         Disable memory statistics\n  --nosync            Set PRAGMA synchronous=OFF\n  --notnull           Add NOT NULL constraints to table columns\n  --output FILE       Store SQL output in FILE\n  --pagesize N        Set the page size to N\n  --pcache N SZ       Configure N pages of pagecache each of size SZ bytes\n  --primarykey        Use PRIMARY KEY instead of UNIQUE where appropriate\n  --repeat N          Repeat each SELECT N times (default: 1)\n  --reprepare         Reprepare each statement upon every invocation\n  --serialized        Set serialized threading mode\n  --singlethread      Set single-threaded mode - disables all mutexing\n  --sqlonly           No-op.  Only show the SQL that would have been run.\n  --shrink-memory     Invoke sqlite3_db_release_memory() frequently.\n  --size N            Relative test size.  Default=100\n  --stats             Show statistics at the end\n  --temp N            N from 0 to 9.  0: no temp table. 9: all temp tables\n  --testset T         Run test-set T (main, cte, rtree, orm, fp, debug)\n  --trace             Turn on SQL tracing\n  --threads N         Use up to N threads for sorting\n  --utf16be           Set text encoding to UTF-16BE\n  --utf16le           Set text encoding to UTF-16LE\n  --verify            Run additional verification steps.\n  --without-rowid     Use WITHOUT ROWID where appropriate\n\x00 TEMP\x00\x00parameter too large - max 2147483648\x00KiB\x00MiB\x00GiB\x00KB\x00MB\x00GB\x00K\x00M\x00G\x00 billion\x00 million\x00 thousand\x00%s hundred\x00%s\x00zero\x00one\x00two\x00three\x00four\x00five\x00six\x00seven\x00eight\x00nine\x00ten\x00eleven\x00twelve\x00thirteen\x00fourteen\x00fifteen\x00sixteen\x00seventeen\x00eighteen\x00nineteen\x00twenty\x00thirty\x00forty\x00fifty\x00sixty\x00seventy\x00eighty\x00ninety\x00.......................................................................\x00/* %4d - %s%.*s */\n\x00%4d - %s%.*s \x00PRAGMA wal_checkpoint;\x00%4d.%03ds\n\x00       TOTAL%.*s %4d.%03ds\n\x00Verification Hash: %llu \x00\n\x00%02x\x00EXPLAIN \x00%.*s;\n\x00CREATE *\x00DROP *\x00ALTER *\x00SQL error: %s\n%s\n\x00exec error: %s\n\x00SQL error: %s\n\x00nil\x00-IFTBN\x000123456789abcdef\x00%d INSERTs into table with no index\x00BEGIN\x00CREATE%s TABLE t1(a INTEGER %s, b INTEGER %s, c TEXT %s);\x00INSERT INTO t1 VALUES(?1,?2,?3); --  %d times\x00COMMIT\x00%d ordered INSERTS with one index/PK\x00CREATE%s TABLE t2(a INTEGER %s %s, b INTEGER %s, c TEXT %s) %s\x00INSERT INTO t2 VALUES(?1,?2,?3); -- %d times\x00%d unordered INSERTS with one index/PK\x00CREATE%s TABLE t3(a INTEGER %s %s, b INTEGER %s, c TEXT %s) %s\x00INSERT INTO t3 VALUES(?1,?2,?3); -- %d times\x00%d SELECTS, numeric BETWEEN, unindexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(c) FROM t1\n WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, LIKE, unindexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(c) FROM t1\n WHERE c LIKE ?1; -- %d times\x00%d SELECTS w/ORDER BY, unindexed\x00SELECT a, b, c FROM t1 WHERE c LIKE ?1\n ORDER BY a; -- %d times\x00%d SELECTS w/ORDER BY and LIMIT, unindexed\x00SELECT a, b, c FROM t1 WHERE c LIKE ?1\n ORDER BY a LIMIT 10; -- %d times\x00CREATE INDEX five times\x00BEGIN;\x00CREATE UNIQUE INDEX t1b ON t1(b);\x00CREATE INDEX t1c ON t1(c);\x00CREATE UNIQUE INDEX t2b ON t2(b);\x00CREATE INDEX t2c ON t2(c DESC);\x00CREATE INDEX t3bc ON t3(b,c);\x00COMMIT;\x00%d SELECTS, numeric BETWEEN, indexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM t1\n WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, numeric BETWEEN, PK\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM t2\n WHERE a BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, text BETWEEN, indexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM t1\n WHERE c BETWEEN ?1 AND (?1||'~'); -- %d times\x00%d INSERTS with three indexes\x00CREATE%s TABLE t4(\n  a INTEGER %s %s,\n  b INTEGER %s,\n  c TEXT %s\n) %s\x00CREATE INDEX t4b ON t4(b)\x00CREATE INDEX t4c ON t4(c)\x00INSERT INTO t4 SELECT * FROM t1\x00DELETE and REFILL one table\x00DELETE FROM t2;\x00INSERT INTO t2 SELECT * FROM t1;\x00VACUUM\x00ALTER TABLE ADD COLUMN, and query\x00ALTER TABLE t2 ADD COLUMN d DEFAULT 123\x00SELECT sum(d) FROM t2\x00%d UPDATES, numeric BETWEEN, indexed\x00UPDATE t2 SET d=b*2 WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d UPDATES of individual rows\x00UPDATE t2 SET d=b*3 WHERE a=?1; -- %d times\x00One big UPDATE of the whole %d-row table\x00UPDATE t2 SET d=b*4\x00Query added column after filling\x00%d DELETEs, numeric BETWEEN, indexed\x00DELETE FROM t2 WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d DELETEs of individual rows\x00DELETE FROM t3 WHERE a=?1; -- %d times\x00Refill two %d-row tables using REPLACE\x00REPLACE INTO t2(a,b,c) SELECT a,b,c FROM t1\x00REPLACE INTO t3(a,b,c) SELECT a,b,c FROM t1\x00Refill a %d-row table using (b&1)==(a&1)\x00INSERT INTO t2(a,b,c)\n SELECT a,b,c FROM t1  WHERE (b&1)==(a&1);\x00INSERT INTO t2(a,b,c)\n SELECT a,b,c FROM t1  WHERE (b&1)<>(a&1);\x00%d four-ways joins\x00SELECT t1.c FROM t1, t2, t3, t4\n WHERE t4.a BETWEEN ?1 AND ?2\n   AND t3.a=t4.b\n   AND t2.a=t3.b\n   AND t1.c=t2.c\x00subquery in result set\x00SELECT sum(a), max(c),\n       avg((SELECT a FROM t2 WHERE 5+t2.b=t1.b) AND rowid<?1), max(c)\n FROM t1 WHERE rowid<?1;\x00%d REPLACE ops on an IPK\x00CREATE%s TABLE t5(a INTEGER PRIMARY KEY, b %s);\x00REPLACE INTO t5 VALUES(?1,?2); --  %d times\x00%d SELECTS on an IPK\x00SELECT b FROM t5 WHERE a=?1; --  %d times\x00%d REPLACE on TEXT PK\x00CREATE%s TABLE t6(a TEXT PRIMARY KEY, b %s)%s;\x00WITHOUT ROWID\x00REPLACE INTO t6 VALUES(?1,?2); --  %d times\x00%d SELECTS on a TEXT PK\x00SELECT b FROM t6 WHERE a=?1; --  %d times\x00%d SELECT DISTINCT\x00SELECT DISTINCT b FROM t5;\x00SELECT DISTINCT b FROM t6;\x00PRAGMA integrity_check\x00ANALYZE\x00Sudoku with recursive 'digits'\x00WITH RECURSIVE\n  input(sud) AS (VALUES(?1)),\n  digits(z,lp) AS (\n    VALUES('1', 1)\n    UNION ALL\n    SELECT CAST(lp+1 AS TEXT), lp+1 FROM digits WHERE lp<9\n  ),\n  x(s, ind) AS (\n    SELECT sud, instr(sud, '.') FROM input\n    UNION ALL\n    SELECT\n      substr(s, 1, ind-1) || z || substr(s, ind+1),\n      instr( substr(s, 1, ind-1) || z || substr(s, ind+1), '.' )\n     FROM x, digits AS z\n    WHERE ind>0\n      AND NOT EXISTS (\n            SELECT 1\n              FROM digits AS lp\n             WHERE z.z = substr(s, ((ind-1)/9)*9 + lp, 1)\n                OR z.z = substr(s, ((ind-1)%%9) + (lp-1)*9 + 1, 1)\n                OR z.z = substr(s, (((ind-1)/3) %% 3) * 3\n                        + ((ind-1)/27) * 27 + lp\n                        + ((lp-1) / 3) * 6, 1)\n         )\n  )\nSELECT s FROM x WHERE ind=0;\x00Sudoku with VALUES 'digits'\x00WITH RECURSIVE\n  input(sud) AS (VALUES(?1)),\n  digits(z,lp) AS (VALUES('1',1),('2',2),('3',3),('4',4),('5',5),\n                         ('6',6),('7',7),('8',8),('9',9)),\n  x(s, ind) AS (\n    SELECT sud, instr(sud, '.') FROM input\n    UNION ALL\n    SELECT\n      substr(s, 1, ind-1) || z || substr(s, ind+1),\n      instr( substr(s, 1, ind-1) || z || substr(s, ind+1), '.' )\n     FROM x, digits AS z\n    WHERE ind>0\n      AND NOT EXISTS (\n            SELECT 1\n              FROM digits AS lp\n             WHERE z.z = substr(s, ((ind-1)/9)*9 + lp, 1)\n                OR z.z = substr(s, ((ind-1)%%9) + (lp-1)*9 + 1, 1)\n                OR z.z = substr(s, (((ind-1)/3) %% 3) * 3\n                        + ((ind-1)/27) * 27 + lp\n                        + ((lp-1) / 3) * 6, 1)\n         )\n  )\nSELECT s FROM x WHERE ind=0;\x00Mandelbrot Set with spacing=%f\x00WITH RECURSIVE \n  xaxis(x) AS (VALUES(-2.0) UNION ALL SELECT x+?1 FROM xaxis WHERE x<1.2),\n  yaxis(y) AS (VALUES(-1.0) UNION ALL SELECT y+?2 FROM yaxis WHERE y<1.0),\n  m(iter, cx, cy, x, y) AS (\n    SELECT 0, x, y, 0.0, 0.0 FROM xaxis, yaxis\n    UNION ALL\n    SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m \n     WHERE (x*x + y*y) < 4.0 AND iter<28\n  ),\n  m2(iter, cx, cy) AS (\n    SELECT max(iter), cx, cy FROM m GROUP BY cx, cy\n  ),\n  a(t) AS (\n    SELECT group_concat( substr(' .+*#', 1+min(iter/7,4), 1), '') \n    FROM m2 GROUP BY cy\n  )\nSELECT group_concat(rtrim(t),x'0a') FROM a;\x00EXCEPT operator on %d-element tables\x00WITH RECURSIVE \n  t1(x) AS (VALUES(2) UNION ALL SELECT x+2 FROM t1 WHERE x<%d),\n  t2(y) AS (VALUES(3) UNION ALL SELECT y+3 FROM t2 WHERE y<%d)\nSELECT count(x), avg(x) FROM (\n  SELECT x FROM t1 EXCEPT SELECT y FROM t2 ORDER BY 1\n);\x00534...9..67.195....98....6.8...6...34..8.3..1....2...6.6....28....419..5...28..79\x0053....9..6..195....98....6.8...6...34..8.3..1....2...6.6....28....419..5....8..79\x0053.......6..195....98....6.8...6...34..8.3..1....2...6.6....28....419..5....8..79\x00%d.%de%d\x00Fill a table with %d FP values\x00CREATE%s TABLE t1(a REAL %s, b REAL %s);\x00INSERT INTO t1 VALUES(?1,?2); -- %d times\x00%d range queries\x00SELECT sum(b) FROM t1 WHERE a BETWEEN ?1 AND ?2\x00CREATE INDEX three times\x00CREATE INDEX t1a ON t1(a);\x00CREATE INDEX t1b ON t1(b);\x00CREATE INDEX t1ab ON t1(a,b);\x00%d indexed range queries\x00%d calls to round()\x00SELECT sum(round(a,2)+round(b,4)) FROM t1;\x00%d printf() calls\x00WITH c(fmt) AS (VALUES('%%g'),('%%e'),('%%!g'),('%%.20f'))SELECT sum(printf(fmt,a)) FROM t1, c\x00%d INSERTs into an r-tree\x00CREATE VIRTUAL TABLE rt1 USING rtree(id,x0,x1,y0,y1,z0,z1)\x00INSERT INTO rt1(id,x0,x1,y0,y1,z0,z1)VALUES(?1,?2,?3,?4,?5,?6,?7)\x00Copy from rtree to a regular table\x00CREATE TABLE t1(id INTEGER PRIMARY KEY,x0,x1,y0,y1,z0,z1)\x00INSERT INTO t1 SELECT * FROM rt1\x00%d one-dimensional intersect slice queries\x00SELECT count(*) FROM rt1 WHERE x0>=?1 AND x1<=?2\x00Verify result from 1-D intersect slice queries\x00SELECT count(*) FROM t1 WHERE x0>=?1 AND x1<=?2\x00Count disagree step %d: %d..%d.  %d vs %d\x00%d one-dimensional overlap slice queries\x00SELECT count(*) FROM rt1 WHERE y1>=?1 AND y0<=?2\x00Verify result from 1-D overlap slice queries\x00SELECT count(*) FROM t1 WHERE y1>=?1 AND y0<=?2\x00%d custom geometry callback queries\x00xslice\x00SELECT count(*) FROM rt1 WHERE id MATCH xslice(?1,?2)\x00%d three-dimensional intersect box queries\x00SELECT count(*) FROM rt1 WHERE x1>=?1 AND x0<=?2 AND y1>=?1 AND y0<=?2 AND z1>=?1 AND z0<=?2\x00%d rowid queries\x00SELECT * FROM rt1 WHERE id=?1\x00%d UPDATEs using rowid\x00UPDATE rt1 SET x0=x0+100, x1=x1+100 WHERE id=?1\x00%d UPDATEs using one-dimensional overlap\x00UPDATE rt1 SET x0=x0-100, x1=x1-100 WHERE y1>=?1 AND y0<=?1+5\x00%d DELETEs using rowid\x00DELETE FROM rt1 WHERE id=?1\x00%d DELETEs using one-dimensional overlap\x00DELETE FROM rt1 WHERE y1>=?1 AND y0<=?1+5\x00Restore deleted entries using INSERT OR IGNORE\x00INSERT OR IGNORE INTO rt1 SELECT * FROM t1\x00Fill %d rows\x00BEGIN;CREATE TABLE ZLOOKSLIKECOREDATA (  ZPK INTEGER PRIMARY KEY,  ZTERMFITTINGHOUSINGCOMMAND INTEGER,  ZBRIEFGOBYDODGERHEIGHT BLOB,  ZCAPABLETRIPDOORALMOND BLOB,  ZDEPOSITPAIRCOLLEGECOMET INTEGER,  ZFRAMEENTERSIMPLEMOUTH INTEGER,  ZHOPEFULGATEHOLECHALK INTEGER,  ZSLEEPYUSERGRANDBOWL TIMESTAMP,  ZDEWPEACHCAREERCELERY INTEGER,  ZHANGERLITHIUMDINNERMEET VARCHAR,  ZCLUBRELEASELIZARDADVICE VARCHAR,  ZCHARGECLICKHUMANEHIRE INTEGER,  ZFINGERDUEPIZZAOPTION TIMESTAMP,  ZFLYINGDOCTORTABLEMELODY BLOB,  ZLONGFINLEAVEIMAGEOIL TIMESTAMP,  ZFAMILYVISUALOWNERMATTER BLOB,  ZGOLDYOUNGINITIALNOSE FLOAT,  ZCAUSESALAMITERMCYAN BLOB,  ZSPREADMOTORBISCUITBACON FLOAT,  ZGIFTICEFISHGLUEHAIR INTEGER,  ZNOTICEPEARPOLICYJUICE TIMESTAMP,  ZBANKBUFFALORECOVERORBIT TIMESTAMP,  ZLONGDIETESSAYNATURE FLOAT,  ZACTIONRANGEELEGANTNEUTRON BLOB,  ZCADETBRIGHTPLANETBANK TIMESTAMP,  ZAIRFORGIVEHEADFROG BLOB,  ZSHARKJUSTFRUITMOVIE VARCHAR,  ZFARMERMORNINGMIRRORCONCERN BLOB,  ZWOODPOETRYCOBBLERBENCH VARCHAR,  ZHAFNIUMSCRIPTSALADMOTOR INTEGER,  ZPROBLEMCLUBPOPOVERJELLY FLOAT,  ZEIGHTLEADERWORKERMOST TIMESTAMP,  ZGLASSRESERVEBARIUMMEAL BLOB,  ZCLAMBITARUGULAFAJITA BLOB,  ZDECADEJOYOUSWAVEHABIT FLOAT,  ZCOMPANYSUMMERFIBERELF INTEGER,  ZTREATTESTQUILLCHARGE TIMESTAMP,  ZBROWBALANCEKEYCHOWDER FLOAT,  ZPEACHCOPPERDINNERLAKE FLOAT,  ZDRYWALLBEYONDBROWNBOWL VARCHAR,  ZBELLYCRASHITEMLACK BLOB,  ZTENNISCYCLEBILLOFFICER INTEGER,  ZMALLEQUIPTHANKSGLUE FLOAT,  ZMISSREPLYHUMANLIVING INTEGER,  ZKIWIVISUALPRIDEAPPLE VARCHAR,  ZWISHHITSKINMOTOR BLOB,  ZCALMRACCOONPROGRAMDEBIT VARCHAR,  ZSHINYASSISTLIVINGCRAB VARCHAR,  ZRESOLVEWRISTWRAPAPPLE VARCHAR,  ZAPPEALSIMPLESECONDHOUSING BLOB,  ZCORNERANCHORTAPEDIVER TIMESTAMP,  ZMEMORYREQUESTSOURCEBIG VARCHAR,  ZTRYFACTKEEPMILK TIMESTAMP,  ZDIVERPAINTLEATHEREASY INTEGER,  ZSORTMISTYQUOTECABBAGE BLOB,  ZTUNEGASBUFFALOCAPITAL BLOB,  ZFILLSTOPLAWJOYFUL FLOAT,  ZSTEELCAREFULPLATENUMBER FLOAT,  ZGIVEVIVIDDIVINEMEANING INTEGER,  ZTREATPACKFUTURECONVERT VARCHAR,  ZCALMLYGEMFINISHEFFECT INTEGER,  ZCABBAGESOCKEASEMINUTE BLOB,  ZPLANETFAMILYPUREMEMORY TIMESTAMP,  ZMERRYCRACKTRAINLEADER BLOB,  ZMINORWAYPAPERCLASSY TIMESTAMP,  ZEAGLELINEMINEMAIL VARCHAR,  ZRESORTYARDGREENLET TIMESTAMP,  ZYARDOREGANOVIVIDJEWEL TIMESTAMP,  ZPURECAKEVIVIDNEATLY FLOAT,  ZASKCONTACTMONITORFUN TIMESTAMP,  ZMOVEWHOGAMMAINCH VARCHAR,  ZLETTUCEBIRDMEETDEBATE TIMESTAMP,  ZGENENATURALHEARINGKITE VARCHAR,  ZMUFFINDRYERDRAWFORTUNE FLOAT,  ZGRAYSURVEYWIRELOVE FLOAT,  ZPLIERSPRINTASKOREGANO INTEGER,  ZTRAVELDRIVERCONTESTLILY INTEGER,  ZHUMORSPICESANDKIDNEY TIMESTAMP,  ZARSENICSAMPLEWAITMUON INTEGER,  ZLACEADDRESSGROUNDCAREFUL FLOAT,  ZBAMBOOMESSWASABIEVENING BLOB,  ZONERELEASEAVERAGENURSE INTEGER,  ZRADIANTWHENTRYCARD TIMESTAMP,  ZREWARDINSIDEMANGOINTENSE FLOAT,  ZNEATSTEWPARTIRON TIMESTAMP,  ZOUTSIDEPEAHENCOUNTICE TIMESTAMP,  ZCREAMEVENINGLIPBRANCH FLOAT,  ZWHALEMATHAVOCADOCOPPER FLOAT,  ZLIFEUSELEAFYBELL FLOAT,  ZWEALTHLINENGLEEFULDAY VARCHAR,  ZFACEINVITETALKGOLD BLOB,  ZWESTAMOUNTAFFECTHEARING INTEGER,  ZDELAYOUTCOMEHORNAGENCY INTEGER,  ZBIGTHINKCONVERTECONOMY BLOB,  ZBASEGOUDAREGULARFORGIVE TIMESTAMP,  ZPATTERNCLORINEGRANDCOLBY TIMESTAMP,  ZCYANBASEFEEDADROIT INTEGER,  ZCARRYFLOORMINNOWDRAGON TIMESTAMP,  ZIMAGEPENCILOTHERBOTTOM FLOAT,  ZXENONFLIGHTPALEAPPLE TIMESTAMP,  ZHERRINGJOKEFEATUREHOPEFUL FLOAT,  ZCAPYEARLYRIVETBRUSH FLOAT,  ZAGEREEDFROGBASKET VARCHAR,  ZUSUALBODYHALIBUTDIAMOND VARCHAR,  ZFOOTTAPWORDENTRY VARCHAR,  ZDISHKEEPBLESTMONITOR FLOAT,  ZBROADABLESOLIDCASUAL INTEGER,  ZSQUAREGLEEFULCHILDLIGHT INTEGER,  ZHOLIDAYHEADPONYDETAIL INTEGER,  ZGENERALRESORTSKYOPEN TIMESTAMP,  ZGLADSPRAYKIDNEYGUPPY VARCHAR,  ZSWIMHEAVYMENTIONKIND BLOB,  ZMESSYSULFURDREAMFESTIVE BLOB,  ZSKYSKYCLASSICBRIEF VARCHAR,  ZDILLASKHOKILEMON FLOAT,  ZJUNIORSHOWPRESSNOVA FLOAT,  ZSIZETOEAWARDFRESH TIMESTAMP,  ZKEYFAILAPRICOTMETAL VARCHAR,  ZHANDYREPAIRPROTONAIRPORT VARCHAR,  ZPOSTPROTEINHANDLEACTOR BLOB);\x00INSERT INTO ZLOOKSLIKECOREDATA(ZPK,ZAIRFORGIVEHEADFROG,ZGIFTICEFISHGLUEHAIR,ZDELAYOUTCOMEHORNAGENCY,ZSLEEPYUSERGRANDBOWL,ZGLASSRESERVEBARIUMMEAL,ZBRIEFGOBYDODGERHEIGHT,ZBAMBOOMESSWASABIEVENING,ZFARMERMORNINGMIRRORCONCERN,ZTREATPACKFUTURECONVERT,ZCAUSESALAMITERMCYAN,ZCALMRACCOONPROGRAMDEBIT,ZHOLIDAYHEADPONYDETAIL,ZWOODPOETRYCOBBLERBENCH,ZHAFNIUMSCRIPTSALADMOTOR,ZUSUALBODYHALIBUTDIAMOND,ZOUTSIDEPEAHENCOUNTICE,ZDIVERPAINTLEATHEREASY,ZWESTAMOUNTAFFECTHEARING,ZSIZETOEAWARDFRESH,ZDEWPEACHCAREERCELERY,ZSTEELCAREFULPLATENUMBER,ZCYANBASEFEEDADROIT,ZCALMLYGEMFINISHEFFECT,ZHANDYREPAIRPROTONAIRPORT,ZGENENATURALHEARINGKITE,ZBROADABLESOLIDCASUAL,ZPOSTPROTEINHANDLEACTOR,ZLACEADDRESSGROUNDCAREFUL,ZIMAGEPENCILOTHERBOTTOM,ZPROBLEMCLUBPOPOVERJELLY,ZPATTERNCLORINEGRANDCOLBY,ZNEATSTEWPARTIRON,ZAPPEALSIMPLESECONDHOUSING,ZMOVEWHOGAMMAINCH,ZTENNISCYCLEBILLOFFICER,ZSHARKJUSTFRUITMOVIE,ZKEYFAILAPRICOTMETAL,ZCOMPANYSUMMERFIBERELF,ZTERMFITTINGHOUSINGCOMMAND,ZRESORTYARDGREENLET,ZCABBAGESOCKEASEMINUTE,ZSQUAREGLEEFULCHILDLIGHT,ZONERELEASEAVERAGENURSE,ZBIGTHINKCONVERTECONOMY,ZPLIERSPRINTASKOREGANO,ZDECADEJOYOUSWAVEHABIT,ZDRYWALLBEYONDBROWNBOWL,ZCLUBRELEASELIZARDADVICE,ZWHALEMATHAVOCADOCOPPER,ZBELLYCRASHITEMLACK,ZLETTUCEBIRDMEETDEBATE,ZCAPABLETRIPDOORALMOND,ZRADIANTWHENTRYCARD,ZCAPYEARLYRIVETBRUSH,ZAGEREEDFROGBASKET,ZSWIMHEAVYMENTIONKIND,ZTRAVELDRIVERCONTESTLILY,ZGLADSPRAYKIDNEYGUPPY,ZBANKBUFFALORECOVERORBIT,ZFINGERDUEPIZZAOPTION,ZCLAMBITARUGULAFAJITA,ZLONGFINLEAVEIMAGEOIL,ZLONGDIETESSAYNATURE,ZJUNIORSHOWPRESSNOVA,ZHOPEFULGATEHOLECHALK,ZDEPOSITPAIRCOLLEGECOMET,ZWEALTHLINENGLEEFULDAY,ZFILLSTOPLAWJOYFUL,ZTUNEGASBUFFALOCAPITAL,ZGRAYSURVEYWIRELOVE,ZCORNERANCHORTAPEDIVER,ZREWARDINSIDEMANGOINTENSE,ZCADETBRIGHTPLANETBANK,ZPLANETFAMILYPUREMEMORY,ZTREATTESTQUILLCHARGE,ZCREAMEVENINGLIPBRANCH,ZSKYSKYCLASSICBRIEF,ZARSENICSAMPLEWAITMUON,ZBROWBALANCEKEYCHOWDER,ZFLYINGDOCTORTABLEMELODY,ZHANGERLITHIUMDINNERMEET,ZNOTICEPEARPOLICYJUICE,ZSHINYASSISTLIVINGCRAB,ZLIFEUSELEAFYBELL,ZFACEINVITETALKGOLD,ZGENERALRESORTSKYOPEN,ZPURECAKEVIVIDNEATLY,ZKIWIVISUALPRIDEAPPLE,ZMESSYSULFURDREAMFESTIVE,ZCHARGECLICKHUMANEHIRE,ZHERRINGJOKEFEATUREHOPEFUL,ZYARDOREGANOVIVIDJEWEL,ZFOOTTAPWORDENTRY,ZWISHHITSKINMOTOR,ZBASEGOUDAREGULARFORGIVE,ZMUFFINDRYERDRAWFORTUNE,ZACTIONRANGEELEGANTNEUTRON,ZTRYFACTKEEPMILK,ZPEACHCOPPERDINNERLAKE,ZFRAMEENTERSIMPLEMOUTH,ZMERRYCRACKTRAINLEADER,ZMEMORYREQUESTSOURCEBIG,ZCARRYFLOORMINNOWDRAGON,ZMINORWAYPAPERCLASSY,ZDILLASKHOKILEMON,ZRESOLVEWRISTWRAPAPPLE,ZASKCONTACTMONITORFUN,ZGIVEVIVIDDIVINEMEANING,ZEIGHTLEADERWORKERMOST,ZMISSREPLYHUMANLIVING,ZXENONFLIGHTPALEAPPLE,ZSORTMISTYQUOTECABBAGE,ZEAGLELINEMINEMAIL,ZFAMILYVISUALOWNERMATTER,ZSPREADMOTORBISCUITBACON,ZDISHKEEPBLESTMONITOR,ZMALLEQUIPTHANKSGLUE,ZGOLDYOUNGINITIALNOSE,ZHUMORSPICESANDKIDNEY)VALUES(?1,?26,?20,?93,?8,?33,?3,?81,?28,?60,?18,?47,?109,?29,?30,?104,?86,?54,?92,?117,?9,?58,?97,?61,?119,?73,?107,?120,?80,?99,?31,?96,?85,?50,?71,?42,?27,?118,?36,?2,?67,?62,?108,?82,?94,?76,?35,?40,?11,?88,?41,?72,?4,?83,?102,?103,?112,?77,?111,?22,?13,?34,?15,?23,?116,?7,?5,?90,?57,?56,?75,?51,?84,?25,?63,?37,?87,?114,?79,?38,?14,?10,?21,?48,?89,?91,?110,?69,?45,?113,?12,?101,?68,?105,?46,?95,?74,?24,?53,?39,?6,?64,?52,?98,?65,?115,?49,?70,?59,?32,?44,?100,?55,?66,?16,?19,?106,?43,?17,?78);\x00Query %d rows by rowid\x00SELECT ZCYANBASEFEEDADROIT,ZJUNIORSHOWPRESSNOVA,ZCAUSESALAMITERMCYAN,ZHOPEFULGATEHOLECHALK,ZHUMORSPICESANDKIDNEY,ZSWIMHEAVYMENTIONKIND,ZMOVEWHOGAMMAINCH,ZAPPEALSIMPLESECONDHOUSING,ZHAFNIUMSCRIPTSALADMOTOR,ZNEATSTEWPARTIRON,ZLONGFINLEAVEIMAGEOIL,ZDEWPEACHCAREERCELERY,ZXENONFLIGHTPALEAPPLE,ZCALMRACCOONPROGRAMDEBIT,ZUSUALBODYHALIBUTDIAMOND,ZTRYFACTKEEPMILK,ZWEALTHLINENGLEEFULDAY,ZLONGDIETESSAYNATURE,ZLIFEUSELEAFYBELL,ZTREATPACKFUTURECONVERT,ZMEMORYREQUESTSOURCEBIG,ZYARDOREGANOVIVIDJEWEL,ZDEPOSITPAIRCOLLEGECOMET,ZSLEEPYUSERGRANDBOWL,ZBRIEFGOBYDODGERHEIGHT,ZCLUBRELEASELIZARDADVICE,ZCAPABLETRIPDOORALMOND,ZDRYWALLBEYONDBROWNBOWL,ZASKCONTACTMONITORFUN,ZKIWIVISUALPRIDEAPPLE,ZNOTICEPEARPOLICYJUICE,ZPEACHCOPPERDINNERLAKE,ZSTEELCAREFULPLATENUMBER,ZGLADSPRAYKIDNEYGUPPY,ZCOMPANYSUMMERFIBERELF,ZTENNISCYCLEBILLOFFICER,ZIMAGEPENCILOTHERBOTTOM,ZWESTAMOUNTAFFECTHEARING,ZDIVERPAINTLEATHEREASY,ZSKYSKYCLASSICBRIEF,ZMESSYSULFURDREAMFESTIVE,ZMERRYCRACKTRAINLEADER,ZBROADABLESOLIDCASUAL,ZGLASSRESERVEBARIUMMEAL,ZTUNEGASBUFFALOCAPITAL,ZBANKBUFFALORECOVERORBIT,ZTREATTESTQUILLCHARGE,ZBAMBOOMESSWASABIEVENING,ZREWARDINSIDEMANGOINTENSE,ZEAGLELINEMINEMAIL,ZCALMLYGEMFINISHEFFECT,ZKEYFAILAPRICOTMETAL,ZFINGERDUEPIZZAOPTION,ZCADETBRIGHTPLANETBANK,ZGOLDYOUNGINITIALNOSE,ZMISSREPLYHUMANLIVING,ZEIGHTLEADERWORKERMOST,ZFRAMEENTERSIMPLEMOUTH,ZBIGTHINKCONVERTECONOMY,ZFACEINVITETALKGOLD,ZPOSTPROTEINHANDLEACTOR,ZHERRINGJOKEFEATUREHOPEFUL,ZCABBAGESOCKEASEMINUTE,ZMUFFINDRYERDRAWFORTUNE,ZPROBLEMCLUBPOPOVERJELLY,ZGIVEVIVIDDIVINEMEANING,ZGENENATURALHEARINGKITE,ZGENERALRESORTSKYOPEN,ZLETTUCEBIRDMEETDEBATE,ZBASEGOUDAREGULARFORGIVE,ZCHARGECLICKHUMANEHIRE,ZPLANETFAMILYPUREMEMORY,ZMINORWAYPAPERCLASSY,ZCAPYEARLYRIVETBRUSH,ZSIZETOEAWARDFRESH,ZARSENICSAMPLEWAITMUON,ZSQUAREGLEEFULCHILDLIGHT,ZSHINYASSISTLIVINGCRAB,ZCORNERANCHORTAPEDIVER,ZDECADEJOYOUSWAVEHABIT,ZTRAVELDRIVERCONTESTLILY,ZFLYINGDOCTORTABLEMELODY,ZSHARKJUSTFRUITMOVIE,ZFAMILYVISUALOWNERMATTER,ZFARMERMORNINGMIRRORCONCERN,ZGIFTICEFISHGLUEHAIR,ZOUTSIDEPEAHENCOUNTICE,ZSPREADMOTORBISCUITBACON,ZWISHHITSKINMOTOR,ZHOLIDAYHEADPONYDETAIL,ZWOODPOETRYCOBBLERBENCH,ZAIRFORGIVEHEADFROG,ZBROWBALANCEKEYCHOWDER,ZDISHKEEPBLESTMONITOR,ZCLAMBITARUGULAFAJITA,ZPLIERSPRINTASKOREGANO,ZRADIANTWHENTRYCARD,ZDELAYOUTCOMEHORNAGENCY,ZPURECAKEVIVIDNEATLY,ZPATTERNCLORINEGRANDCOLBY,ZHANDYREPAIRPROTONAIRPORT,ZAGEREEDFROGBASKET,ZSORTMISTYQUOTECABBAGE,ZFOOTTAPWORDENTRY,ZRESOLVEWRISTWRAPAPPLE,ZDILLASKHOKILEMON,ZFILLSTOPLAWJOYFUL,ZACTIONRANGEELEGANTNEUTRON,ZRESORTYARDGREENLET,ZCREAMEVENINGLIPBRANCH,ZWHALEMATHAVOCADOCOPPER,ZGRAYSURVEYWIRELOVE,ZBELLYCRASHITEMLACK,ZHANGERLITHIUMDINNERMEET,ZCARRYFLOORMINNOWDRAGON,ZMALLEQUIPTHANKSGLUE,ZTERMFITTINGHOUSINGCOMMAND,ZONERELEASEAVERAGENURSE,ZLACEADDRESSGROUNDCAREFUL FROM ZLOOKSLIKECOREDATA WHERE ZPK=?1;\x00IBBIIITIVVITBTBFBFITTFBTBVBVIFTBBFITFFVBIFIVBVVVBTVTIBBFFIVIBTBTVTTFTVTVFFIITIFBITFTTFFFVBIIBTTITFTFFVVVFIIITVBBVFFTVVB\x00BEGIN;CREATE TABLE t1(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TABLE t2(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TABLE t3(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE VIEW v1 AS SELECT rowid, i, t FROM t1;CREATE VIEW v2 AS SELECT rowid, i, t FROM t2;CREATE VIEW v3 AS SELECT rowid, i, t FROM t3;\x00INSERT INTO t%d VALUES(NULL,?1,?2)\x00CREATE INDEX i1 ON t1(t);CREATE INDEX i2 ON t2(t);CREATE INDEX i3 ON t3(t);COMMIT;\x00speed4p-join1\x00SELECT * FROM t1, t2, t3 WHERE t1.oid = t2.oid AND t2.oid = t3.oid\x00speed4p-join2\x00SELECT * FROM t1, t2, t3 WHERE t1.t = t2.t AND t2.t = t3.t\x00speed4p-view1\x00SELECT * FROM v%d WHERE rowid = ?\x00speed4p-table1\x00SELECT * FROM t%d WHERE rowid = ?\x00speed4p-subselect1\x00SELECT (SELECT t FROM t1 WHERE rowid = ?1),(SELECT t FROM t2 WHERE rowid = ?1),(SELECT t FROM t3 WHERE rowid = ?1)\x00speed4p-rowid-update\x00UPDATE t1 SET i=i+1 WHERE rowid=?1\x00CREATE TABLE t5(t TEXT PRIMARY KEY, i INTEGER);\x00speed4p-insert-ignore\x00INSERT OR IGNORE INTO t5 SELECT t, i FROM t1\x00CREATE TABLE log(op TEXT, r INTEGER, i INTEGER, t TEXT);CREATE TABLE t4(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TRIGGER t4_trigger1 AFTER INSERT ON t4 BEGIN  INSERT INTO log VALUES('INSERT INTO t4', new.rowid, new.i, new.t);END;CREATE TRIGGER t4_trigger2 AFTER UPDATE ON t4 BEGIN  INSERT INTO log VALUES('UPDATE OF t4', new.rowid, new.i, new.t);END;CREATE TRIGGER t4_trigger3 AFTER DELETE ON t4 BEGIN  INSERT INTO log VALUES('DELETE OF t4', old.rowid, old.i, old.t);END;BEGIN;\x00speed4p-trigger1\x00INSERT INTO t4 VALUES(NULL, ?1, ?2)\x00speed4p-trigger2\x00UPDATE t4 SET i = ?1, t = ?2 WHERE rowid = ?3\x00speed4p-trigger3\x00DELETE FROM t4 WHERE rowid = ?1\x00DROP TABLE t4;DROP TABLE log;VACUUM;CREATE TABLE t4(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);BEGIN;\x00speed4p-notrigger1\x00speed4p-notrigger2\x00speed4p-notrigger3\x00%5d %5d %5d %s\n\x00/proc/%d/io\x00rb\x00-- %-28s %s\x00rchar: \x00Bytes received by read():\x00wchar: \x00Bytes sent to write():\x00syscr: \x00Read() system calls:\x00syscw: \x00Write() system calls:\x00read_bytes: \x00Bytes rcvd from storage:\x00write_bytes: \x00Bytes sent to storage:\x00cancelled_write_bytes: \x00Cancelled write bytes:\x00-- Compile option: %s\n\x00main\x00-- Speedtest1 for SQLite %s %.48s\n\x00UNIQUE\x00autovacuum\x00cachesize\x00missing argument on %s\n\x00exclusive\x00checkpoint\x00explain\x00heap\x00missing arguments on %s\n\x00incrvacuum\x00journal\x00key\x00lookaside\x00memdb\x00multithread\x00nomemstat\x00mmap\x00nosync\x00notnull\x00NOT NULL\x00output\x00-\x00wb\x00cannot open \"%s\" for writing\n\x00pagesize\x00pcache\x00primarykey\x00PRIMARY KEY\x00repeat\x00reprepare\x00serialized\x00singlethread\x00sqlonly\x00shrink-memory\x00size\x00stats\x00temp\x00argument to --temp should be integer between 0 and 9\x00testset\x00trace\x00threads\x00utf16le\x00utf16be\x00verify\x00without-rowid\x00help\x00?\x00unknown option: %s\nUse \"%s -?\" for help\n\x00surplus argument: %s\nUse \"%s -?\" for help\n\x00cannot allocate %d-byte heap\n\x00heap configuration failed: %d\n\x00cannot allocate %lld-byte pcache\n\x00pcache configuration failed: %d\n\x00:memory:\x00Cannot open database file: %s\n\x00lookaside configuration failed: %d\n\x00random\x00PRAGMA temp_store=memory\x00PRAGMA mmap_size=%d\x00PRAGMA threads=%d\x00PRAGMA key('%s')\x00PRAGMA encoding=%s\x00PRAGMA auto_vacuum=FULL\x00PRAGMA auto_vacuum=INCREMENTAL\x00PRAGMA page_size=%d\x00PRAGMA cache_size=%d\x00PRAGMA synchronous=OFF\x00PRAGMA locking_mode=EXCLUSIVE\x00PRAGMA journal_mode=%s\x00.explain\n.echo on\n\x00       Begin testset \"%s\"\n\x00debug1\x00orm\x00cte\x00fp\x00trigger\x00rtree\x00unknown testset: \"%s\"\nChoices: cte debug1 fp main orm rtree trigger\n\x00Reset the database\x00SELECT name FROM main.sqlite_master WHERE sql LIKE 'CREATE %%TABLE%%'\x00DROP TABLE main.\"%w\"\x00SELECT name FROM temp.sqlite_master WHERE sql LIKE 'CREATE %%TABLE%%'\x00PRAGMA compile_options\x00-- Lookaside Slots Used:        %d (max %d)\n\x00-- Successful lookasides:       %d\n\x00-- Lookaside size faults:       %d\n\x00-- Lookaside OOM faults:        %d\n\x00-- Pager Heap Usage:            %d bytes\n\x00-- Page cache hits:             %d\n\x00-- Page cache misses:           %d\n\x00-- Page cache writes:           %d\n\x00-- Schema Heap Usage:           %d bytes\n\x00-- Statement Heap Usage:        %d bytes\n\x00-- Memory Used (bytes):         %d (max %d)\n\x00-- Outstanding Allocations:     %d (max %d)\n\x00-- Pcache Overflow Bytes:       %d (max %d)\n\x00-- Largest Allocation:          %d bytes\n\x00-- Largest Pcache Allocation:   %d bytes\n\x00"
var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data