redrust 0.1.1

redrust is a port of the popular Redis database system written in Rust programming language. This port aims to provide all the features of Redis while taking advantage of the Rust language's safety, speed, and modern language features.
Documentation
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
extern crate c2rust_bitfields;
extern crate libc;
extern crate core;

extern "C" {
    pub type RedisModuleCommand;
    pub type clusterSlotToKeyMapping;
    pub type clusterState;
    fn sdsdup(s: sds) -> sds;
    fn sdsfree(s: sds);
    fn sdsfromlonglong(value: libc::c_longlong) -> sds;
    fn qsort(
        __base: *mut libc::c_void,
        __nmemb: size_t,
        __size: size_t,
        __compar: __compar_fn_t,
    );
    fn memcpy(
        _: *mut libc::c_void,
        _: *const libc::c_void,
        _: libc::c_ulong,
    ) -> *mut libc::c_void;
    fn dictGetIterator(d: *mut dict) -> *mut dictIterator;
    fn strcasecmp(__s1: *const libc::c_char, __s2: *const libc::c_char) -> libc::c_int;
    fn dictResize(d: *mut dict) -> libc::c_int;
    fn dictCreate(type_0: *mut dictType) -> *mut dict;
    fn dictExpand(d: *mut dict, size: libc::c_ulong) -> libc::c_int;
    fn dictAdd(
        d: *mut dict,
        key: *mut libc::c_void,
        val: *mut libc::c_void,
    ) -> libc::c_int;
    fn dictAddRaw(
        d: *mut dict,
        key: *mut libc::c_void,
        existing: *mut *mut dictEntry,
    ) -> *mut dictEntry;
    fn dictDelete(d: *mut dict, key: *const libc::c_void) -> libc::c_int;
    fn dictUnlink(d: *mut dict, key: *const libc::c_void) -> *mut dictEntry;
    fn dictFreeUnlinkedEntry(d: *mut dict, he: *mut dictEntry);
    fn dictRelease(d: *mut dict);
    fn dictFind(d: *mut dict, key: *const libc::c_void) -> *mut dictEntry;
    fn dictNext(iter: *mut dictIterator) -> *mut dictEntry;
    fn dictReleaseIterator(iter: *mut dictIterator);
    fn dictGetFairRandomKey(d: *mut dict) -> *mut dictEntry;
    fn zmalloc(size: size_t) -> *mut libc::c_void;
    fn zfree(ptr: *mut libc::c_void);
    fn intsetAdd(is: *mut intset, value: int64_t, success: *mut uint8_t) -> *mut intset;
    fn intsetRemove(
        is: *mut intset,
        value: int64_t,
        success: *mut libc::c_int,
    ) -> *mut intset;
    fn intsetFind(is: *mut intset, value: int64_t) -> uint8_t;
    fn intsetRandom(is: *mut intset) -> int64_t;
    fn intsetGet(is: *mut intset, pos: uint32_t, value: *mut int64_t) -> uint8_t;
    fn intsetLen(is: *const intset) -> uint32_t;
    fn intsetBlobLen(is: *mut intset) -> size_t;
    static mut server: redisServer;
    static mut shared: sharedObjectsStruct;
    static mut setDictType: dictType;
    static mut sdsReplyDictType: dictType;
    fn addReplyDeferredLen(c: *mut client) -> *mut libc::c_void;
    fn setDeferredSetLen(c: *mut client, node: *mut libc::c_void, length: libc::c_long);
    fn addReplyBulk(c: *mut client, obj: *mut robj);
    fn addReplyBulkCBuffer(c: *mut client, p: *const libc::c_void, len: size_t);
    fn addReplyBulkLongLong(c: *mut client, ll: libc::c_longlong);
    fn addReply(c: *mut client, obj: *mut robj);
    fn addReplyBulkSds(c: *mut client, s: sds);
    fn addReplyErrorObject(c: *mut client, err: *mut robj);
    fn addReplyError(c: *mut client, err: *const libc::c_char);
    fn addReplyLongLong(c: *mut client, ll: libc::c_longlong);
    fn addReplyArrayLen(c: *mut client, length: libc::c_long);
    fn addReplySetLen(c: *mut client, length: libc::c_long);
    fn rewriteClientCommandVector(c: *mut client, argc: libc::c_int, _: ...);
    fn decrRefCount(o: *mut robj);
    fn createObject(type_0: libc::c_int, ptr: *mut libc::c_void) -> *mut robj;
    fn createStringObject(ptr: *const libc::c_char, len: size_t) -> *mut robj;
    fn isSdsRepresentableAsLongLong(s: sds, llval: *mut libc::c_longlong) -> libc::c_int;
    fn createStringObjectFromLongLong(value: libc::c_longlong) -> *mut robj;
    fn createSetObject() -> *mut robj;
    fn createIntsetObject() -> *mut robj;
    fn getLongFromObjectOrReply(
        c: *mut client,
        o: *mut robj,
        target: *mut libc::c_long,
        msg: *const libc::c_char,
    ) -> libc::c_int;
    fn getPositiveLongFromObjectOrReply(
        c: *mut client,
        o: *mut robj,
        target: *mut libc::c_long,
        msg: *const libc::c_char,
    ) -> libc::c_int;
    fn getRangeLongFromObjectOrReply(
        c: *mut client,
        o: *mut robj,
        min: libc::c_long,
        max: libc::c_long,
        target: *mut libc::c_long,
        msg: *const libc::c_char,
    ) -> libc::c_int;
    fn checkType(c: *mut client, o: *mut robj, type_0: libc::c_int) -> libc::c_int;
    fn alsoPropagate(
        dbid: libc::c_int,
        argv: *mut *mut robj,
        argc: libc::c_int,
        target: libc::c_int,
    );
    fn preventCommandPropagation(c: *mut client);
    fn htNeedsResize(dict: *mut dict) -> libc::c_int;
    fn _serverPanic(
        file: *const libc::c_char,
        line: libc::c_int,
        msg: *const libc::c_char,
        _: ...
    );
    fn _serverAssert(
        estr: *const libc::c_char,
        file: *const libc::c_char,
        line: libc::c_int,
    );
    fn _serverAssertWithInfo(
        c: *const client,
        o: *const robj,
        estr: *const libc::c_char,
        file: *const libc::c_char,
        line: libc::c_int,
    );
    fn notifyKeyspaceEvent(
        type_0: libc::c_int,
        event: *mut libc::c_char,
        key: *mut robj,
        dbid: libc::c_int,
    );
    fn lookupKeyRead(db: *mut redisDb, key: *mut robj) -> *mut robj;
    fn lookupKeyWrite(db: *mut redisDb, key: *mut robj) -> *mut robj;
    fn lookupKeyReadOrReply(
        c: *mut client,
        key: *mut robj,
        reply: *mut robj,
    ) -> *mut robj;
    fn lookupKeyWriteOrReply(
        c: *mut client,
        key: *mut robj,
        reply: *mut robj,
    ) -> *mut robj;
    fn dbAdd(db: *mut redisDb, key: *mut robj, val: *mut robj);
    fn dbOverwrite(db: *mut redisDb, key: *mut robj, val: *mut robj);
    fn setKey(
        c: *mut client,
        db: *mut redisDb,
        key: *mut robj,
        val: *mut robj,
        flags: libc::c_int,
    );
    fn dbDelete(db: *mut redisDb, key: *mut robj) -> libc::c_int;
    fn signalModifiedKey(c: *mut client, db: *mut redisDb, key: *mut robj);
    fn scanGenericCommand(c: *mut client, o: *mut robj, cursor: libc::c_ulong);
    fn parseScanCursorOrReply(
        c: *mut client,
        o: *mut robj,
        cursor: *mut libc::c_ulong,
    ) -> libc::c_int;
    fn freeObjAsync(key: *mut robj, obj: *mut robj, dbid: libc::c_int);
}
pub type __int8_t = libc::c_schar;
pub type __uint8_t = libc::c_uchar;
pub type __int16_t = libc::c_short;
pub type __uint16_t = libc::c_ushort;
pub type __int32_t = libc::c_int;
pub type __uint32_t = libc::c_uint;
pub type __int64_t = libc::c_long;
pub type __uint64_t = libc::c_ulong;
pub type __uint_least64_t = __uint64_t;
pub type __mode_t = libc::c_uint;
pub type __off64_t = libc::c_long;
pub type __pid_t = libc::c_int;
pub type __time_t = libc::c_long;
pub type __ssize_t = libc::c_long;
pub type __sig_atomic_t = libc::c_int;
pub type size_t = libc::c_ulong;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct iovec {
    pub iov_base: *mut libc::c_void,
    pub iov_len: size_t,
}
pub type mode_t = __mode_t;
pub type off_t = __off64_t;
pub type pid_t = __pid_t;
pub type ssize_t = __ssize_t;
pub type time_t = __time_t;
pub type int8_t = __int8_t;
pub type int16_t = __int16_t;
pub type int32_t = __int32_t;
pub type int64_t = __int64_t;
pub type pthread_t = libc::c_ulong;
pub type uint8_t = __uint8_t;
pub type uint16_t = __uint16_t;
pub type uint32_t = __uint32_t;
pub type uint64_t = __uint64_t;
pub type uint_least64_t = __uint_least64_t;
pub type sds = *mut libc::c_char;
#[derive(Copy, Clone)]
#[repr(C, packed)]
pub struct sdshdr8 {
    pub len: uint8_t,
    pub alloc: uint8_t,
    pub flags: libc::c_uchar,
    pub buf: [libc::c_char; 0],
}
#[derive(Copy, Clone)]
#[repr(C, packed)]
pub struct sdshdr16 {
    pub len: uint16_t,
    pub alloc: uint16_t,
    pub flags: libc::c_uchar,
    pub buf: [libc::c_char; 0],
}
#[derive(Copy, Clone)]
#[repr(C, packed)]
pub struct sdshdr32 {
    pub len: uint32_t,
    pub alloc: uint32_t,
    pub flags: libc::c_uchar,
    pub buf: [libc::c_char; 0],
}
#[derive(Copy, Clone)]
#[repr(C, packed)]
pub struct sdshdr64 {
    pub len: uint64_t,
    pub alloc: uint64_t,
    pub flags: libc::c_uchar,
    pub buf: [libc::c_char; 0],
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct aeEventLoop {
    pub maxfd: libc::c_int,
    pub setsize: libc::c_int,
    pub timeEventNextId: libc::c_longlong,
    pub events: *mut aeFileEvent,
    pub fired: *mut aeFiredEvent,
    pub timeEventHead: *mut aeTimeEvent,
    pub stop: libc::c_int,
    pub apidata: *mut libc::c_void,
    pub beforesleep: Option::<aeBeforeSleepProc>,
    pub aftersleep: Option::<aeBeforeSleepProc>,
    pub flags: libc::c_int,
}
pub type aeBeforeSleepProc = unsafe extern "C" fn(*mut aeEventLoop) -> ();
#[derive(Copy, Clone)]
#[repr(C)]
pub struct aeTimeEvent {
    pub id: libc::c_longlong,
    pub when: monotime,
    pub timeProc: Option::<aeTimeProc>,
    pub finalizerProc: Option::<aeEventFinalizerProc>,
    pub clientData: *mut libc::c_void,
    pub prev: *mut aeTimeEvent,
    pub next: *mut aeTimeEvent,
    pub refcount: libc::c_int,
}
pub type aeEventFinalizerProc = unsafe extern "C" fn(
    *mut aeEventLoop,
    *mut libc::c_void,
) -> ();
pub type aeTimeProc = unsafe extern "C" fn(
    *mut aeEventLoop,
    libc::c_longlong,
    *mut libc::c_void,
) -> libc::c_int;
pub type monotime = uint64_t;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct aeFiredEvent {
    pub fd: libc::c_int,
    pub mask: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct aeFileEvent {
    pub mask: libc::c_int,
    pub rfileProc: Option::<aeFileProc>,
    pub wfileProc: Option::<aeFileProc>,
    pub clientData: *mut libc::c_void,
}
pub type aeFileProc = unsafe extern "C" fn(
    *mut aeEventLoop,
    libc::c_int,
    *mut libc::c_void,
    libc::c_int,
) -> ();
#[derive(Copy, Clone)]
#[repr(C)]
pub struct connection {
    pub type_0: *mut ConnectionType,
    pub state: ConnectionState,
    pub flags: libc::c_short,
    pub refs: libc::c_short,
    pub last_errno: libc::c_int,
    pub private_data: *mut libc::c_void,
    pub conn_handler: ConnectionCallbackFunc,
    pub write_handler: ConnectionCallbackFunc,
    pub read_handler: ConnectionCallbackFunc,
    pub fd: libc::c_int,
}
pub type ConnectionCallbackFunc = Option::<unsafe extern "C" fn(*mut connection) -> ()>;
pub type ConnectionState = libc::c_uint;
pub const CONN_STATE_ERROR: ConnectionState = 5;
pub const CONN_STATE_CLOSED: ConnectionState = 4;
pub const CONN_STATE_CONNECTED: ConnectionState = 3;
pub const CONN_STATE_ACCEPTING: ConnectionState = 2;
pub const CONN_STATE_CONNECTING: ConnectionState = 1;
pub const CONN_STATE_NONE: ConnectionState = 0;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct ConnectionType {
    pub ae_handler: Option::<
        unsafe extern "C" fn(
            *mut aeEventLoop,
            libc::c_int,
            *mut libc::c_void,
            libc::c_int,
        ) -> (),
    >,
    pub connect: Option::<
        unsafe extern "C" fn(
            *mut connection,
            *const libc::c_char,
            libc::c_int,
            *const libc::c_char,
            ConnectionCallbackFunc,
        ) -> libc::c_int,
    >,
    pub write: Option::<
        unsafe extern "C" fn(*mut connection, *const libc::c_void, size_t) -> libc::c_int,
    >,
    pub writev: Option::<
        unsafe extern "C" fn(*mut connection, *const iovec, libc::c_int) -> libc::c_int,
    >,
    pub read: Option::<
        unsafe extern "C" fn(*mut connection, *mut libc::c_void, size_t) -> libc::c_int,
    >,
    pub close: Option::<unsafe extern "C" fn(*mut connection) -> ()>,
    pub accept: Option::<
        unsafe extern "C" fn(*mut connection, ConnectionCallbackFunc) -> libc::c_int,
    >,
    pub set_write_handler: Option::<
        unsafe extern "C" fn(
            *mut connection,
            ConnectionCallbackFunc,
            libc::c_int,
        ) -> libc::c_int,
    >,
    pub set_read_handler: Option::<
        unsafe extern "C" fn(*mut connection, ConnectionCallbackFunc) -> libc::c_int,
    >,
    pub get_last_error: Option::<
        unsafe extern "C" fn(*mut connection) -> *const libc::c_char,
    >,
    pub blocking_connect: Option::<
        unsafe extern "C" fn(
            *mut connection,
            *const libc::c_char,
            libc::c_int,
            libc::c_longlong,
        ) -> libc::c_int,
    >,
    pub sync_write: Option::<
        unsafe extern "C" fn(
            *mut connection,
            *mut libc::c_char,
            ssize_t,
            libc::c_longlong,
        ) -> ssize_t,
    >,
    pub sync_read: Option::<
        unsafe extern "C" fn(
            *mut connection,
            *mut libc::c_char,
            ssize_t,
            libc::c_longlong,
        ) -> ssize_t,
    >,
    pub sync_readline: Option::<
        unsafe extern "C" fn(
            *mut connection,
            *mut libc::c_char,
            ssize_t,
            libc::c_longlong,
        ) -> ssize_t,
    >,
    pub get_type: Option::<unsafe extern "C" fn(*mut connection) -> libc::c_int>,
}
#[derive(Copy, Clone,c2rust_bitfields:: BitfieldStruct)]
#[repr(C)]
pub struct redisObject {
    #[bitfield(name = "type_0", ty = "libc::c_uint", bits = "0..=3")]
    #[bitfield(name = "encoding", ty = "libc::c_uint", bits = "4..=7")]
    #[bitfield(name = "lru", ty = "libc::c_uint", bits = "8..=31")]
    pub type_0_encoding_lru: [u8; 4],
    pub refcount: libc::c_int,
    pub ptr: *mut libc::c_void,
}
pub type atomic_int = libc::c_int;
pub type atomic_uint = libc::c_uint;
pub type atomic_llong = libc::c_longlong;
pub type __compar_fn_t = Option::<
    unsafe extern "C" fn(*const libc::c_void, *const libc::c_void) -> libc::c_int,
>;
pub type sig_atomic_t = __sig_atomic_t;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct hdr_histogram {
    pub lowest_discernible_value: int64_t,
    pub highest_trackable_value: int64_t,
    pub unit_magnitude: int32_t,
    pub significant_figures: int32_t,
    pub sub_bucket_half_count_magnitude: int32_t,
    pub sub_bucket_half_count: int32_t,
    pub sub_bucket_mask: int64_t,
    pub sub_bucket_count: int32_t,
    pub bucket_count: int32_t,
    pub min_value: int64_t,
    pub max_value: int64_t,
    pub normalizing_index_offset: int32_t,
    pub conversion_ratio: libc::c_double,
    pub counts_len: int32_t,
    pub total_count: int64_t,
    pub counts: *mut int64_t,
}
pub type mstime_t = libc::c_longlong;
pub type ustime_t = libc::c_longlong;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct dictEntry {
    pub key: *mut libc::c_void,
    pub v: C2RustUnnamed,
    pub next: *mut dictEntry,
    pub metadata: [*mut libc::c_void; 0],
}
#[derive(Copy, Clone)]
#[repr(C)]
pub union C2RustUnnamed {
    pub val: *mut libc::c_void,
    pub u64_0: uint64_t,
    pub s64: int64_t,
    pub d: libc::c_double,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct dict {
    pub type_0: *mut dictType,
    pub ht_table: [*mut *mut dictEntry; 2],
    pub ht_used: [libc::c_ulong; 2],
    pub rehashidx: libc::c_long,
    pub pauserehash: int16_t,
    pub ht_size_exp: [libc::c_schar; 2],
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct dictType {
    pub hashFunction: Option::<unsafe extern "C" fn(*const libc::c_void) -> uint64_t>,
    pub keyDup: Option::<
        unsafe extern "C" fn(*mut dict, *const libc::c_void) -> *mut libc::c_void,
    >,
    pub valDup: Option::<
        unsafe extern "C" fn(*mut dict, *const libc::c_void) -> *mut libc::c_void,
    >,
    pub keyCompare: Option::<
        unsafe extern "C" fn(
            *mut dict,
            *const libc::c_void,
            *const libc::c_void,
        ) -> libc::c_int,
    >,
    pub keyDestructor: Option::<
        unsafe extern "C" fn(*mut dict, *mut libc::c_void) -> (),
    >,
    pub valDestructor: Option::<
        unsafe extern "C" fn(*mut dict, *mut libc::c_void) -> (),
    >,
    pub expandAllowed: Option::<
        unsafe extern "C" fn(size_t, libc::c_double) -> libc::c_int,
    >,
    pub dictEntryMetadataBytes: Option::<unsafe extern "C" fn(*mut dict) -> size_t>,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct dictIterator {
    pub d: *mut dict,
    pub index: libc::c_long,
    pub table: libc::c_int,
    pub safe: libc::c_int,
    pub entry: *mut dictEntry,
    pub nextEntry: *mut dictEntry,
    pub fingerprint: libc::c_ulonglong,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct listNode {
    pub prev: *mut listNode,
    pub next: *mut listNode,
    pub value: *mut libc::c_void,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct list {
    pub head: *mut listNode,
    pub tail: *mut listNode,
    pub dup: Option::<unsafe extern "C" fn(*mut libc::c_void) -> *mut libc::c_void>,
    pub free: Option::<unsafe extern "C" fn(*mut libc::c_void) -> ()>,
    pub match_0: Option::<
        unsafe extern "C" fn(*mut libc::c_void, *mut libc::c_void) -> libc::c_int,
    >,
    pub len: libc::c_ulong,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct intset {
    pub encoding: uint32_t,
    pub length: uint32_t,
    pub contents: [int8_t; 0],
}
#[derive(Copy, Clone,c2rust_bitfields:: BitfieldStruct)]
#[repr(C)]
pub struct raxNode {
    #[bitfield(name = "iskey", ty = "uint32_t", bits = "0..=0")]
    #[bitfield(name = "isnull", ty = "uint32_t", bits = "1..=1")]
    #[bitfield(name = "iscompr", ty = "uint32_t", bits = "2..=2")]
    #[bitfield(name = "size", ty = "uint32_t", bits = "3..=31")]
    pub iskey_isnull_iscompr_size: [u8; 4],
    pub data: [libc::c_uchar; 0],
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct rax {
    pub head: *mut raxNode,
    pub numele: uint64_t,
    pub numnodes: uint64_t,
}
pub type pause_type = libc::c_uint;
pub const CLIENT_PAUSE_ALL: pause_type = 2;
pub const CLIENT_PAUSE_WRITE: pause_type = 1;
pub const CLIENT_PAUSE_OFF: pause_type = 0;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct pause_event {
    pub type_0: pause_type,
    pub end: mstime_t,
}
pub type robj = redisObject;
pub type RedisModuleUserChangedFunc = Option::<
    unsafe extern "C" fn(uint64_t, *mut libc::c_void) -> (),
>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct redisDb {
    pub dict: *mut dict,
    pub expires: *mut dict,
    pub blocking_keys: *mut dict,
    pub ready_keys: *mut dict,
    pub watched_keys: *mut dict,
    pub id: libc::c_int,
    pub avg_ttl: libc::c_longlong,
    pub expires_cursor: libc::c_ulong,
    pub defrag_later: *mut list,
    pub slots_to_keys: *mut clusterSlotToKeyMapping,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct multiCmd {
    pub argv: *mut *mut robj,
    pub argv_len: libc::c_int,
    pub argc: libc::c_int,
    pub cmd: *mut redisCommand,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct redisCommand {
    pub declared_name: *const libc::c_char,
    pub summary: *const libc::c_char,
    pub complexity: *const libc::c_char,
    pub since: *const libc::c_char,
    pub doc_flags: libc::c_int,
    pub replaced_by: *const libc::c_char,
    pub deprecated_since: *const libc::c_char,
    pub group: redisCommandGroup,
    pub history: *mut commandHistory,
    pub tips: *mut *const libc::c_char,
    pub proc_0: Option::<redisCommandProc>,
    pub arity: libc::c_int,
    pub flags: uint64_t,
    pub acl_categories: uint64_t,
    pub key_specs_static: [keySpec; 4],
    pub getkeys_proc: Option::<redisGetKeysProc>,
    pub subcommands: *mut redisCommand,
    pub args: *mut redisCommandArg,
    pub microseconds: libc::c_longlong,
    pub calls: libc::c_longlong,
    pub rejected_calls: libc::c_longlong,
    pub failed_calls: libc::c_longlong,
    pub id: libc::c_int,
    pub fullname: sds,
    pub latency_histogram: *mut hdr_histogram,
    pub key_specs: *mut keySpec,
    pub legacy_range_key_spec: keySpec,
    pub num_args: libc::c_int,
    pub num_history: libc::c_int,
    pub num_tips: libc::c_int,
    pub key_specs_num: libc::c_int,
    pub key_specs_max: libc::c_int,
    pub subcommands_dict: *mut dict,
    pub parent: *mut redisCommand,
    pub module_cmd: *mut RedisModuleCommand,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct keySpec {
    pub notes: *const libc::c_char,
    pub flags: uint64_t,
    pub begin_search_type: kspec_bs_type,
    pub bs: C2RustUnnamed_3,
    pub find_keys_type: kspec_fk_type,
    pub fk: C2RustUnnamed_0,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub union C2RustUnnamed_0 {
    pub range: C2RustUnnamed_2,
    pub keynum: C2RustUnnamed_1,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_1 {
    pub keynumidx: libc::c_int,
    pub firstkey: libc::c_int,
    pub keystep: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_2 {
    pub lastkey: libc::c_int,
    pub keystep: libc::c_int,
    pub limit: libc::c_int,
}
pub type kspec_fk_type = libc::c_uint;
pub const KSPEC_FK_KEYNUM: kspec_fk_type = 3;
pub const KSPEC_FK_RANGE: kspec_fk_type = 2;
pub const KSPEC_FK_UNKNOWN: kspec_fk_type = 1;
pub const KSPEC_FK_INVALID: kspec_fk_type = 0;
#[derive(Copy, Clone)]
#[repr(C)]
pub union C2RustUnnamed_3 {
    pub index: C2RustUnnamed_5,
    pub keyword: C2RustUnnamed_4,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_4 {
    pub keyword: *const libc::c_char,
    pub startfrom: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_5 {
    pub pos: libc::c_int,
}
pub type kspec_bs_type = libc::c_uint;
pub const KSPEC_BS_KEYWORD: kspec_bs_type = 3;
pub const KSPEC_BS_INDEX: kspec_bs_type = 2;
pub const KSPEC_BS_UNKNOWN: kspec_bs_type = 1;
pub const KSPEC_BS_INVALID: kspec_bs_type = 0;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct redisCommandArg {
    pub name: *const libc::c_char,
    pub type_0: redisCommandArgType,
    pub key_spec_index: libc::c_int,
    pub token: *const libc::c_char,
    pub summary: *const libc::c_char,
    pub since: *const libc::c_char,
    pub flags: libc::c_int,
    pub deprecated_since: *const libc::c_char,
    pub subargs: *mut redisCommandArg,
    pub num_args: libc::c_int,
}
pub type redisCommandArgType = libc::c_uint;
pub const ARG_TYPE_BLOCK: redisCommandArgType = 8;
pub const ARG_TYPE_ONEOF: redisCommandArgType = 7;
pub const ARG_TYPE_PURE_TOKEN: redisCommandArgType = 6;
pub const ARG_TYPE_UNIX_TIME: redisCommandArgType = 5;
pub const ARG_TYPE_PATTERN: redisCommandArgType = 4;
pub const ARG_TYPE_KEY: redisCommandArgType = 3;
pub const ARG_TYPE_DOUBLE: redisCommandArgType = 2;
pub const ARG_TYPE_INTEGER: redisCommandArgType = 1;
pub const ARG_TYPE_STRING: redisCommandArgType = 0;
pub type redisGetKeysProc = unsafe extern "C" fn(
    *mut redisCommand,
    *mut *mut robj,
    libc::c_int,
    *mut getKeysResult,
) -> libc::c_int;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct getKeysResult {
    pub keysbuf: [keyReference; 256],
    pub keys: *mut keyReference,
    pub numkeys: libc::c_int,
    pub size: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct keyReference {
    pub pos: libc::c_int,
    pub flags: libc::c_int,
}
pub type redisCommandProc = unsafe extern "C" fn(*mut client) -> ();
#[derive(Copy, Clone)]
#[repr(C)]
pub struct client {
    pub id: uint64_t,
    pub flags: uint64_t,
    pub conn: *mut connection,
    pub resp: libc::c_int,
    pub db: *mut redisDb,
    pub name: *mut robj,
    pub querybuf: sds,
    pub qb_pos: size_t,
    pub querybuf_peak: size_t,
    pub argc: libc::c_int,
    pub argv: *mut *mut robj,
    pub argv_len: libc::c_int,
    pub original_argc: libc::c_int,
    pub original_argv: *mut *mut robj,
    pub argv_len_sum: size_t,
    pub cmd: *mut redisCommand,
    pub lastcmd: *mut redisCommand,
    pub realcmd: *mut redisCommand,
    pub user: *mut user,
    pub reqtype: libc::c_int,
    pub multibulklen: libc::c_int,
    pub bulklen: libc::c_long,
    pub reply: *mut list,
    pub reply_bytes: libc::c_ulonglong,
    pub deferred_reply_errors: *mut list,
    pub sentlen: size_t,
    pub ctime: time_t,
    pub duration: libc::c_long,
    pub slot: libc::c_int,
    pub cur_script: *mut dictEntry,
    pub lastinteraction: time_t,
    pub obuf_soft_limit_reached_time: time_t,
    pub authenticated: libc::c_int,
    pub replstate: libc::c_int,
    pub repl_start_cmd_stream_on_ack: libc::c_int,
    pub repldbfd: libc::c_int,
    pub repldboff: off_t,
    pub repldbsize: off_t,
    pub replpreamble: sds,
    pub read_reploff: libc::c_longlong,
    pub reploff: libc::c_longlong,
    pub repl_applied: libc::c_longlong,
    pub repl_ack_off: libc::c_longlong,
    pub repl_ack_time: libc::c_longlong,
    pub repl_last_partial_write: libc::c_longlong,
    pub psync_initial_offset: libc::c_longlong,
    pub replid: [libc::c_char; 41],
    pub slave_listening_port: libc::c_int,
    pub slave_addr: *mut libc::c_char,
    pub slave_capa: libc::c_int,
    pub slave_req: libc::c_int,
    pub mstate: multiState,
    pub btype: libc::c_int,
    pub bpop: blockingState,
    pub woff: libc::c_longlong,
    pub watched_keys: *mut list,
    pub pubsub_channels: *mut dict,
    pub pubsub_patterns: *mut list,
    pub pubsubshard_channels: *mut dict,
    pub peerid: sds,
    pub sockname: sds,
    pub client_list_node: *mut listNode,
    pub postponed_list_node: *mut listNode,
    pub pending_read_list_node: *mut listNode,
    pub auth_callback: RedisModuleUserChangedFunc,
    pub auth_callback_privdata: *mut libc::c_void,
    pub auth_module: *mut libc::c_void,
    pub client_tracking_redirection: uint64_t,
    pub client_tracking_prefixes: *mut rax,
    pub last_memory_usage: size_t,
    pub last_memory_type: libc::c_int,
    pub mem_usage_bucket_node: *mut listNode,
    pub mem_usage_bucket: *mut clientMemUsageBucket,
    pub ref_repl_buf_node: *mut listNode,
    pub ref_block_pos: size_t,
    pub buf_peak: size_t,
    pub buf_peak_last_reset_time: mstime_t,
    pub bufpos: libc::c_int,
    pub buf_usable_size: size_t,
    pub buf: *mut libc::c_char,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct clientMemUsageBucket {
    pub clients: *mut list,
    pub mem_usage_sum: size_t,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct blockingState {
    pub count: libc::c_long,
    pub timeout: mstime_t,
    pub keys: *mut dict,
    pub target: *mut robj,
    pub blockpos: blockPos,
    pub xread_count: size_t,
    pub xread_group: *mut robj,
    pub xread_consumer: *mut robj,
    pub xread_group_noack: libc::c_int,
    pub numreplicas: libc::c_int,
    pub reploffset: libc::c_longlong,
    pub module_blocked_handle: *mut libc::c_void,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct blockPos {
    pub wherefrom: libc::c_int,
    pub whereto: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct multiState {
    pub commands: *mut multiCmd,
    pub count: libc::c_int,
    pub cmd_flags: libc::c_int,
    pub cmd_inv_flags: libc::c_int,
    pub argv_len_sums: size_t,
    pub alloc_count: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct user {
    pub name: sds,
    pub flags: uint32_t,
    pub passwords: *mut list,
    pub selectors: *mut list,
    pub acl_string: *mut robj,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct commandHistory {
    pub since: *const libc::c_char,
    pub changes: *const libc::c_char,
}
pub type redisCommandGroup = libc::c_uint;
pub const COMMAND_GROUP_MODULE: redisCommandGroup = 17;
pub const COMMAND_GROUP_BITMAP: redisCommandGroup = 16;
pub const COMMAND_GROUP_STREAM: redisCommandGroup = 15;
pub const COMMAND_GROUP_GEO: redisCommandGroup = 14;
pub const COMMAND_GROUP_SENTINEL: redisCommandGroup = 13;
pub const COMMAND_GROUP_CLUSTER: redisCommandGroup = 12;
pub const COMMAND_GROUP_HYPERLOGLOG: redisCommandGroup = 11;
pub const COMMAND_GROUP_SCRIPTING: redisCommandGroup = 10;
pub const COMMAND_GROUP_SERVER: redisCommandGroup = 9;
pub const COMMAND_GROUP_CONNECTION: redisCommandGroup = 8;
pub const COMMAND_GROUP_TRANSACTIONS: redisCommandGroup = 7;
pub const COMMAND_GROUP_PUBSUB: redisCommandGroup = 6;
pub const COMMAND_GROUP_HASH: redisCommandGroup = 5;
pub const COMMAND_GROUP_SORTED_SET: redisCommandGroup = 4;
pub const COMMAND_GROUP_SET: redisCommandGroup = 3;
pub const COMMAND_GROUP_LIST: redisCommandGroup = 2;
pub const COMMAND_GROUP_STRING: redisCommandGroup = 1;
pub const COMMAND_GROUP_GENERIC: redisCommandGroup = 0;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct replBacklog {
    pub ref_repl_buf_node: *mut listNode,
    pub unindexed_count: size_t,
    pub blocks_index: *mut rax,
    pub histlen: libc::c_longlong,
    pub offset: libc::c_longlong,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct saveparam {
    pub seconds: time_t,
    pub changes: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct sentinelConfig {
    pub pre_monitor_cfg: *mut list,
    pub monitor_cfg: *mut list,
    pub post_monitor_cfg: *mut list,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct sharedObjectsStruct {
    pub crlf: *mut robj,
    pub ok: *mut robj,
    pub err: *mut robj,
    pub emptybulk: *mut robj,
    pub czero: *mut robj,
    pub cone: *mut robj,
    pub pong: *mut robj,
    pub space: *mut robj,
    pub queued: *mut robj,
    pub null: [*mut robj; 4],
    pub nullarray: [*mut robj; 4],
    pub emptymap: [*mut robj; 4],
    pub emptyset: [*mut robj; 4],
    pub emptyarray: *mut robj,
    pub wrongtypeerr: *mut robj,
    pub nokeyerr: *mut robj,
    pub syntaxerr: *mut robj,
    pub sameobjecterr: *mut robj,
    pub outofrangeerr: *mut robj,
    pub noscripterr: *mut robj,
    pub loadingerr: *mut robj,
    pub slowevalerr: *mut robj,
    pub slowscripterr: *mut robj,
    pub slowmoduleerr: *mut robj,
    pub bgsaveerr: *mut robj,
    pub masterdownerr: *mut robj,
    pub roslaveerr: *mut robj,
    pub execaborterr: *mut robj,
    pub noautherr: *mut robj,
    pub noreplicaserr: *mut robj,
    pub busykeyerr: *mut robj,
    pub oomerr: *mut robj,
    pub plus: *mut robj,
    pub messagebulk: *mut robj,
    pub pmessagebulk: *mut robj,
    pub subscribebulk: *mut robj,
    pub unsubscribebulk: *mut robj,
    pub psubscribebulk: *mut robj,
    pub punsubscribebulk: *mut robj,
    pub del: *mut robj,
    pub unlink: *mut robj,
    pub rpop: *mut robj,
    pub lpop: *mut robj,
    pub lpush: *mut robj,
    pub rpoplpush: *mut robj,
    pub lmove: *mut robj,
    pub blmove: *mut robj,
    pub zpopmin: *mut robj,
    pub zpopmax: *mut robj,
    pub emptyscan: *mut robj,
    pub multi: *mut robj,
    pub exec: *mut robj,
    pub left: *mut robj,
    pub right: *mut robj,
    pub hset: *mut robj,
    pub srem: *mut robj,
    pub xgroup: *mut robj,
    pub xclaim: *mut robj,
    pub script: *mut robj,
    pub replconf: *mut robj,
    pub eval: *mut robj,
    pub persist: *mut robj,
    pub set: *mut robj,
    pub pexpireat: *mut robj,
    pub pexpire: *mut robj,
    pub time: *mut robj,
    pub pxat: *mut robj,
    pub absttl: *mut robj,
    pub retrycount: *mut robj,
    pub force: *mut robj,
    pub justid: *mut robj,
    pub entriesread: *mut robj,
    pub lastid: *mut robj,
    pub ping: *mut robj,
    pub setid: *mut robj,
    pub keepttl: *mut robj,
    pub load: *mut robj,
    pub createconsumer: *mut robj,
    pub getack: *mut robj,
    pub special_asterick: *mut robj,
    pub special_equals: *mut robj,
    pub default_username: *mut robj,
    pub redacted: *mut robj,
    pub ssubscribebulk: *mut robj,
    pub sunsubscribebulk: *mut robj,
    pub smessagebulk: *mut robj,
    pub select: [*mut robj; 10],
    pub integers: [*mut robj; 10000],
    pub mbulkhdr: [*mut robj; 32],
    pub bulkhdr: [*mut robj; 32],
    pub maphdr: [*mut robj; 32],
    pub sethdr: [*mut robj; 32],
    pub minstring: sds,
    pub maxstring: sds,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct clientBufferLimitsConfig {
    pub hard_limit_bytes: libc::c_ulonglong,
    pub soft_limit_bytes: libc::c_ulonglong,
    pub soft_limit_seconds: time_t,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct redisOp {
    pub argv: *mut *mut robj,
    pub argc: libc::c_int,
    pub dbid: libc::c_int,
    pub target: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct redisOpArray {
    pub ops: *mut redisOp,
    pub numops: libc::c_int,
    pub capacity: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct malloc_stats {
    pub zmalloc_used: size_t,
    pub process_rss: size_t,
    pub allocator_allocated: size_t,
    pub allocator_active: size_t,
    pub allocator_resident: size_t,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct socketFds {
    pub fd: [libc::c_int; 16],
    pub count: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct redisTLSContextConfig {
    pub cert_file: *mut libc::c_char,
    pub key_file: *mut libc::c_char,
    pub key_file_pass: *mut libc::c_char,
    pub client_cert_file: *mut libc::c_char,
    pub client_key_file: *mut libc::c_char,
    pub client_key_file_pass: *mut libc::c_char,
    pub dh_params_file: *mut libc::c_char,
    pub ca_cert_file: *mut libc::c_char,
    pub ca_cert_dir: *mut libc::c_char,
    pub protocols: *mut libc::c_char,
    pub ciphers: *mut libc::c_char,
    pub ciphersuites: *mut libc::c_char,
    pub prefer_server_ciphers: libc::c_int,
    pub session_caching: libc::c_int,
    pub session_cache_size: libc::c_int,
    pub session_cache_timeout: libc::c_int,
}
pub type aof_file_type = libc::c_uint;
pub const AOF_FILE_TYPE_INCR: aof_file_type = 105;
pub const AOF_FILE_TYPE_HIST: aof_file_type = 104;
pub const AOF_FILE_TYPE_BASE: aof_file_type = 98;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct aofInfo {
    pub file_name: sds,
    pub file_seq: libc::c_longlong,
    pub file_type: aof_file_type,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct aofManifest {
    pub base_aof_info: *mut aofInfo,
    pub incr_aof_list: *mut list,
    pub history_aof_list: *mut list,
    pub curr_base_file_seq: libc::c_longlong,
    pub curr_incr_file_seq: libc::c_longlong,
    pub dirty: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct redisServer {
    pub pid: pid_t,
    pub main_thread_id: pthread_t,
    pub configfile: *mut libc::c_char,
    pub executable: *mut libc::c_char,
    pub exec_argv: *mut *mut libc::c_char,
    pub dynamic_hz: libc::c_int,
    pub config_hz: libc::c_int,
    pub umask: mode_t,
    pub hz: libc::c_int,
    pub in_fork_child: libc::c_int,
    pub db: *mut redisDb,
    pub commands: *mut dict,
    pub orig_commands: *mut dict,
    pub el: *mut aeEventLoop,
    pub errors: *mut rax,
    pub lruclock: atomic_uint,
    pub shutdown_asap: sig_atomic_t,
    pub shutdown_mstime: mstime_t,
    pub last_sig_received: libc::c_int,
    pub shutdown_flags: libc::c_int,
    pub activerehashing: libc::c_int,
    pub active_defrag_running: libc::c_int,
    pub pidfile: *mut libc::c_char,
    pub arch_bits: libc::c_int,
    pub cronloops: libc::c_int,
    pub runid: [libc::c_char; 41],
    pub sentinel_mode: libc::c_int,
    pub initial_memory_usage: size_t,
    pub always_show_logo: libc::c_int,
    pub in_exec: libc::c_int,
    pub busy_module_yield_flags: libc::c_int,
    pub busy_module_yield_reply: *const libc::c_char,
    pub core_propagates: libc::c_int,
    pub propagate_no_multi: libc::c_int,
    pub module_ctx_nesting: libc::c_int,
    pub ignore_warnings: *mut libc::c_char,
    pub client_pause_in_transaction: libc::c_int,
    pub thp_enabled: libc::c_int,
    pub page_size: size_t,
    pub moduleapi: *mut dict,
    pub sharedapi: *mut dict,
    pub module_configs_queue: *mut dict,
    pub loadmodule_queue: *mut list,
    pub module_pipe: [libc::c_int; 2],
    pub child_pid: pid_t,
    pub child_type: libc::c_int,
    pub port: libc::c_int,
    pub tls_port: libc::c_int,
    pub tcp_backlog: libc::c_int,
    pub bindaddr: [*mut libc::c_char; 16],
    pub bindaddr_count: libc::c_int,
    pub bind_source_addr: *mut libc::c_char,
    pub unixsocket: *mut libc::c_char,
    pub unixsocketperm: libc::c_uint,
    pub ipfd: socketFds,
    pub tlsfd: socketFds,
    pub sofd: libc::c_int,
    pub socket_mark_id: uint32_t,
    pub cfd: socketFds,
    pub clients: *mut list,
    pub clients_to_close: *mut list,
    pub clients_pending_write: *mut list,
    pub clients_pending_read: *mut list,
    pub slaves: *mut list,
    pub monitors: *mut list,
    pub current_client: *mut client,
    pub client_mem_usage_buckets: *mut clientMemUsageBucket,
    pub clients_timeout_table: *mut rax,
    pub fixed_time_expire: libc::c_long,
    pub in_nested_call: libc::c_int,
    pub clients_index: *mut rax,
    pub client_pause_type: pause_type,
    pub postponed_clients: *mut list,
    pub client_pause_end_time: mstime_t,
    pub client_pause_per_purpose: [*mut pause_event; 3],
    pub neterr: [libc::c_char; 256],
    pub migrate_cached_sockets: *mut dict,
    pub next_client_id: uint_least64_t,
    pub protected_mode: libc::c_int,
    pub io_threads_num: libc::c_int,
    pub io_threads_do_reads: libc::c_int,
    pub io_threads_active: libc::c_int,
    pub events_processed_while_blocked: libc::c_longlong,
    pub enable_protected_configs: libc::c_int,
    pub enable_debug_cmd: libc::c_int,
    pub enable_module_cmd: libc::c_int,
    pub loading: sig_atomic_t,
    pub async_loading: sig_atomic_t,
    pub loading_total_bytes: off_t,
    pub loading_rdb_used_mem: off_t,
    pub loading_loaded_bytes: off_t,
    pub loading_start_time: time_t,
    pub loading_process_events_interval_bytes: off_t,
    pub stat_starttime: time_t,
    pub stat_numcommands: libc::c_longlong,
    pub stat_numconnections: libc::c_longlong,
    pub stat_expiredkeys: libc::c_longlong,
    pub stat_expired_stale_perc: libc::c_double,
    pub stat_expired_time_cap_reached_count: libc::c_longlong,
    pub stat_expire_cycle_time_used: libc::c_longlong,
    pub stat_evictedkeys: libc::c_longlong,
    pub stat_evictedclients: libc::c_longlong,
    pub stat_total_eviction_exceeded_time: libc::c_longlong,
    pub stat_last_eviction_exceeded_time: monotime,
    pub stat_keyspace_hits: libc::c_longlong,
    pub stat_keyspace_misses: libc::c_longlong,
    pub stat_active_defrag_hits: libc::c_longlong,
    pub stat_active_defrag_misses: libc::c_longlong,
    pub stat_active_defrag_key_hits: libc::c_longlong,
    pub stat_active_defrag_key_misses: libc::c_longlong,
    pub stat_active_defrag_scanned: libc::c_longlong,
    pub stat_total_active_defrag_time: libc::c_longlong,
    pub stat_last_active_defrag_time: monotime,
    pub stat_peak_memory: size_t,
    pub stat_aof_rewrites: libc::c_longlong,
    pub stat_aofrw_consecutive_failures: libc::c_longlong,
    pub stat_rdb_saves: libc::c_longlong,
    pub stat_fork_time: libc::c_longlong,
    pub stat_fork_rate: libc::c_double,
    pub stat_total_forks: libc::c_longlong,
    pub stat_rejected_conn: libc::c_longlong,
    pub stat_sync_full: libc::c_longlong,
    pub stat_sync_partial_ok: libc::c_longlong,
    pub stat_sync_partial_err: libc::c_longlong,
    pub slowlog: *mut list,
    pub slowlog_entry_id: libc::c_longlong,
    pub slowlog_log_slower_than: libc::c_longlong,
    pub slowlog_max_len: libc::c_ulong,
    pub cron_malloc_stats: malloc_stats,
    pub stat_net_input_bytes: atomic_llong,
    pub stat_net_output_bytes: atomic_llong,
    pub stat_net_repl_input_bytes: atomic_llong,
    pub stat_net_repl_output_bytes: atomic_llong,
    pub stat_current_cow_peak: size_t,
    pub stat_current_cow_bytes: size_t,
    pub stat_current_cow_updated: monotime,
    pub stat_current_save_keys_processed: size_t,
    pub stat_current_save_keys_total: size_t,
    pub stat_rdb_cow_bytes: size_t,
    pub stat_aof_cow_bytes: size_t,
    pub stat_module_cow_bytes: size_t,
    pub stat_module_progress: libc::c_double,
    pub stat_clients_type_memory: [size_t; 4],
    pub stat_cluster_links_memory: size_t,
    pub stat_unexpected_error_replies: libc::c_longlong,
    pub stat_total_error_replies: libc::c_longlong,
    pub stat_dump_payload_sanitizations: libc::c_longlong,
    pub stat_io_reads_processed: libc::c_longlong,
    pub stat_io_writes_processed: libc::c_longlong,
    pub stat_total_reads_processed: atomic_llong,
    pub stat_total_writes_processed: atomic_llong,
    pub inst_metric: [C2RustUnnamed_6; 5],
    pub stat_reply_buffer_shrinks: libc::c_longlong,
    pub stat_reply_buffer_expands: libc::c_longlong,
    pub verbosity: libc::c_int,
    pub maxidletime: libc::c_int,
    pub tcpkeepalive: libc::c_int,
    pub active_expire_enabled: libc::c_int,
    pub active_expire_effort: libc::c_int,
    pub active_defrag_enabled: libc::c_int,
    pub sanitize_dump_payload: libc::c_int,
    pub skip_checksum_validation: libc::c_int,
    pub jemalloc_bg_thread: libc::c_int,
    pub active_defrag_ignore_bytes: size_t,
    pub active_defrag_threshold_lower: libc::c_int,
    pub active_defrag_threshold_upper: libc::c_int,
    pub active_defrag_cycle_min: libc::c_int,
    pub active_defrag_cycle_max: libc::c_int,
    pub active_defrag_max_scan_fields: libc::c_ulong,
    pub client_max_querybuf_len: size_t,
    pub dbnum: libc::c_int,
    pub supervised: libc::c_int,
    pub supervised_mode: libc::c_int,
    pub daemonize: libc::c_int,
    pub set_proc_title: libc::c_int,
    pub proc_title_template: *mut libc::c_char,
    pub client_obuf_limits: [clientBufferLimitsConfig; 3],
    pub pause_cron: libc::c_int,
    pub latency_tracking_enabled: libc::c_int,
    pub latency_tracking_info_percentiles: *mut libc::c_double,
    pub latency_tracking_info_percentiles_len: libc::c_int,
    pub aof_enabled: libc::c_int,
    pub aof_state: libc::c_int,
    pub aof_fsync: libc::c_int,
    pub aof_filename: *mut libc::c_char,
    pub aof_dirname: *mut libc::c_char,
    pub aof_no_fsync_on_rewrite: libc::c_int,
    pub aof_rewrite_perc: libc::c_int,
    pub aof_rewrite_min_size: off_t,
    pub aof_rewrite_base_size: off_t,
    pub aof_current_size: off_t,
    pub aof_last_incr_size: off_t,
    pub aof_fsync_offset: off_t,
    pub aof_flush_sleep: libc::c_int,
    pub aof_rewrite_scheduled: libc::c_int,
    pub aof_buf: sds,
    pub aof_fd: libc::c_int,
    pub aof_selected_db: libc::c_int,
    pub aof_flush_postponed_start: time_t,
    pub aof_last_fsync: time_t,
    pub aof_rewrite_time_last: time_t,
    pub aof_rewrite_time_start: time_t,
    pub aof_cur_timestamp: time_t,
    pub aof_timestamp_enabled: libc::c_int,
    pub aof_lastbgrewrite_status: libc::c_int,
    pub aof_delayed_fsync: libc::c_ulong,
    pub aof_rewrite_incremental_fsync: libc::c_int,
    pub rdb_save_incremental_fsync: libc::c_int,
    pub aof_last_write_status: libc::c_int,
    pub aof_last_write_errno: libc::c_int,
    pub aof_load_truncated: libc::c_int,
    pub aof_use_rdb_preamble: libc::c_int,
    pub aof_bio_fsync_status: atomic_int,
    pub aof_bio_fsync_errno: atomic_int,
    pub aof_manifest: *mut aofManifest,
    pub aof_disable_auto_gc: libc::c_int,
    pub dirty: libc::c_longlong,
    pub dirty_before_bgsave: libc::c_longlong,
    pub rdb_last_load_keys_expired: libc::c_longlong,
    pub rdb_last_load_keys_loaded: libc::c_longlong,
    pub saveparams: *mut saveparam,
    pub saveparamslen: libc::c_int,
    pub rdb_filename: *mut libc::c_char,
    pub rdb_compression: libc::c_int,
    pub rdb_checksum: libc::c_int,
    pub rdb_del_sync_files: libc::c_int,
    pub lastsave: time_t,
    pub lastbgsave_try: time_t,
    pub rdb_save_time_last: time_t,
    pub rdb_save_time_start: time_t,
    pub rdb_bgsave_scheduled: libc::c_int,
    pub rdb_child_type: libc::c_int,
    pub lastbgsave_status: libc::c_int,
    pub stop_writes_on_bgsave_err: libc::c_int,
    pub rdb_pipe_read: libc::c_int,
    pub rdb_child_exit_pipe: libc::c_int,
    pub rdb_pipe_conns: *mut *mut connection,
    pub rdb_pipe_numconns: libc::c_int,
    pub rdb_pipe_numconns_writing: libc::c_int,
    pub rdb_pipe_buff: *mut libc::c_char,
    pub rdb_pipe_bufflen: libc::c_int,
    pub rdb_key_save_delay: libc::c_int,
    pub key_load_delay: libc::c_int,
    pub child_info_pipe: [libc::c_int; 2],
    pub child_info_nread: libc::c_int,
    pub also_propagate: redisOpArray,
    pub replication_allowed: libc::c_int,
    pub logfile: *mut libc::c_char,
    pub syslog_enabled: libc::c_int,
    pub syslog_ident: *mut libc::c_char,
    pub syslog_facility: libc::c_int,
    pub crashlog_enabled: libc::c_int,
    pub memcheck_enabled: libc::c_int,
    pub use_exit_on_panic: libc::c_int,
    pub shutdown_timeout: libc::c_int,
    pub shutdown_on_sigint: libc::c_int,
    pub shutdown_on_sigterm: libc::c_int,
    pub replid: [libc::c_char; 41],
    pub replid2: [libc::c_char; 41],
    pub master_repl_offset: libc::c_longlong,
    pub second_replid_offset: libc::c_longlong,
    pub slaveseldb: libc::c_int,
    pub repl_ping_slave_period: libc::c_int,
    pub repl_backlog: *mut replBacklog,
    pub repl_backlog_size: libc::c_longlong,
    pub repl_backlog_time_limit: time_t,
    pub repl_no_slaves_since: time_t,
    pub repl_min_slaves_to_write: libc::c_int,
    pub repl_min_slaves_max_lag: libc::c_int,
    pub repl_good_slaves_count: libc::c_int,
    pub repl_diskless_sync: libc::c_int,
    pub repl_diskless_load: libc::c_int,
    pub repl_diskless_sync_delay: libc::c_int,
    pub repl_diskless_sync_max_replicas: libc::c_int,
    pub repl_buffer_mem: size_t,
    pub repl_buffer_blocks: *mut list,
    pub masteruser: *mut libc::c_char,
    pub masterauth: sds,
    pub masterhost: *mut libc::c_char,
    pub masterport: libc::c_int,
    pub repl_timeout: libc::c_int,
    pub master: *mut client,
    pub cached_master: *mut client,
    pub repl_syncio_timeout: libc::c_int,
    pub repl_state: libc::c_int,
    pub repl_transfer_size: off_t,
    pub repl_transfer_read: off_t,
    pub repl_transfer_last_fsync_off: off_t,
    pub repl_transfer_s: *mut connection,
    pub repl_transfer_fd: libc::c_int,
    pub repl_transfer_tmpfile: *mut libc::c_char,
    pub repl_transfer_lastio: time_t,
    pub repl_serve_stale_data: libc::c_int,
    pub repl_slave_ro: libc::c_int,
    pub repl_slave_ignore_maxmemory: libc::c_int,
    pub repl_down_since: time_t,
    pub repl_disable_tcp_nodelay: libc::c_int,
    pub slave_priority: libc::c_int,
    pub replica_announced: libc::c_int,
    pub slave_announce_port: libc::c_int,
    pub slave_announce_ip: *mut libc::c_char,
    pub propagation_error_behavior: libc::c_int,
    pub repl_ignore_disk_write_error: libc::c_int,
    pub master_replid: [libc::c_char; 41],
    pub master_initial_offset: libc::c_longlong,
    pub repl_slave_lazy_flush: libc::c_int,
    pub clients_waiting_acks: *mut list,
    pub get_ack_from_slaves: libc::c_int,
    pub maxclients: libc::c_uint,
    pub maxmemory: libc::c_ulonglong,
    pub maxmemory_clients: ssize_t,
    pub maxmemory_policy: libc::c_int,
    pub maxmemory_samples: libc::c_int,
    pub maxmemory_eviction_tenacity: libc::c_int,
    pub lfu_log_factor: libc::c_int,
    pub lfu_decay_time: libc::c_int,
    pub proto_max_bulk_len: libc::c_longlong,
    pub oom_score_adj_values: [libc::c_int; 3],
    pub oom_score_adj: libc::c_int,
    pub disable_thp: libc::c_int,
    pub blocked_clients: libc::c_uint,
    pub blocked_clients_by_type: [libc::c_uint; 8],
    pub unblocked_clients: *mut list,
    pub ready_keys: *mut list,
    pub tracking_clients: libc::c_uint,
    pub tracking_table_max_keys: size_t,
    pub tracking_pending_keys: *mut list,
    pub sort_desc: libc::c_int,
    pub sort_alpha: libc::c_int,
    pub sort_bypattern: libc::c_int,
    pub sort_store: libc::c_int,
    pub hash_max_listpack_entries: size_t,
    pub hash_max_listpack_value: size_t,
    pub set_max_intset_entries: size_t,
    pub zset_max_listpack_entries: size_t,
    pub zset_max_listpack_value: size_t,
    pub hll_sparse_max_bytes: size_t,
    pub stream_node_max_bytes: size_t,
    pub stream_node_max_entries: libc::c_longlong,
    pub list_max_listpack_size: libc::c_int,
    pub list_compress_depth: libc::c_int,
    pub unixtime: atomic_int,
    pub timezone: time_t,
    pub daylight_active: libc::c_int,
    pub mstime: mstime_t,
    pub ustime: ustime_t,
    pub blocking_op_nesting: size_t,
    pub blocked_last_cron: libc::c_longlong,
    pub pubsub_channels: *mut dict,
    pub pubsub_patterns: *mut dict,
    pub notify_keyspace_events: libc::c_int,
    pub pubsubshard_channels: *mut dict,
    pub cluster_enabled: libc::c_int,
    pub cluster_port: libc::c_int,
    pub cluster_node_timeout: mstime_t,
    pub cluster_configfile: *mut libc::c_char,
    pub cluster: *mut clusterState,
    pub cluster_migration_barrier: libc::c_int,
    pub cluster_allow_replica_migration: libc::c_int,
    pub cluster_slave_validity_factor: libc::c_int,
    pub cluster_require_full_coverage: libc::c_int,
    pub cluster_slave_no_failover: libc::c_int,
    pub cluster_announce_ip: *mut libc::c_char,
    pub cluster_announce_hostname: *mut libc::c_char,
    pub cluster_preferred_endpoint_type: libc::c_int,
    pub cluster_announce_port: libc::c_int,
    pub cluster_announce_tls_port: libc::c_int,
    pub cluster_announce_bus_port: libc::c_int,
    pub cluster_module_flags: libc::c_int,
    pub cluster_allow_reads_when_down: libc::c_int,
    pub cluster_config_file_lock_fd: libc::c_int,
    pub cluster_link_sendbuf_limit_bytes: libc::c_ulonglong,
    pub cluster_drop_packet_filter: libc::c_int,
    pub script_caller: *mut client,
    pub busy_reply_threshold: mstime_t,
    pub pre_command_oom_state: libc::c_int,
    pub script_disable_deny_script: libc::c_int,
    pub lazyfree_lazy_eviction: libc::c_int,
    pub lazyfree_lazy_expire: libc::c_int,
    pub lazyfree_lazy_server_del: libc::c_int,
    pub lazyfree_lazy_user_del: libc::c_int,
    pub lazyfree_lazy_user_flush: libc::c_int,
    pub latency_monitor_threshold: libc::c_longlong,
    pub latency_events: *mut dict,
    pub acl_filename: *mut libc::c_char,
    pub acllog_max_len: libc::c_ulong,
    pub requirepass: sds,
    pub acl_pubsub_default: libc::c_int,
    pub watchdog_period: libc::c_int,
    pub system_memory_size: size_t,
    pub tls_cluster: libc::c_int,
    pub tls_replication: libc::c_int,
    pub tls_auth_clients: libc::c_int,
    pub tls_ctx_config: redisTLSContextConfig,
    pub server_cpulist: *mut libc::c_char,
    pub bio_cpulist: *mut libc::c_char,
    pub aof_rewrite_cpulist: *mut libc::c_char,
    pub bgsave_cpulist: *mut libc::c_char,
    pub sentinel_config: *mut sentinelConfig,
    pub failover_end_time: mstime_t,
    pub force_failover: libc::c_int,
    pub target_replica_host: *mut libc::c_char,
    pub target_replica_port: libc::c_int,
    pub failover_state: libc::c_int,
    pub cluster_allow_pubsubshard_when_down: libc::c_int,
    pub reply_buffer_peak_reset_time: libc::c_long,
    pub reply_buffer_resizing_enabled: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_6 {
    pub last_sample_time: libc::c_longlong,
    pub last_sample_count: libc::c_longlong,
    pub samples: [libc::c_longlong; 16],
    pub idx: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct setTypeIterator {
    pub subject: *mut robj,
    pub encoding: libc::c_int,
    pub ii: libc::c_int,
    pub di: *mut dictIterator,
}
#[inline]
unsafe extern "C" fn sdslen(s: sds) -> size_t {
    let mut flags: libc::c_uchar = *s.offset(-(1 as libc::c_int) as isize)
        as libc::c_uchar;
    match flags as libc::c_int & 7 as libc::c_int {
        0 => return (flags as libc::c_int >> 3 as libc::c_int) as size_t,
        1 => {
            return (*(s
                .offset(-(core::mem::size_of::<sdshdr8>() as libc::c_ulong as isize))
                as *mut sdshdr8))
                .len as size_t;
        }
        2 => {
            return (*(s
                .offset(-(core::mem::size_of::<sdshdr16>() as libc::c_ulong as isize))
                as *mut sdshdr16))
                .len as size_t;
        }
        3 => {
            return (*(s
                .offset(-(core::mem::size_of::<sdshdr32>() as libc::c_ulong as isize))
                as *mut sdshdr32))
                .len as size_t;
        }
        4 => {
            return (*(s
                .offset(-(core::mem::size_of::<sdshdr64>() as libc::c_ulong as isize))
                as *mut sdshdr64))
                .len;
        }
        _ => {}
    }
    return 0 as libc::c_int as size_t;
}
#[no_mangle]
pub unsafe extern "C" fn setTypeCreate(mut value: sds) -> *mut robj {
    if isSdsRepresentableAsLongLong(value, 0 as *mut libc::c_longlong)
        == 0 as libc::c_int
    {
        return createIntsetObject();
    }
    return createSetObject();
}
#[no_mangle]
pub unsafe extern "C" fn setTypeAdd(
    mut subject: *mut robj,
    mut value: sds,
) -> libc::c_int {
    let mut llval: libc::c_longlong = 0;
    if (*subject).encoding() as libc::c_int == 2 as libc::c_int {
        let mut ht: *mut dict = (*subject).ptr as *mut dict;
        let mut de: *mut dictEntry = dictAddRaw(
            ht,
            value as *mut libc::c_void,
            0 as *mut *mut dictEntry,
        );
        if !de.is_null() {
            if ((*(*ht).type_0).keyDup).is_some() {
                (*de)
                    .key = ((*(*ht).type_0).keyDup)
                    .expect(
                        "non-null function pointer",
                    )(ht, sdsdup(value) as *const libc::c_void);
            } else {
                (*de).key = sdsdup(value) as *mut libc::c_void;
            }
            if ((*(*ht).type_0).valDup).is_some() {
                (*de)
                    .v
                    .val = ((*(*ht).type_0).valDup)
                    .expect("non-null function pointer")(ht, 0 as *const libc::c_void);
            } else {
                (*de).v.val = 0 as *mut libc::c_void;
            }
            return 1 as libc::c_int;
        }
    } else if (*subject).encoding() as libc::c_int == 6 as libc::c_int {
        if isSdsRepresentableAsLongLong(value, &mut llval) == 0 as libc::c_int {
            let mut success: uint8_t = 0 as libc::c_int as uint8_t;
            (*subject)
                .ptr = intsetAdd(
                (*subject).ptr as *mut intset,
                llval as int64_t,
                &mut success,
            ) as *mut libc::c_void;
            if success != 0 {
                let mut max_entries: size_t = server.set_max_intset_entries;
                if max_entries
                    >= ((1 as libc::c_int) << 30 as libc::c_int) as libc::c_ulong
                {
                    max_entries = ((1 as libc::c_int) << 30 as libc::c_int) as size_t;
                }
                if intsetLen((*subject).ptr as *const intset) as libc::c_ulong
                    > max_entries
                {
                    setTypeConvert(subject, 2 as libc::c_int);
                }
                return 1 as libc::c_int;
            }
        } else {
            setTypeConvert(subject, 2 as libc::c_int);
            if dictAdd(
                (*subject).ptr as *mut dict,
                sdsdup(value) as *mut libc::c_void,
                0 as *mut libc::c_void,
            ) == 0 as libc::c_int
            {} else {
                _serverAssert(
                    b"dictAdd(subject->ptr,sdsdup(value),NULL) == DICT_OK\0" as *const u8
                        as *const libc::c_char,
                    b"t_set.c\0" as *const u8 as *const libc::c_char,
                    82 as libc::c_int,
                );
                unreachable!();
            };
            return 1 as libc::c_int;
        }
    } else {
        _serverPanic(
            b"t_set.c\0" as *const u8 as *const libc::c_char,
            86 as libc::c_int,
            b"Unknown set encoding\0" as *const u8 as *const libc::c_char,
        );
        unreachable!();
    }
    return 0 as libc::c_int;
}
#[no_mangle]
pub unsafe extern "C" fn setTypeRemove(
    mut setobj: *mut robj,
    mut value: sds,
) -> libc::c_int {
    let mut llval: libc::c_longlong = 0;
    if (*setobj).encoding() as libc::c_int == 2 as libc::c_int {
        if dictDelete((*setobj).ptr as *mut dict, value as *const libc::c_void)
            == 0 as libc::c_int
        {
            if htNeedsResize((*setobj).ptr as *mut dict) != 0 {
                dictResize((*setobj).ptr as *mut dict);
            }
            return 1 as libc::c_int;
        }
    } else if (*setobj).encoding() as libc::c_int == 6 as libc::c_int {
        if isSdsRepresentableAsLongLong(value, &mut llval) == 0 as libc::c_int {
            let mut success: libc::c_int = 0;
            (*setobj)
                .ptr = intsetRemove(
                (*setobj).ptr as *mut intset,
                llval as int64_t,
                &mut success,
            ) as *mut libc::c_void;
            if success != 0 {
                return 1 as libc::c_int;
            }
        }
    } else {
        _serverPanic(
            b"t_set.c\0" as *const u8 as *const libc::c_char,
            105 as libc::c_int,
            b"Unknown set encoding\0" as *const u8 as *const libc::c_char,
        );
        unreachable!();
    }
    return 0 as libc::c_int;
}
#[no_mangle]
pub unsafe extern "C" fn setTypeIsMember(
    mut subject: *mut robj,
    mut value: sds,
) -> libc::c_int {
    let mut llval: libc::c_longlong = 0;
    if (*subject).encoding() as libc::c_int == 2 as libc::c_int {
        return (dictFind((*subject).ptr as *mut dict, value as *const libc::c_void)
            != 0 as *mut libc::c_void as *mut dictEntry) as libc::c_int
    } else {
        if (*subject).encoding() as libc::c_int == 6 as libc::c_int {
            if isSdsRepresentableAsLongLong(value, &mut llval) == 0 as libc::c_int {
                return intsetFind((*subject).ptr as *mut intset, llval as int64_t)
                    as libc::c_int;
            }
        } else {
            _serverPanic(
                b"t_set.c\0" as *const u8 as *const libc::c_char,
                119 as libc::c_int,
                b"Unknown set encoding\0" as *const u8 as *const libc::c_char,
            );
            unreachable!();
        }
    }
    return 0 as libc::c_int;
}
#[no_mangle]
pub unsafe extern "C" fn setTypeInitIterator(
    mut subject: *mut robj,
) -> *mut setTypeIterator {
    let mut si: *mut setTypeIterator = zmalloc(
        core::mem::size_of::<setTypeIterator>() as libc::c_ulong,
    ) as *mut setTypeIterator;
    (*si).subject = subject;
    (*si).encoding = (*subject).encoding() as libc::c_int;
    if (*si).encoding == 2 as libc::c_int {
        (*si).di = dictGetIterator((*subject).ptr as *mut dict);
    } else if (*si).encoding == 6 as libc::c_int {
        (*si).ii = 0 as libc::c_int;
    } else {
        _serverPanic(
            b"t_set.c\0" as *const u8 as *const libc::c_char,
            133 as libc::c_int,
            b"Unknown set encoding\0" as *const u8 as *const libc::c_char,
        );
        unreachable!();
    }
    return si;
}
#[no_mangle]
pub unsafe extern "C" fn setTypeReleaseIterator(mut si: *mut setTypeIterator) {
    if (*si).encoding == 2 as libc::c_int {
        dictReleaseIterator((*si).di);
    }
    zfree(si as *mut libc::c_void);
}
#[no_mangle]
pub unsafe extern "C" fn setTypeNext(
    mut si: *mut setTypeIterator,
    mut sdsele: *mut sds,
    mut llele: *mut int64_t,
) -> libc::c_int {
    if (*si).encoding == 2 as libc::c_int {
        let mut de: *mut dictEntry = dictNext((*si).di);
        if de.is_null() {
            return -(1 as libc::c_int);
        }
        *sdsele = (*de).key as sds;
        *llele = -(123456789 as libc::c_int) as int64_t;
    } else if (*si).encoding == 6 as libc::c_int {
        let fresh0 = (*si).ii;
        (*si).ii = (*si).ii + 1;
        if intsetGet((*(*si).subject).ptr as *mut intset, fresh0 as uint32_t, llele) == 0
        {
            return -(1 as libc::c_int);
        }
        *sdsele = 0 as sds;
    } else {
        _serverPanic(
            b"t_set.c\0" as *const u8 as *const libc::c_char,
            168 as libc::c_int,
            b"Wrong set encoding in setTypeNext\0" as *const u8 as *const libc::c_char,
        );
        unreachable!();
    }
    return (*si).encoding;
}
#[no_mangle]
pub unsafe extern "C" fn setTypeNextObject(mut si: *mut setTypeIterator) -> sds {
    let mut intele: int64_t = 0;
    let mut sdsele: sds = 0 as *mut libc::c_char;
    let mut encoding: libc::c_int = 0;
    encoding = setTypeNext(si, &mut sdsele, &mut intele);
    match encoding {
        -1 => return 0 as sds,
        6 => return sdsfromlonglong(intele as libc::c_longlong),
        2 => return sdsdup(sdsele),
        _ => {
            _serverPanic(
                b"t_set.c\0" as *const u8 as *const libc::c_char,
                193 as libc::c_int,
                b"Unsupported encoding\0" as *const u8 as *const libc::c_char,
            );
            unreachable!();
        }
    }
    return 0 as sds;
}
#[no_mangle]
pub unsafe extern "C" fn setTypeRandomElement(
    mut setobj: *mut robj,
    mut sdsele: *mut sds,
    mut llele: *mut int64_t,
) -> libc::c_int {
    if (*setobj).encoding() as libc::c_int == 2 as libc::c_int {
        let mut de: *mut dictEntry = dictGetFairRandomKey((*setobj).ptr as *mut dict);
        *sdsele = (*de).key as sds;
        *llele = -(123456789 as libc::c_int) as int64_t;
    } else if (*setobj).encoding() as libc::c_int == 6 as libc::c_int {
        *llele = intsetRandom((*setobj).ptr as *mut intset);
        *sdsele = 0 as sds;
    } else {
        _serverPanic(
            b"t_set.c\0" as *const u8 as *const libc::c_char,
            220 as libc::c_int,
            b"Unknown set encoding\0" as *const u8 as *const libc::c_char,
        );
        unreachable!();
    }
    return (*setobj).encoding() as libc::c_int;
}
#[no_mangle]
pub unsafe extern "C" fn setTypeSize(mut subject: *const robj) -> libc::c_ulong {
    if (*subject).encoding() as libc::c_int == 2 as libc::c_int {
        return ((*((*subject).ptr as *const dict)).ht_used[0 as libc::c_int as usize])
            .wrapping_add(
                (*((*subject).ptr as *const dict)).ht_used[1 as libc::c_int as usize],
            )
    } else {
        if (*subject).encoding() as libc::c_int == 6 as libc::c_int {
            return intsetLen((*subject).ptr as *const intset) as libc::c_ulong
        } else {
            _serverPanic(
                b"t_set.c\0" as *const u8 as *const libc::c_char,
                231 as libc::c_int,
                b"Unknown set encoding\0" as *const u8 as *const libc::c_char,
            );
            unreachable!();
        }
    }
    panic!("Reached end of non-void function without returning");
}
#[no_mangle]
pub unsafe extern "C" fn setTypeConvert(mut setobj: *mut robj, mut enc: libc::c_int) {
    let mut si: *mut setTypeIterator = 0 as *mut setTypeIterator;
    if (*setobj).type_0() as libc::c_int == 2 as libc::c_int
        && (*setobj).encoding() as libc::c_int == 6 as libc::c_int
    {} else {
        _serverAssertWithInfo(
            0 as *const client,
            setobj,
            b"setobj->type == OBJ_SET && setobj->encoding == OBJ_ENCODING_INTSET\0"
                as *const u8 as *const libc::c_char,
            b"t_set.c\0" as *const u8 as *const libc::c_char,
            241 as libc::c_int,
        );
        unreachable!();
    };
    if enc == 2 as libc::c_int {
        let mut intele: int64_t = 0;
        let mut d: *mut dict = dictCreate(&mut setDictType);
        let mut element: sds = 0 as *mut libc::c_char;
        dictExpand(d, intsetLen((*setobj).ptr as *const intset) as libc::c_ulong);
        si = setTypeInitIterator(setobj);
        while setTypeNext(si, &mut element, &mut intele) != -(1 as libc::c_int) {
            element = sdsfromlonglong(intele as libc::c_longlong);
            if dictAdd(d, element as *mut libc::c_void, 0 as *mut libc::c_void)
                == 0 as libc::c_int
            {} else {
                _serverAssert(
                    b"dictAdd(d,element,NULL) == DICT_OK\0" as *const u8
                        as *const libc::c_char,
                    b"t_set.c\0" as *const u8 as *const libc::c_char,
                    255 as libc::c_int,
                );
                unreachable!();
            };
        }
        setTypeReleaseIterator(si);
        (*setobj).set_encoding(2 as libc::c_int as libc::c_uint);
        zfree((*setobj).ptr);
        (*setobj).ptr = d as *mut libc::c_void;
    } else {
        _serverPanic(
            b"t_set.c\0" as *const u8 as *const libc::c_char,
            263 as libc::c_int,
            b"Unsupported set conversion\0" as *const u8 as *const libc::c_char,
        );
        unreachable!();
    };
}
#[no_mangle]
pub unsafe extern "C" fn setTypeDup(mut o: *mut robj) -> *mut robj {
    let mut set: *mut robj = 0 as *mut robj;
    let mut si: *mut setTypeIterator = 0 as *mut setTypeIterator;
    let mut elesds: sds = 0 as *mut libc::c_char;
    let mut intobj: int64_t = 0;
    if (*o).type_0() as libc::c_int == 2 as libc::c_int {} else {
        _serverAssert(
            b"o->type == OBJ_SET\0" as *const u8 as *const libc::c_char,
            b"t_set.c\0" as *const u8 as *const libc::c_char,
            278 as libc::c_int,
        );
        unreachable!();
    };
    if (*o).encoding() as libc::c_int == 6 as libc::c_int {
        let mut is: *mut intset = (*o).ptr as *mut intset;
        let mut size: size_t = intsetBlobLen(is);
        let mut newis: *mut intset = zmalloc(size) as *mut intset;
        memcpy(newis as *mut libc::c_void, is as *const libc::c_void, size);
        set = createObject(2 as libc::c_int, newis as *mut libc::c_void);
        (*set).set_encoding(6 as libc::c_int as libc::c_uint);
    } else if (*o).encoding() as libc::c_int == 2 as libc::c_int {
        set = createSetObject();
        let mut d: *mut dict = (*o).ptr as *mut dict;
        dictExpand(
            (*set).ptr as *mut dict,
            ((*d).ht_used[0 as libc::c_int as usize])
                .wrapping_add((*d).ht_used[1 as libc::c_int as usize]),
        );
        si = setTypeInitIterator(o);
        while setTypeNext(si, &mut elesds, &mut intobj) != -(1 as libc::c_int) {
            setTypeAdd(set, elesds);
        }
        setTypeReleaseIterator(si);
    } else {
        _serverPanic(
            b"t_set.c\0" as *const u8 as *const libc::c_char,
            298 as libc::c_int,
            b"Unknown set encoding\0" as *const u8 as *const libc::c_char,
        );
        unreachable!();
    }
    return set;
}
#[no_mangle]
pub unsafe extern "C" fn saddCommand(mut c: *mut client) {
    let mut set: *mut robj = 0 as *mut robj;
    let mut j: libc::c_int = 0;
    let mut added: libc::c_int = 0 as libc::c_int;
    set = lookupKeyWrite((*c).db, *((*c).argv).offset(1 as libc::c_int as isize));
    if checkType(c, set, 2 as libc::c_int) != 0 {
        return;
    }
    if set.is_null() {
        set = setTypeCreate(
            (**((*c).argv).offset(2 as libc::c_int as isize)).ptr as sds,
        );
        dbAdd((*c).db, *((*c).argv).offset(1 as libc::c_int as isize), set);
    }
    j = 2 as libc::c_int;
    while j < (*c).argc {
        if setTypeAdd(set, (**((*c).argv).offset(j as isize)).ptr as sds) != 0 {
            added += 1;
        }
        j += 1;
    }
    if added != 0 {
        signalModifiedKey(c, (*c).db, *((*c).argv).offset(1 as libc::c_int as isize));
        notifyKeyspaceEvent(
            (1 as libc::c_int) << 5 as libc::c_int,
            b"sadd\0" as *const u8 as *const libc::c_char as *mut libc::c_char,
            *((*c).argv).offset(1 as libc::c_int as isize),
            (*(*c).db).id,
        );
    }
    server.dirty += added as libc::c_longlong;
    addReplyLongLong(c, added as libc::c_longlong);
}
#[no_mangle]
pub unsafe extern "C" fn sremCommand(mut c: *mut client) {
    let mut set: *mut robj = 0 as *mut robj;
    let mut j: libc::c_int = 0;
    let mut deleted: libc::c_int = 0 as libc::c_int;
    let mut keyremoved: libc::c_int = 0 as libc::c_int;
    set = lookupKeyWriteOrReply(
        c,
        *((*c).argv).offset(1 as libc::c_int as isize),
        shared.czero,
    );
    if set.is_null() || checkType(c, set, 2 as libc::c_int) != 0 {
        return;
    }
    j = 2 as libc::c_int;
    while j < (*c).argc {
        if setTypeRemove(set, (**((*c).argv).offset(j as isize)).ptr as sds) != 0 {
            deleted += 1;
            if setTypeSize(set) == 0 as libc::c_int as libc::c_ulong {
                dbDelete((*c).db, *((*c).argv).offset(1 as libc::c_int as isize));
                keyremoved = 1 as libc::c_int;
                break;
            }
        }
        j += 1;
    }
    if deleted != 0 {
        signalModifiedKey(c, (*c).db, *((*c).argv).offset(1 as libc::c_int as isize));
        notifyKeyspaceEvent(
            (1 as libc::c_int) << 5 as libc::c_int,
            b"srem\0" as *const u8 as *const libc::c_char as *mut libc::c_char,
            *((*c).argv).offset(1 as libc::c_int as isize),
            (*(*c).db).id,
        );
        if keyremoved != 0 {
            notifyKeyspaceEvent(
                (1 as libc::c_int) << 2 as libc::c_int,
                b"del\0" as *const u8 as *const libc::c_char as *mut libc::c_char,
                *((*c).argv).offset(1 as libc::c_int as isize),
                (*(*c).db).id,
            );
        }
        server.dirty += deleted as libc::c_longlong;
    }
    addReplyLongLong(c, deleted as libc::c_longlong);
}
#[no_mangle]
pub unsafe extern "C" fn smoveCommand(mut c: *mut client) {
    let mut srcset: *mut robj = 0 as *mut robj;
    let mut dstset: *mut robj = 0 as *mut robj;
    let mut ele: *mut robj = 0 as *mut robj;
    srcset = lookupKeyWrite((*c).db, *((*c).argv).offset(1 as libc::c_int as isize));
    dstset = lookupKeyWrite((*c).db, *((*c).argv).offset(2 as libc::c_int as isize));
    ele = *((*c).argv).offset(3 as libc::c_int as isize);
    if srcset.is_null() {
        addReply(c, shared.czero);
        return;
    }
    if checkType(c, srcset, 2 as libc::c_int) != 0
        || checkType(c, dstset, 2 as libc::c_int) != 0
    {
        return;
    }
    if srcset == dstset {
        addReply(
            c,
            if setTypeIsMember(srcset, (*ele).ptr as sds) != 0 {
                shared.cone
            } else {
                shared.czero
            },
        );
        return;
    }
    if setTypeRemove(srcset, (*ele).ptr as sds) == 0 {
        addReply(c, shared.czero);
        return;
    }
    notifyKeyspaceEvent(
        (1 as libc::c_int) << 5 as libc::c_int,
        b"srem\0" as *const u8 as *const libc::c_char as *mut libc::c_char,
        *((*c).argv).offset(1 as libc::c_int as isize),
        (*(*c).db).id,
    );
    if setTypeSize(srcset) == 0 as libc::c_int as libc::c_ulong {
        dbDelete((*c).db, *((*c).argv).offset(1 as libc::c_int as isize));
        notifyKeyspaceEvent(
            (1 as libc::c_int) << 2 as libc::c_int,
            b"del\0" as *const u8 as *const libc::c_char as *mut libc::c_char,
            *((*c).argv).offset(1 as libc::c_int as isize),
            (*(*c).db).id,
        );
    }
    if dstset.is_null() {
        dstset = setTypeCreate((*ele).ptr as sds);
        dbAdd((*c).db, *((*c).argv).offset(2 as libc::c_int as isize), dstset);
    }
    signalModifiedKey(c, (*c).db, *((*c).argv).offset(1 as libc::c_int as isize));
    server.dirty += 1;
    if setTypeAdd(dstset, (*ele).ptr as sds) != 0 {
        server.dirty += 1;
        signalModifiedKey(c, (*c).db, *((*c).argv).offset(2 as libc::c_int as isize));
        notifyKeyspaceEvent(
            (1 as libc::c_int) << 5 as libc::c_int,
            b"sadd\0" as *const u8 as *const libc::c_char as *mut libc::c_char,
            *((*c).argv).offset(2 as libc::c_int as isize),
            (*(*c).db).id,
        );
    }
    addReply(c, shared.cone);
}
#[no_mangle]
pub unsafe extern "C" fn sismemberCommand(mut c: *mut client) {
    let mut set: *mut robj = 0 as *mut robj;
    set = lookupKeyReadOrReply(
        c,
        *((*c).argv).offset(1 as libc::c_int as isize),
        shared.czero,
    );
    if set.is_null() || checkType(c, set, 2 as libc::c_int) != 0 {
        return;
    }
    if setTypeIsMember(set, (**((*c).argv).offset(2 as libc::c_int as isize)).ptr as sds)
        != 0
    {
        addReply(c, shared.cone);
    } else {
        addReply(c, shared.czero);
    };
}
#[no_mangle]
pub unsafe extern "C" fn smismemberCommand(mut c: *mut client) {
    let mut set: *mut robj = 0 as *mut robj;
    let mut j: libc::c_int = 0;
    set = lookupKeyRead((*c).db, *((*c).argv).offset(1 as libc::c_int as isize));
    if !set.is_null() && checkType(c, set, 2 as libc::c_int) != 0 {
        return;
    }
    addReplyArrayLen(c, ((*c).argc - 2 as libc::c_int) as libc::c_long);
    j = 2 as libc::c_int;
    while j < (*c).argc {
        if !set.is_null()
            && setTypeIsMember(set, (**((*c).argv).offset(j as isize)).ptr as sds) != 0
        {
            addReply(c, shared.cone);
        } else {
            addReply(c, shared.czero);
        }
        j += 1;
    }
}
#[no_mangle]
pub unsafe extern "C" fn scardCommand(mut c: *mut client) {
    let mut o: *mut robj = 0 as *mut robj;
    o = lookupKeyReadOrReply(
        c,
        *((*c).argv).offset(1 as libc::c_int as isize),
        shared.czero,
    );
    if o.is_null() || checkType(c, o, 2 as libc::c_int) != 0 {
        return;
    }
    addReplyLongLong(c, setTypeSize(o) as libc::c_longlong);
}
#[no_mangle]
pub unsafe extern "C" fn spopWithCountCommand(mut c: *mut client) {
    let mut l: libc::c_long = 0;
    let mut count: libc::c_ulong = 0;
    let mut size: libc::c_ulong = 0;
    let mut set: *mut robj = 0 as *mut robj;
    if getPositiveLongFromObjectOrReply(
        c,
        *((*c).argv).offset(2 as libc::c_int as isize),
        &mut l,
        0 as *const libc::c_char,
    ) != 0 as libc::c_int
    {
        return;
    }
    count = l as libc::c_ulong;
    set = lookupKeyWriteOrReply(
        c,
        *((*c).argv).offset(1 as libc::c_int as isize),
        shared.emptyset[(*c).resp as usize],
    );
    if set.is_null() || checkType(c, set, 2 as libc::c_int) != 0 {
        return;
    }
    if count == 0 as libc::c_int as libc::c_ulong {
        addReply(c, shared.emptyset[(*c).resp as usize]);
        return;
    }
    size = setTypeSize(set);
    notifyKeyspaceEvent(
        (1 as libc::c_int) << 5 as libc::c_int,
        b"spop\0" as *const u8 as *const libc::c_char as *mut libc::c_char,
        *((*c).argv).offset(1 as libc::c_int as isize),
        (*(*c).db).id,
    );
    server
        .dirty = (server.dirty as libc::c_ulonglong)
        .wrapping_add((if count >= size { size } else { count }) as libc::c_ulonglong)
        as libc::c_longlong as libc::c_longlong;
    if count >= size {
        sunionDiffGenericCommand(
            c,
            ((*c).argv).offset(1 as libc::c_int as isize),
            1 as libc::c_int,
            0 as *mut robj,
            0 as libc::c_int,
        );
        dbDelete((*c).db, *((*c).argv).offset(1 as libc::c_int as isize));
        notifyKeyspaceEvent(
            (1 as libc::c_int) << 2 as libc::c_int,
            b"del\0" as *const u8 as *const libc::c_char as *mut libc::c_char,
            *((*c).argv).offset(1 as libc::c_int as isize),
            (*(*c).db).id,
        );
        rewriteClientCommandVector(
            c,
            2 as libc::c_int,
            shared.del,
            *((*c).argv).offset(1 as libc::c_int as isize),
        );
        signalModifiedKey(c, (*c).db, *((*c).argv).offset(1 as libc::c_int as isize));
        return;
    }
    let mut propargv: [*mut robj; 3] = [0 as *mut robj; 3];
    propargv[0 as libc::c_int as usize] = shared.srem;
    propargv[1 as libc::c_int as usize] = *((*c).argv).offset(1 as libc::c_int as isize);
    addReplySetLen(c, count as libc::c_long);
    let mut sdsele: sds = 0 as *mut libc::c_char;
    let mut objele: *mut robj = 0 as *mut robj;
    let mut encoding: libc::c_int = 0;
    let mut llele: int64_t = 0;
    let mut remaining: libc::c_ulong = size.wrapping_sub(count);
    if remaining.wrapping_mul(5 as libc::c_int as libc::c_ulong) > count {
        loop {
            let fresh1 = count;
            count = count.wrapping_sub(1);
            if !(fresh1 != 0) {
                break;
            }
            encoding = setTypeRandomElement(set, &mut sdsele, &mut llele);
            if encoding == 6 as libc::c_int {
                addReplyBulkLongLong(c, llele as libc::c_longlong);
                objele = createStringObjectFromLongLong(llele as libc::c_longlong);
                (*set)
                    .ptr = intsetRemove(
                    (*set).ptr as *mut intset,
                    llele,
                    0 as *mut libc::c_int,
                ) as *mut libc::c_void;
            } else {
                addReplyBulkCBuffer(c, sdsele as *const libc::c_void, sdslen(sdsele));
                objele = createStringObject(
                    sdsele as *const libc::c_char,
                    sdslen(sdsele),
                );
                setTypeRemove(set, sdsele);
            }
            propargv[2 as libc::c_int as usize] = objele;
            alsoPropagate(
                (*(*c).db).id,
                propargv.as_mut_ptr(),
                3 as libc::c_int,
                1 as libc::c_int | 2 as libc::c_int,
            );
            decrRefCount(objele);
        }
    } else {
        let mut newset: *mut robj = 0 as *mut robj;
        loop {
            let fresh2 = remaining;
            remaining = remaining.wrapping_sub(1);
            if !(fresh2 != 0) {
                break;
            }
            encoding = setTypeRandomElement(set, &mut sdsele, &mut llele);
            if encoding == 6 as libc::c_int {
                sdsele = sdsfromlonglong(llele as libc::c_longlong);
            } else {
                sdsele = sdsdup(sdsele);
            }
            if newset.is_null() {
                newset = setTypeCreate(sdsele);
            }
            setTypeAdd(newset, sdsele);
            setTypeRemove(set, sdsele);
            sdsfree(sdsele);
        }
        let mut si: *mut setTypeIterator = 0 as *mut setTypeIterator;
        si = setTypeInitIterator(set);
        loop {
            encoding = setTypeNext(si, &mut sdsele, &mut llele);
            if !(encoding != -(1 as libc::c_int)) {
                break;
            }
            if encoding == 6 as libc::c_int {
                addReplyBulkLongLong(c, llele as libc::c_longlong);
                objele = createStringObjectFromLongLong(llele as libc::c_longlong);
            } else {
                addReplyBulkCBuffer(c, sdsele as *const libc::c_void, sdslen(sdsele));
                objele = createStringObject(
                    sdsele as *const libc::c_char,
                    sdslen(sdsele),
                );
            }
            propargv[2 as libc::c_int as usize] = objele;
            alsoPropagate(
                (*(*c).db).id,
                propargv.as_mut_ptr(),
                3 as libc::c_int,
                1 as libc::c_int | 2 as libc::c_int,
            );
            decrRefCount(objele);
        }
        setTypeReleaseIterator(si);
        dbOverwrite((*c).db, *((*c).argv).offset(1 as libc::c_int as isize), newset);
    }
    preventCommandPropagation(c);
    signalModifiedKey(c, (*c).db, *((*c).argv).offset(1 as libc::c_int as isize));
}
#[no_mangle]
pub unsafe extern "C" fn spopCommand(mut c: *mut client) {
    let mut set: *mut robj = 0 as *mut robj;
    let mut ele: *mut robj = 0 as *mut robj;
    let mut sdsele: sds = 0 as *mut libc::c_char;
    let mut llele: int64_t = 0;
    let mut encoding: libc::c_int = 0;
    if (*c).argc == 3 as libc::c_int {
        spopWithCountCommand(c);
        return;
    } else {
        if (*c).argc > 3 as libc::c_int {
            addReplyErrorObject(c, shared.syntaxerr);
            return;
        }
    }
    set = lookupKeyWriteOrReply(
        c,
        *((*c).argv).offset(1 as libc::c_int as isize),
        shared.null[(*c).resp as usize],
    );
    if set.is_null() || checkType(c, set, 2 as libc::c_int) != 0 {
        return;
    }
    encoding = setTypeRandomElement(set, &mut sdsele, &mut llele);
    if encoding == 6 as libc::c_int {
        ele = createStringObjectFromLongLong(llele as libc::c_longlong);
        (*set)
            .ptr = intsetRemove((*set).ptr as *mut intset, llele, 0 as *mut libc::c_int)
            as *mut libc::c_void;
    } else {
        ele = createStringObject(sdsele as *const libc::c_char, sdslen(sdsele));
        setTypeRemove(set, (*ele).ptr as sds);
    }
    notifyKeyspaceEvent(
        (1 as libc::c_int) << 5 as libc::c_int,
        b"spop\0" as *const u8 as *const libc::c_char as *mut libc::c_char,
        *((*c).argv).offset(1 as libc::c_int as isize),
        (*(*c).db).id,
    );
    rewriteClientCommandVector(
        c,
        3 as libc::c_int,
        shared.srem,
        *((*c).argv).offset(1 as libc::c_int as isize),
        ele,
    );
    addReplyBulk(c, ele);
    decrRefCount(ele);
    if setTypeSize(set) == 0 as libc::c_int as libc::c_ulong {
        dbDelete((*c).db, *((*c).argv).offset(1 as libc::c_int as isize));
        notifyKeyspaceEvent(
            (1 as libc::c_int) << 2 as libc::c_int,
            b"del\0" as *const u8 as *const libc::c_char as *mut libc::c_char,
            *((*c).argv).offset(1 as libc::c_int as isize),
            (*(*c).db).id,
        );
    }
    signalModifiedKey(c, (*c).db, *((*c).argv).offset(1 as libc::c_int as isize));
    server.dirty += 1;
}
#[no_mangle]
pub unsafe extern "C" fn srandmemberWithCountCommand(mut c: *mut client) {
    let mut l: libc::c_long = 0;
    let mut count: libc::c_ulong = 0;
    let mut size: libc::c_ulong = 0;
    let mut uniq: libc::c_int = 1 as libc::c_int;
    let mut set: *mut robj = 0 as *mut robj;
    let mut ele: sds = 0 as *mut libc::c_char;
    let mut llele: int64_t = 0;
    let mut encoding: libc::c_int = 0;
    let mut d: *mut dict = 0 as *mut dict;
    if getLongFromObjectOrReply(
        c,
        *((*c).argv).offset(2 as libc::c_int as isize),
        &mut l,
        0 as *const libc::c_char,
    ) != 0 as libc::c_int
    {
        return;
    }
    if l >= 0 as libc::c_int as libc::c_long {
        count = l as libc::c_ulong;
    } else {
        count = -l as libc::c_ulong;
        uniq = 0 as libc::c_int;
    }
    set = lookupKeyReadOrReply(
        c,
        *((*c).argv).offset(1 as libc::c_int as isize),
        shared.emptyarray,
    );
    if set.is_null() || checkType(c, set, 2 as libc::c_int) != 0 {
        return;
    }
    size = setTypeSize(set);
    if count == 0 as libc::c_int as libc::c_ulong {
        addReply(c, shared.emptyarray);
        return;
    }
    if uniq == 0 || count == 1 as libc::c_int as libc::c_ulong {
        addReplyArrayLen(c, count as libc::c_long);
        loop {
            let fresh3 = count;
            count = count.wrapping_sub(1);
            if !(fresh3 != 0) {
                break;
            }
            encoding = setTypeRandomElement(set, &mut ele, &mut llele);
            if encoding == 6 as libc::c_int {
                addReplyBulkLongLong(c, llele as libc::c_longlong);
            } else {
                addReplyBulkCBuffer(c, ele as *const libc::c_void, sdslen(ele));
            }
            if (*c).flags & ((1 as libc::c_int) << 10 as libc::c_int) as libc::c_ulong
                != 0
            {
                break;
            }
        }
        return;
    }
    if count >= size {
        let mut si: *mut setTypeIterator = 0 as *mut setTypeIterator;
        addReplyArrayLen(c, size as libc::c_long);
        si = setTypeInitIterator(set);
        loop {
            encoding = setTypeNext(si, &mut ele, &mut llele);
            if !(encoding != -(1 as libc::c_int)) {
                break;
            }
            if encoding == 6 as libc::c_int {
                addReplyBulkLongLong(c, llele as libc::c_longlong);
            } else {
                addReplyBulkCBuffer(c, ele as *const libc::c_void, sdslen(ele));
            }
            size = size.wrapping_sub(1);
        }
        setTypeReleaseIterator(si);
        if size == 0 as libc::c_int as libc::c_ulong {} else {
            _serverAssert(
                b"size==0\0" as *const u8 as *const libc::c_char,
                b"t_set.c\0" as *const u8 as *const libc::c_char,
                724 as libc::c_int,
            );
            unreachable!();
        };
        return;
    }
    d = dictCreate(&mut sdsReplyDictType);
    if count.wrapping_mul(3 as libc::c_int as libc::c_ulong) > size {
        let mut si_0: *mut setTypeIterator = 0 as *mut setTypeIterator;
        si_0 = setTypeInitIterator(set);
        dictExpand(d, size);
        loop {
            encoding = setTypeNext(si_0, &mut ele, &mut llele);
            if !(encoding != -(1 as libc::c_int)) {
                break;
            }
            let mut retval: libc::c_int = 1 as libc::c_int;
            if encoding == 6 as libc::c_int {
                retval = dictAdd(
                    d,
                    sdsfromlonglong(llele as libc::c_longlong) as *mut libc::c_void,
                    0 as *mut libc::c_void,
                );
            } else {
                retval = dictAdd(
                    d,
                    sdsdup(ele) as *mut libc::c_void,
                    0 as *mut libc::c_void,
                );
            }
            if retval == 0 as libc::c_int {} else {
                _serverAssert(
                    b"retval == DICT_OK\0" as *const u8 as *const libc::c_char,
                    b"t_set.c\0" as *const u8 as *const libc::c_char,
                    754 as libc::c_int,
                );
                unreachable!();
            };
        }
        setTypeReleaseIterator(si_0);
        if ((*d).ht_used[0 as libc::c_int as usize])
            .wrapping_add((*d).ht_used[1 as libc::c_int as usize]) == size
        {} else {
            _serverAssert(
                b"dictSize(d) == size\0" as *const u8 as *const libc::c_char,
                b"t_set.c\0" as *const u8 as *const libc::c_char,
                757 as libc::c_int,
            );
            unreachable!();
        };
        while size > count {
            let mut de: *mut dictEntry = 0 as *mut dictEntry;
            de = dictGetFairRandomKey(d);
            dictUnlink(d, (*de).key);
            sdsfree((*de).key as sds);
            dictFreeUnlinkedEntry(d, de);
            size = size.wrapping_sub(1);
        }
    } else {
        let mut added: libc::c_ulong = 0 as libc::c_int as libc::c_ulong;
        let mut sdsele: sds = 0 as *mut libc::c_char;
        dictExpand(d, count);
        while added < count {
            encoding = setTypeRandomElement(set, &mut ele, &mut llele);
            if encoding == 6 as libc::c_int {
                sdsele = sdsfromlonglong(llele as libc::c_longlong);
            } else {
                sdsele = sdsdup(ele);
            }
            if dictAdd(d, sdsele as *mut libc::c_void, 0 as *mut libc::c_void)
                == 0 as libc::c_int
            {
                added = added.wrapping_add(1);
            } else {
                sdsfree(sdsele);
            }
        }
    }
    let mut di: *mut dictIterator = 0 as *mut dictIterator;
    let mut de_0: *mut dictEntry = 0 as *mut dictEntry;
    addReplyArrayLen(c, count as libc::c_long);
    di = dictGetIterator(d);
    loop {
        de_0 = dictNext(di);
        if de_0.is_null() {
            break;
        }
        addReplyBulkSds(c, (*de_0).key as sds);
    }
    dictReleaseIterator(di);
    dictRelease(d);
}
#[no_mangle]
pub unsafe extern "C" fn srandmemberCommand(mut c: *mut client) {
    let mut set: *mut robj = 0 as *mut robj;
    let mut ele: sds = 0 as *mut libc::c_char;
    let mut llele: int64_t = 0;
    let mut encoding: libc::c_int = 0;
    if (*c).argc == 3 as libc::c_int {
        srandmemberWithCountCommand(c);
        return;
    } else {
        if (*c).argc > 3 as libc::c_int {
            addReplyErrorObject(c, shared.syntaxerr);
            return;
        }
    }
    set = lookupKeyReadOrReply(
        c,
        *((*c).argv).offset(1 as libc::c_int as isize),
        shared.null[(*c).resp as usize],
    );
    if set.is_null() || checkType(c, set, 2 as libc::c_int) != 0 {
        return;
    }
    encoding = setTypeRandomElement(set, &mut ele, &mut llele);
    if encoding == 6 as libc::c_int {
        addReplyBulkLongLong(c, llele as libc::c_longlong);
    } else {
        addReplyBulkCBuffer(c, ele as *const libc::c_void, sdslen(ele));
    };
}
#[no_mangle]
pub unsafe extern "C" fn qsortCompareSetsByCardinality(
    mut s1: *const libc::c_void,
    mut s2: *const libc::c_void,
) -> libc::c_int {
    if setTypeSize(*(s1 as *mut *mut robj)) > setTypeSize(*(s2 as *mut *mut robj)) {
        return 1 as libc::c_int;
    }
    if setTypeSize(*(s1 as *mut *mut robj)) < setTypeSize(*(s2 as *mut *mut robj)) {
        return -(1 as libc::c_int);
    }
    return 0 as libc::c_int;
}
#[no_mangle]
pub unsafe extern "C" fn qsortCompareSetsByRevCardinality(
    mut s1: *const libc::c_void,
    mut s2: *const libc::c_void,
) -> libc::c_int {
    let mut o1: *mut robj = *(s1 as *mut *mut robj);
    let mut o2: *mut robj = *(s2 as *mut *mut robj);
    let mut first: libc::c_ulong = if !o1.is_null() {
        setTypeSize(o1)
    } else {
        0 as libc::c_int as libc::c_ulong
    };
    let mut second: libc::c_ulong = if !o2.is_null() {
        setTypeSize(o2)
    } else {
        0 as libc::c_int as libc::c_ulong
    };
    if first < second {
        return 1 as libc::c_int;
    }
    if first > second {
        return -(1 as libc::c_int);
    }
    return 0 as libc::c_int;
}
#[no_mangle]
pub unsafe extern "C" fn sinterGenericCommand(
    mut c: *mut client,
    mut setkeys: *mut *mut robj,
    mut setnum: libc::c_ulong,
    mut dstkey: *mut robj,
    mut cardinality_only: libc::c_int,
    mut limit: libc::c_ulong,
) {
    let mut sets: *mut *mut robj = zmalloc(
        (core::mem::size_of::<*mut robj>() as libc::c_ulong).wrapping_mul(setnum),
    ) as *mut *mut robj;
    let mut si: *mut setTypeIterator = 0 as *mut setTypeIterator;
    let mut dstset: *mut robj = 0 as *mut robj;
    let mut elesds: sds = 0 as *mut libc::c_char;
    let mut intobj: int64_t = 0;
    let mut replylen: *mut libc::c_void = 0 as *mut libc::c_void;
    let mut j: libc::c_ulong = 0;
    let mut cardinality: libc::c_ulong = 0 as libc::c_int as libc::c_ulong;
    let mut encoding: libc::c_int = 0;
    let mut empty: libc::c_int = 0 as libc::c_int;
    j = 0 as libc::c_int as libc::c_ulong;
    while j < setnum {
        let mut setobj: *mut robj = lookupKeyRead((*c).db, *setkeys.offset(j as isize));
        if setobj.is_null() {
            empty += 1 as libc::c_int;
            let ref mut fresh4 = *sets.offset(j as isize);
            *fresh4 = 0 as *mut robj;
        } else {
            if checkType(c, setobj, 2 as libc::c_int) != 0 {
                zfree(sets as *mut libc::c_void);
                return;
            }
            let ref mut fresh5 = *sets.offset(j as isize);
            *fresh5 = setobj;
        }
        j = j.wrapping_add(1);
    }
    if empty > 0 as libc::c_int {
        zfree(sets as *mut libc::c_void);
        if !dstkey.is_null() {
            if dbDelete((*c).db, dstkey) != 0 {
                signalModifiedKey(c, (*c).db, dstkey);
                notifyKeyspaceEvent(
                    (1 as libc::c_int) << 2 as libc::c_int,
                    b"del\0" as *const u8 as *const libc::c_char as *mut libc::c_char,
                    dstkey,
                    (*(*c).db).id,
                );
                server.dirty += 1;
            }
            addReply(c, shared.czero);
        } else if cardinality_only != 0 {
            addReplyLongLong(c, cardinality as libc::c_longlong);
        } else {
            addReply(c, shared.emptyset[(*c).resp as usize]);
        }
        return;
    }
    qsort(
        sets as *mut libc::c_void,
        setnum,
        core::mem::size_of::<*mut robj>() as libc::c_ulong,
        Some(
            qsortCompareSetsByCardinality
                as unsafe extern "C" fn(
                    *const libc::c_void,
                    *const libc::c_void,
                ) -> libc::c_int,
        ),
    );
    if !dstkey.is_null() {
        dstset = createIntsetObject();
    } else if cardinality_only == 0 {
        replylen = addReplyDeferredLen(c);
    }
    si = setTypeInitIterator(*sets.offset(0 as libc::c_int as isize));
    loop {
        encoding = setTypeNext(si, &mut elesds, &mut intobj);
        if !(encoding != -(1 as libc::c_int)) {
            break;
        }
        j = 1 as libc::c_int as libc::c_ulong;
        while j < setnum {
            if !(*sets.offset(j as isize) == *sets.offset(0 as libc::c_int as isize)) {
                if encoding == 6 as libc::c_int {
                    if (**sets.offset(j as isize)).encoding() as libc::c_int
                        == 6 as libc::c_int
                        && intsetFind(
                            (**sets.offset(j as isize)).ptr as *mut intset,
                            intobj,
                        ) == 0
                    {
                        break;
                    }
                    if (**sets.offset(j as isize)).encoding() as libc::c_int
                        == 2 as libc::c_int
                    {
                        elesds = sdsfromlonglong(intobj as libc::c_longlong);
                        if setTypeIsMember(*sets.offset(j as isize), elesds) == 0 {
                            sdsfree(elesds);
                            break;
                        } else {
                            sdsfree(elesds);
                        }
                    }
                } else if encoding == 2 as libc::c_int {
                    if setTypeIsMember(*sets.offset(j as isize), elesds) == 0 {
                        break;
                    }
                }
            }
            j = j.wrapping_add(1);
        }
        if !(j == setnum) {
            continue;
        }
        if cardinality_only != 0 {
            cardinality = cardinality.wrapping_add(1);
            if limit != 0 && cardinality >= limit {
                break;
            }
        } else if dstkey.is_null() {
            if encoding == 2 as libc::c_int {
                addReplyBulkCBuffer(c, elesds as *const libc::c_void, sdslen(elesds));
            } else {
                addReplyBulkLongLong(c, intobj as libc::c_longlong);
            }
            cardinality = cardinality.wrapping_add(1);
        } else if encoding == 6 as libc::c_int {
            elesds = sdsfromlonglong(intobj as libc::c_longlong);
            setTypeAdd(dstset, elesds);
            sdsfree(elesds);
        } else {
            setTypeAdd(dstset, elesds);
        }
    }
    setTypeReleaseIterator(si);
    if cardinality_only != 0 {
        addReplyLongLong(c, cardinality as libc::c_longlong);
    } else if !dstkey.is_null() {
        if setTypeSize(dstset) > 0 as libc::c_int as libc::c_ulong {
            setKey(c, (*c).db, dstkey, dstset, 0 as libc::c_int);
            addReplyLongLong(c, setTypeSize(dstset) as libc::c_longlong);
            notifyKeyspaceEvent(
                (1 as libc::c_int) << 5 as libc::c_int,
                b"sinterstore\0" as *const u8 as *const libc::c_char
                    as *mut libc::c_char,
                dstkey,
                (*(*c).db).id,
            );
            server.dirty += 1;
        } else {
            addReply(c, shared.czero);
            if dbDelete((*c).db, dstkey) != 0 {
                server.dirty += 1;
                signalModifiedKey(c, (*c).db, dstkey);
                notifyKeyspaceEvent(
                    (1 as libc::c_int) << 2 as libc::c_int,
                    b"del\0" as *const u8 as *const libc::c_char as *mut libc::c_char,
                    dstkey,
                    (*(*c).db).id,
                );
            }
        }
        decrRefCount(dstset);
    } else {
        setDeferredSetLen(c, replylen, cardinality as libc::c_long);
    }
    zfree(sets as *mut libc::c_void);
}
#[no_mangle]
pub unsafe extern "C" fn sinterCommand(mut c: *mut client) {
    sinterGenericCommand(
        c,
        ((*c).argv).offset(1 as libc::c_int as isize),
        ((*c).argc - 1 as libc::c_int) as libc::c_ulong,
        0 as *mut robj,
        0 as libc::c_int,
        0 as libc::c_int as libc::c_ulong,
    );
}
#[no_mangle]
pub unsafe extern "C" fn sinterCardCommand(mut c: *mut client) {
    let mut j: libc::c_long = 0;
    let mut numkeys: libc::c_long = 0 as libc::c_int as libc::c_long;
    let mut limit: libc::c_long = 0 as libc::c_int as libc::c_long;
    if getRangeLongFromObjectOrReply(
        c,
        *((*c).argv).offset(1 as libc::c_int as isize),
        1 as libc::c_int as libc::c_long,
        9223372036854775807 as libc::c_long,
        &mut numkeys,
        b"numkeys should be greater than 0\0" as *const u8 as *const libc::c_char,
    ) != 0 as libc::c_int
    {
        return;
    }
    if numkeys > ((*c).argc - 2 as libc::c_int) as libc::c_long {
        addReplyError(
            c,
            b"Number of keys can't be greater than number of args\0" as *const u8
                as *const libc::c_char,
        );
        return;
    }
    j = 2 as libc::c_int as libc::c_long + numkeys;
    while j < (*c).argc as libc::c_long {
        let mut opt: *mut libc::c_char = (**((*c).argv).offset(j as isize)).ptr
            as *mut libc::c_char;
        let mut moreargs: libc::c_int = (((*c).argc - 1 as libc::c_int) as libc::c_long
            - j) as libc::c_int;
        if strcasecmp(opt, b"LIMIT\0" as *const u8 as *const libc::c_char) == 0
            && moreargs != 0
        {
            j += 1;
            if getPositiveLongFromObjectOrReply(
                c,
                *((*c).argv).offset(j as isize),
                &mut limit,
                b"LIMIT can't be negative\0" as *const u8 as *const libc::c_char,
            ) != 0 as libc::c_int
            {
                return;
            }
        } else {
            addReplyErrorObject(c, shared.syntaxerr);
            return;
        }
        j += 1;
    }
    sinterGenericCommand(
        c,
        ((*c).argv).offset(2 as libc::c_int as isize),
        numkeys as libc::c_ulong,
        0 as *mut robj,
        1 as libc::c_int,
        limit as libc::c_ulong,
    );
}
#[no_mangle]
pub unsafe extern "C" fn sinterstoreCommand(mut c: *mut client) {
    sinterGenericCommand(
        c,
        ((*c).argv).offset(2 as libc::c_int as isize),
        ((*c).argc - 2 as libc::c_int) as libc::c_ulong,
        *((*c).argv).offset(1 as libc::c_int as isize),
        0 as libc::c_int,
        0 as libc::c_int as libc::c_ulong,
    );
}
#[no_mangle]
pub unsafe extern "C" fn sunionDiffGenericCommand(
    mut c: *mut client,
    mut setkeys: *mut *mut robj,
    mut setnum: libc::c_int,
    mut dstkey: *mut robj,
    mut op: libc::c_int,
) {
    let mut sets: *mut *mut robj = zmalloc(
        (core::mem::size_of::<*mut robj>() as libc::c_ulong)
            .wrapping_mul(setnum as libc::c_ulong),
    ) as *mut *mut robj;
    let mut si: *mut setTypeIterator = 0 as *mut setTypeIterator;
    let mut dstset: *mut robj = 0 as *mut robj;
    let mut ele: sds = 0 as *mut libc::c_char;
    let mut j: libc::c_int = 0;
    let mut cardinality: libc::c_int = 0 as libc::c_int;
    let mut diff_algo: libc::c_int = 1 as libc::c_int;
    let mut sameset: libc::c_int = 0 as libc::c_int;
    j = 0 as libc::c_int;
    while j < setnum {
        let mut setobj: *mut robj = lookupKeyRead((*c).db, *setkeys.offset(j as isize));
        if setobj.is_null() {
            let ref mut fresh6 = *sets.offset(j as isize);
            *fresh6 = 0 as *mut robj;
        } else {
            if checkType(c, setobj, 2 as libc::c_int) != 0 {
                zfree(sets as *mut libc::c_void);
                return;
            }
            let ref mut fresh7 = *sets.offset(j as isize);
            *fresh7 = setobj;
            if j > 0 as libc::c_int
                && *sets.offset(0 as libc::c_int as isize) == *sets.offset(j as isize)
            {
                sameset = 1 as libc::c_int;
            }
        }
        j += 1;
    }
    if op == 1 as libc::c_int && !(*sets.offset(0 as libc::c_int as isize)).is_null()
        && sameset == 0
    {
        let mut algo_one_work: libc::c_longlong = 0 as libc::c_int as libc::c_longlong;
        let mut algo_two_work: libc::c_longlong = 0 as libc::c_int as libc::c_longlong;
        j = 0 as libc::c_int;
        while j < setnum {
            if !(*sets.offset(j as isize)).is_null() {
                algo_one_work = (algo_one_work as libc::c_ulonglong)
                    .wrapping_add(
                        setTypeSize(*sets.offset(0 as libc::c_int as isize))
                            as libc::c_ulonglong,
                    ) as libc::c_longlong as libc::c_longlong;
                algo_two_work = (algo_two_work as libc::c_ulonglong)
                    .wrapping_add(
                        setTypeSize(*sets.offset(j as isize)) as libc::c_ulonglong,
                    ) as libc::c_longlong as libc::c_longlong;
            }
            j += 1;
        }
        algo_one_work /= 2 as libc::c_int as libc::c_longlong;
        diff_algo = if algo_one_work <= algo_two_work {
            1 as libc::c_int
        } else {
            2 as libc::c_int
        };
        if diff_algo == 1 as libc::c_int && setnum > 1 as libc::c_int {
            qsort(
                sets.offset(1 as libc::c_int as isize) as *mut libc::c_void,
                (setnum - 1 as libc::c_int) as size_t,
                core::mem::size_of::<*mut robj>() as libc::c_ulong,
                Some(
                    qsortCompareSetsByRevCardinality
                        as unsafe extern "C" fn(
                            *const libc::c_void,
                            *const libc::c_void,
                        ) -> libc::c_int,
                ),
            );
        }
    }
    dstset = createIntsetObject();
    if op == 0 as libc::c_int {
        j = 0 as libc::c_int;
        while j < setnum {
            if !(*sets.offset(j as isize)).is_null() {
                si = setTypeInitIterator(*sets.offset(j as isize));
                loop {
                    ele = setTypeNextObject(si);
                    if ele.is_null() {
                        break;
                    }
                    if setTypeAdd(dstset, ele) != 0 {
                        cardinality += 1;
                    }
                    sdsfree(ele);
                }
                setTypeReleaseIterator(si);
            }
            j += 1;
        }
    } else if !(op == 1 as libc::c_int && sameset != 0) {
        if op == 1 as libc::c_int && !(*sets.offset(0 as libc::c_int as isize)).is_null()
            && diff_algo == 1 as libc::c_int
        {
            si = setTypeInitIterator(*sets.offset(0 as libc::c_int as isize));
            loop {
                ele = setTypeNextObject(si);
                if ele.is_null() {
                    break;
                }
                j = 1 as libc::c_int;
                while j < setnum {
                    if !(*sets.offset(j as isize)).is_null() {
                        if *sets.offset(j as isize)
                            == *sets.offset(0 as libc::c_int as isize)
                        {
                            break;
                        }
                        if setTypeIsMember(*sets.offset(j as isize), ele) != 0 {
                            break;
                        }
                    }
                    j += 1;
                }
                if j == setnum {
                    setTypeAdd(dstset, ele);
                    cardinality += 1;
                }
                sdsfree(ele);
            }
            setTypeReleaseIterator(si);
        } else if op == 1 as libc::c_int
            && !(*sets.offset(0 as libc::c_int as isize)).is_null()
            && diff_algo == 2 as libc::c_int
        {
            j = 0 as libc::c_int;
            while j < setnum {
                if !(*sets.offset(j as isize)).is_null() {
                    si = setTypeInitIterator(*sets.offset(j as isize));
                    loop {
                        ele = setTypeNextObject(si);
                        if ele.is_null() {
                            break;
                        }
                        if j == 0 as libc::c_int {
                            if setTypeAdd(dstset, ele) != 0 {
                                cardinality += 1;
                            }
                        } else if setTypeRemove(dstset, ele) != 0 {
                            cardinality -= 1;
                        }
                        sdsfree(ele);
                    }
                    setTypeReleaseIterator(si);
                    if cardinality == 0 as libc::c_int {
                        break;
                    }
                }
                j += 1;
            }
        }
    }
    if dstkey.is_null() {
        addReplySetLen(c, cardinality as libc::c_long);
        si = setTypeInitIterator(dstset);
        loop {
            ele = setTypeNextObject(si);
            if ele.is_null() {
                break;
            }
            addReplyBulkCBuffer(c, ele as *const libc::c_void, sdslen(ele));
            sdsfree(ele);
        }
        setTypeReleaseIterator(si);
        if server.lazyfree_lazy_server_del != 0 {
            freeObjAsync(0 as *mut robj, dstset, -(1 as libc::c_int));
        } else {
            decrRefCount(dstset);
        };
    } else {
        if setTypeSize(dstset) > 0 as libc::c_int as libc::c_ulong {
            setKey(c, (*c).db, dstkey, dstset, 0 as libc::c_int);
            addReplyLongLong(c, setTypeSize(dstset) as libc::c_longlong);
            notifyKeyspaceEvent(
                (1 as libc::c_int) << 5 as libc::c_int,
                (if op == 0 as libc::c_int {
                    b"sunionstore\0" as *const u8 as *const libc::c_char
                } else {
                    b"sdiffstore\0" as *const u8 as *const libc::c_char
                }) as *mut libc::c_char,
                dstkey,
                (*(*c).db).id,
            );
            server.dirty += 1;
        } else {
            addReply(c, shared.czero);
            if dbDelete((*c).db, dstkey) != 0 {
                server.dirty += 1;
                signalModifiedKey(c, (*c).db, dstkey);
                notifyKeyspaceEvent(
                    (1 as libc::c_int) << 2 as libc::c_int,
                    b"del\0" as *const u8 as *const libc::c_char as *mut libc::c_char,
                    dstkey,
                    (*(*c).db).id,
                );
            }
        }
        decrRefCount(dstset);
    }
    zfree(sets as *mut libc::c_void);
}
#[no_mangle]
pub unsafe extern "C" fn sunionCommand(mut c: *mut client) {
    sunionDiffGenericCommand(
        c,
        ((*c).argv).offset(1 as libc::c_int as isize),
        (*c).argc - 1 as libc::c_int,
        0 as *mut robj,
        0 as libc::c_int,
    );
}
#[no_mangle]
pub unsafe extern "C" fn sunionstoreCommand(mut c: *mut client) {
    sunionDiffGenericCommand(
        c,
        ((*c).argv).offset(2 as libc::c_int as isize),
        (*c).argc - 2 as libc::c_int,
        *((*c).argv).offset(1 as libc::c_int as isize),
        0 as libc::c_int,
    );
}
#[no_mangle]
pub unsafe extern "C" fn sdiffCommand(mut c: *mut client) {
    sunionDiffGenericCommand(
        c,
        ((*c).argv).offset(1 as libc::c_int as isize),
        (*c).argc - 1 as libc::c_int,
        0 as *mut robj,
        1 as libc::c_int,
    );
}
#[no_mangle]
pub unsafe extern "C" fn sdiffstoreCommand(mut c: *mut client) {
    sunionDiffGenericCommand(
        c,
        ((*c).argv).offset(2 as libc::c_int as isize),
        (*c).argc - 2 as libc::c_int,
        *((*c).argv).offset(1 as libc::c_int as isize),
        1 as libc::c_int,
    );
}
#[no_mangle]
pub unsafe extern "C" fn sscanCommand(mut c: *mut client) {
    let mut set: *mut robj = 0 as *mut robj;
    let mut cursor: libc::c_ulong = 0;
    if parseScanCursorOrReply(
        c,
        *((*c).argv).offset(2 as libc::c_int as isize),
        &mut cursor,
    ) == -(1 as libc::c_int)
    {
        return;
    }
    set = lookupKeyReadOrReply(
        c,
        *((*c).argv).offset(1 as libc::c_int as isize),
        shared.emptyscan,
    );
    if set.is_null() || checkType(c, set, 2 as libc::c_int) != 0 {
        return;
    }
    scanGenericCommand(c, set, cursor);
}