lpn 0.2.0

Software to study attacks on the Learning Parity with Noise problem
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
use std::boxed::Box;
use std::default::Default;
use std::sync::Once;

use fnv::FnvHashMap;

use m4ri_rust::friendly::BinMatrix;
use m4ri_rust::friendly::BinVector;

use crate::codes::BinaryCode;

/// ``[24, 14]`` Guava code
///
/// Best code found from the GUAVA database version 3.15
///
/// Decodes using Syndrome decoding
#[derive(Clone, Serialize)]
pub struct GuavaCode24_14;

static INIT: Once = Once::new();
static mut GENERATOR_MATRIX: *const BinMatrix = 0 as *const BinMatrix;
static mut PARITY_MATRIX: *const BinMatrix = 0 as *const BinMatrix;
static mut PARITY_MATRIX_T: *const BinMatrix = 0 as *const BinMatrix;
static mut SYNDROME_MAP: *const FnvHashMap<u64, &'static [usize; 1]> = 0 as *const FnvHashMap<u64, &'static [usize; 1]>;

fn init() {
    INIT.call_once(|| {
        unsafe {
            let matrix = Box::new(BinMatrix::from_slices(&[
                &[ 3833857 ],
                &[ 1933314 ],
                &[ 13205508 ],
                &[ 7815176 ],
                &[ 7438352 ],
                &[ 10829856 ],
                &[ 11927616 ],
                &[ 6209664 ],
                &[ 9126144 ],
                &[ 15712768 ],
                &[ 13878272 ],
                &[ 14174208 ],
                &[ 14618624 ],
                &[ 15343616 ],
                
            ], 24));
            GENERATOR_MATRIX = Box::into_raw(matrix);

            let matrix = Box::new(BinMatrix::from_slices(&[
                &[ 14149121 ],
                &[ 1742338 ],
                &[ 2405892 ],
                &[ 6025224 ],
                &[ 11506192 ],
                &[ 12206624 ],
                &[ 12182592 ],
                &[ 4641408 ],
                &[ 7411456 ],
                &[ 14039040 ],
                
            ], 24));
            let matrix_t = Box::new(matrix.transposed());
            PARITY_MATRIX = Box::into_raw(matrix);
            PARITY_MATRIX_T = Box::into_raw(matrix_t);

            let mut map = Box::new(FnvHashMap::with_capacity_and_hasher(1024, Default::default()));
            map.insert(0, &[0]);     // 0 => [0]
            map.insert(1, &[1]);     // 1 => [1]
            map.insert(2, &[2]);     // 2 => [2]
            map.insert(4, &[4]);     // 4 => [4]
            map.insert(8, &[8]);     // 8 => [8]
            map.insert(16, &[16]);     // 16 => [16]
            map.insert(32, &[32]);     // 32 => [32]
            map.insert(64, &[64]);     // 64 => [64]
            map.insert(128, &[128]);     // 128 => [128]
            map.insert(256, &[256]);     // 256 => [256]
            map.insert(439, &[512]);     // 439 => [512]
            map.insert(327, &[1024]);     // 327 => [1024]
            map.insert(512, &[2048]);     // 512 => [2048]
            map.insert(926, &[4096]);     // 926 => [4096]
            map.insert(589, &[8192]);     // 589 => [8192]
            map.insert(233, &[16384]);     // 233 => [16384]
            map.insert(223, &[32768]);     // 223 => [32768]
            map.insert(345, &[65536]);     // 345 => [65536]
            map.insert(699, &[131072]);     // 699 => [131072]
            map.insert(661, &[262144]);     // 661 => [262144]
            map.insert(122, &[524288]);     // 122 => [524288]
            map.insert(875, &[1048576]);     // 875 => [1048576]
            map.insert(372, &[2097152]);     // 372 => [2097152]
            map.insert(905, &[4194304]);     // 905 => [4194304]
            map.insert(625, &[8388608]);     // 625 => [8388608]
            map.insert(3, &[3]);     // 3 => [3]
            map.insert(5, &[5]);     // 5 => [5]
            map.insert(9, &[9]);     // 9 => [9]
            map.insert(17, &[17]);     // 17 => [17]
            map.insert(33, &[33]);     // 33 => [33]
            map.insert(65, &[65]);     // 65 => [65]
            map.insert(129, &[129]);     // 129 => [129]
            map.insert(257, &[257]);     // 257 => [257]
            map.insert(438, &[513]);     // 438 => [513]
            map.insert(326, &[1025]);     // 326 => [1025]
            map.insert(513, &[2049]);     // 513 => [2049]
            map.insert(927, &[4097]);     // 927 => [4097]
            map.insert(588, &[8193]);     // 588 => [8193]
            map.insert(232, &[16385]);     // 232 => [16385]
            map.insert(222, &[32769]);     // 222 => [32769]
            map.insert(344, &[65537]);     // 344 => [65537]
            map.insert(698, &[131073]);     // 698 => [131073]
            map.insert(660, &[262145]);     // 660 => [262145]
            map.insert(123, &[524289]);     // 123 => [524289]
            map.insert(874, &[1048577]);     // 874 => [1048577]
            map.insert(373, &[2097153]);     // 373 => [2097153]
            map.insert(904, &[4194305]);     // 904 => [4194305]
            map.insert(624, &[8388609]);     // 624 => [8388609]
            map.insert(6, &[6]);     // 6 => [6]
            map.insert(10, &[10]);     // 10 => [10]
            map.insert(18, &[18]);     // 18 => [18]
            map.insert(34, &[34]);     // 34 => [34]
            map.insert(66, &[66]);     // 66 => [66]
            map.insert(130, &[130]);     // 130 => [130]
            map.insert(258, &[258]);     // 258 => [258]
            map.insert(437, &[514]);     // 437 => [514]
            map.insert(325, &[1026]);     // 325 => [1026]
            map.insert(514, &[2050]);     // 514 => [2050]
            map.insert(924, &[4098]);     // 924 => [4098]
            map.insert(591, &[8194]);     // 591 => [8194]
            map.insert(235, &[16386]);     // 235 => [16386]
            map.insert(221, &[32770]);     // 221 => [32770]
            map.insert(347, &[65538]);     // 347 => [65538]
            map.insert(697, &[131074]);     // 697 => [131074]
            map.insert(663, &[262146]);     // 663 => [262146]
            map.insert(120, &[524290]);     // 120 => [524290]
            map.insert(873, &[1048578]);     // 873 => [1048578]
            map.insert(374, &[2097154]);     // 374 => [2097154]
            map.insert(907, &[4194306]);     // 907 => [4194306]
            map.insert(627, &[8388610]);     // 627 => [8388610]
            map.insert(12, &[12]);     // 12 => [12]
            map.insert(20, &[20]);     // 20 => [20]
            map.insert(36, &[36]);     // 36 => [36]
            map.insert(68, &[68]);     // 68 => [68]
            map.insert(132, &[132]);     // 132 => [132]
            map.insert(260, &[260]);     // 260 => [260]
            map.insert(435, &[516]);     // 435 => [516]
            map.insert(323, &[1028]);     // 323 => [1028]
            map.insert(516, &[2052]);     // 516 => [2052]
            map.insert(922, &[4100]);     // 922 => [4100]
            map.insert(585, &[8196]);     // 585 => [8196]
            map.insert(237, &[16388]);     // 237 => [16388]
            map.insert(219, &[32772]);     // 219 => [32772]
            map.insert(349, &[65540]);     // 349 => [65540]
            map.insert(703, &[131076]);     // 703 => [131076]
            map.insert(657, &[262148]);     // 657 => [262148]
            map.insert(126, &[524292]);     // 126 => [524292]
            map.insert(879, &[1048580]);     // 879 => [1048580]
            map.insert(368, &[2097156]);     // 368 => [2097156]
            map.insert(909, &[4194308]);     // 909 => [4194308]
            map.insert(629, &[8388612]);     // 629 => [8388612]
            map.insert(24, &[24]);     // 24 => [24]
            map.insert(40, &[40]);     // 40 => [40]
            map.insert(72, &[72]);     // 72 => [72]
            map.insert(136, &[136]);     // 136 => [136]
            map.insert(264, &[264]);     // 264 => [264]
            map.insert(447, &[520]);     // 447 => [520]
            map.insert(335, &[1032]);     // 335 => [1032]
            map.insert(520, &[2056]);     // 520 => [2056]
            map.insert(918, &[4104]);     // 918 => [4104]
            map.insert(581, &[8200]);     // 581 => [8200]
            map.insert(225, &[16392]);     // 225 => [16392]
            map.insert(215, &[32776]);     // 215 => [32776]
            map.insert(337, &[65544]);     // 337 => [65544]
            map.insert(691, &[131080]);     // 691 => [131080]
            map.insert(669, &[262152]);     // 669 => [262152]
            map.insert(114, &[524296]);     // 114 => [524296]
            map.insert(867, &[1048584]);     // 867 => [1048584]
            map.insert(380, &[2097160]);     // 380 => [2097160]
            map.insert(897, &[4194312]);     // 897 => [4194312]
            map.insert(633, &[8388616]);     // 633 => [8388616]
            map.insert(48, &[48]);     // 48 => [48]
            map.insert(80, &[80]);     // 80 => [80]
            map.insert(144, &[144]);     // 144 => [144]
            map.insert(272, &[272]);     // 272 => [272]
            map.insert(423, &[528]);     // 423 => [528]
            map.insert(343, &[1040]);     // 343 => [1040]
            map.insert(528, &[2064]);     // 528 => [2064]
            map.insert(910, &[4112]);     // 910 => [4112]
            map.insert(605, &[8208]);     // 605 => [8208]
            map.insert(249, &[16400]);     // 249 => [16400]
            map.insert(207, &[32784]);     // 207 => [32784]
            map.insert(329, &[65552]);     // 329 => [65552]
            map.insert(683, &[131088]);     // 683 => [131088]
            map.insert(645, &[262160]);     // 645 => [262160]
            map.insert(106, &[524304]);     // 106 => [524304]
            map.insert(891, &[1048592]);     // 891 => [1048592]
            map.insert(356, &[2097168]);     // 356 => [2097168]
            map.insert(921, &[4194320]);     // 921 => [4194320]
            map.insert(609, &[8388624]);     // 609 => [8388624]
            map.insert(96, &[96]);     // 96 => [96]
            map.insert(160, &[160]);     // 160 => [160]
            map.insert(288, &[288]);     // 288 => [288]
            map.insert(407, &[544]);     // 407 => [544]
            map.insert(359, &[1056]);     // 359 => [1056]
            map.insert(544, &[2080]);     // 544 => [2080]
            map.insert(958, &[4128]);     // 958 => [4128]
            map.insert(621, &[8224]);     // 621 => [8224]
            map.insert(201, &[16416]);     // 201 => [16416]
            map.insert(255, &[32800]);     // 255 => [32800]
            map.insert(377, &[65568]);     // 377 => [65568]
            map.insert(667, &[131104]);     // 667 => [131104]
            map.insert(693, &[262176]);     // 693 => [262176]
            map.insert(90, &[524320]);     // 90 => [524320]
            map.insert(843, &[1048608]);     // 843 => [1048608]
            map.insert(340, &[2097184]);     // 340 => [2097184]
            map.insert(937, &[4194336]);     // 937 => [4194336]
            map.insert(593, &[8388640]);     // 593 => [8388640]
            map.insert(192, &[192]);     // 192 => [192]
            map.insert(320, &[320]);     // 320 => [320]
            map.insert(503, &[576]);     // 503 => [576]
            map.insert(263, &[1088]);     // 263 => [1088]
            map.insert(576, &[2112]);     // 576 => [2112]
            map.insert(990, &[4160]);     // 990 => [4160]
            map.insert(525, &[8256]);     // 525 => [8256]
            map.insert(169, &[16448]);     // 169 => [16448]
            map.insert(159, &[32832]);     // 159 => [32832]
            map.insert(281, &[65600]);     // 281 => [65600]
            map.insert(763, &[131136]);     // 763 => [131136]
            map.insert(725, &[262208]);     // 725 => [262208]
            map.insert(58, &[524352]);     // 58 => [524352]
            map.insert(811, &[1048640]);     // 811 => [1048640]
            map.insert(308, &[2097216]);     // 308 => [2097216]
            map.insert(969, &[4194368]);     // 969 => [4194368]
            map.insert(561, &[8388672]);     // 561 => [8388672]
            map.insert(384, &[384]);     // 384 => [384]
            map.insert(311, &[640]);     // 311 => [640]
            map.insert(455, &[1152]);     // 455 => [1152]
            map.insert(640, &[2176]);     // 640 => [2176]
            map.insert(798, &[4224]);     // 798 => [4224]
            map.insert(717, &[8320]);     // 717 => [8320]
            map.insert(105, &[16512]);     // 105 => [16512]
            map.insert(95, &[32896]);     // 95 => [32896]
            map.insert(473, &[65664]);     // 473 => [65664]
            map.insert(571, &[131200]);     // 571 => [131200]
            map.insert(533, &[262272]);     // 533 => [262272]
            map.insert(250, &[524416]);     // 250 => [524416]
            map.insert(1003, &[1048704]);     // 1003 => [1048704]
            map.insert(500, &[2097280]);     // 500 => [2097280]
            map.insert(777, &[4194432]);     // 777 => [4194432]
            map.insert(753, &[8388736]);     // 753 => [8388736]
            map.insert(183, &[768]);     // 183 => [768]
            map.insert(71, &[1280]);     // 71 => [1280]
            map.insert(768, &[2304]);     // 768 => [2304]
            map.insert(670, &[4352]);     // 670 => [4352]
            map.insert(845, &[8448]);     // 845 => [8448]
            map.insert(489, &[16640]);     // 489 => [16640]
            map.insert(479, &[33024]);     // 479 => [33024]
            map.insert(89, &[65792]);     // 89 => [65792]
            map.insert(955, &[131328]);     // 955 => [131328]
            map.insert(917, &[262400]);     // 917 => [262400]
            map.insert(378, &[524544]);     // 378 => [524544]
            map.insert(619, &[1048832]);     // 619 => [1048832]
            map.insert(116, &[2097408]);     // 116 => [2097408]
            map.insert(649, &[4194560]);     // 649 => [4194560]
            map.insert(881, &[8388864]);     // 881 => [8388864]
            map.insert(240, &[1536]);     // 240 => [1536]
            map.insert(951, &[2560]);     // 951 => [2560]
            map.insert(553, &[4608]);     // 553 => [4608]
            map.insert(1018, &[8704]);     // 1018 => [8704]
            map.insert(350, &[16896]);     // 350 => [16896]
            map.insert(360, &[33280]);     // 360 => [33280]
            map.insert(238, &[66048]);     // 238 => [66048]
            map.insert(780, &[131584]);     // 780 => [131584]
            map.insert(802, &[262656]);     // 802 => [262656]
            map.insert(461, &[524800]);     // 461 => [524800]
            map.insert(732, &[1049088]);     // 732 => [1049088]
            map.insert(195, &[2097664]);     // 195 => [2097664]
            map.insert(574, &[4194816]);     // 574 => [4194816]
            map.insert(966, &[8389120]);     // 966 => [8389120]
            map.insert(839, &[3072]);     // 839 => [3072]
            map.insert(729, &[5120]);     // 729 => [5120]
            map.insert(778, &[9216]);     // 778 => [9216]
            map.insert(430, &[17408]);     // 430 => [17408]
            map.insert(408, &[33792]);     // 408 => [33792]
            map.insert(30, &[66560]);     // 30 => [66560]
            map.insert(1020, &[132096]);     // 1020 => [132096]
            map.insert(978, &[263168]);     // 978 => [263168]
            map.insert(317, &[525312]);     // 317 => [525312]
            map.insert(556, &[1049600]);     // 556 => [1049600]
            map.insert(51, &[2098176]);     // 51 => [2098176]
            map.insert(718, &[4195328]);     // 718 => [4195328]
            map.insert(822, &[8389632]);     // 822 => [8389632]
            map.insert(414, &[6144]);     // 414 => [6144]
            map.insert(77, &[10240]);     // 77 => [10240]
            map.insert(745, &[18432]);     // 745 => [18432]
            map.insert(735, &[34816]);     // 735 => [34816]
            map.insert(857, &[67584]);     // 857 => [67584]
            map.insert(187, &[133120]);     // 187 => [133120]
            map.insert(149, &[264192]);     // 149 => [264192]
            map.insert(634, &[526336]);     // 634 => [526336]
            map.insert(363, &[1050624]);     // 363 => [1050624]
            map.insert(884, &[2099200]);     // 884 => [2099200]
            map.insert(393, &[4196352]);     // 393 => [4196352]
            map.insert(113, &[8390656]);     // 113 => [8390656]
            map.insert(467, &[12288]);     // 467 => [12288]
            map.insert(887, &[20480]);     // 887 => [20480]
            map.insert(833, &[36864]);     // 833 => [36864]
            map.insert(711, &[69632]);     // 711 => [69632]
            map.insert(293, &[135168]);     // 293 => [135168]
            map.insert(267, &[266240]);     // 267 => [266240]
            map.insert(996, &[528384]);     // 996 => [528384]
            map.insert(245, &[1052672]);     // 245 => [1052672]
            map.insert(746, &[2101248]);     // 746 => [2101248]
            map.insert(23, &[4198400]);     // 23 => [4198400]
            map.insert(495, &[8392704]);     // 495 => [8392704]
            map.insert(676, &[24576]);     // 676 => [24576]
            map.insert(658, &[40960]);     // 658 => [40960]
            map.insert(788, &[73728]);     // 788 => [73728]
            map.insert(246, &[139264]);     // 246 => [139264]
            map.insert(216, &[270336]);     // 216 => [270336]
            map.insert(567, &[532480]);     // 567 => [532480]
            map.insert(294, &[1056768]);     // 294 => [1056768]
            map.insert(825, &[2105344]);     // 825 => [2105344]
            map.insert(452, &[4202496]);     // 452 => [4202496]
            map.insert(60, &[8396800]);     // 60 => [8396800]
            map.insert(54, &[49152]);     // 54 => [49152]
            map.insert(432, &[81920]);     // 432 => [81920]
            map.insert(594, &[147456]);     // 594 => [147456]
            map.insert(636, &[278528]);     // 636 => [278528]
            map.insert(147, &[540672]);     // 147 => [540672]
            map.insert(898, &[1064960]);     // 898 => [1064960]
            map.insert(413, &[2113536]);     // 413 => [2113536]
            map.insert(864, &[4210688]);     // 864 => [4210688]
            map.insert(664, &[8404992]);     // 664 => [8404992]
            map.insert(390, &[98304]);     // 390 => [98304]
            map.insert(612, &[163840]);     // 612 => [163840]
            map.insert(586, &[294912]);     // 586 => [294912]
            map.insert(165, &[557056]);     // 165 => [557056]
            map.insert(948, &[1081344]);     // 948 => [1081344]
            map.insert(427, &[2129920]);     // 427 => [2129920]
            map.insert(854, &[4227072]);     // 854 => [4227072]
            map.insert(686, &[8421376]);     // 686 => [8421376]
            map.insert(994, &[196608]);     // 994 => [196608]
            map.insert(972, &[327680]);     // 972 => [327680]
            map.insert(291, &[589824]);     // 291 => [589824]
            map.insert(562, &[1114112]);     // 562 => [1114112]
            map.insert(45, &[2162688]);     // 45 => [2162688]
            map.insert(720, &[4259840]);     // 720 => [4259840]
            map.insert(808, &[8454144]);     // 808 => [8454144]
            map.insert(46, &[393216]);     // 46 => [393216]
            map.insert(705, &[655360]);     // 705 => [655360]
            map.insert(464, &[1179648]);     // 464 => [1179648]
            map.insert(975, &[2228224]);     // 975 => [2228224]
            map.insert(306, &[4325376]);     // 306 => [4325376]
            map.insert(202, &[8519680]);     // 202 => [8519680]
            map.insert(751, &[786432]);     // 751 => [786432]
            map.insert(510, &[1310720]);     // 510 => [1310720]
            map.insert(993, &[2359296]);     // 993 => [2359296]
            map.insert(284, &[4456448]);     // 284 => [4456448]
            map.insert(228, &[8650752]);     // 228 => [8650752]
            map.insert(785, &[1572864]);     // 785 => [1572864]
            map.insert(270, &[2621440]);     // 270 => [2621440]
            map.insert(1011, &[4718592]);     // 1011 => [4718592]
            map.insert(523, &[8912896]);     // 523 => [8912896]
            map.insert(543, &[3145728]);     // 543 => [3145728]
            map.insert(226, &[5242880]);     // 226 => [5242880]
            map.insert(282, &[9437184]);     // 282 => [9437184]
            map.insert(765, &[6291456]);     // 765 => [6291456]
            map.insert(773, &[10485760]);     // 773 => [10485760]
            map.insert(504, &[12582912]);     // 504 => [12582912]
            map.insert(7, &[7]);     // 7 => [7]
            map.insert(11, &[11]);     // 11 => [11]
            map.insert(19, &[19]);     // 19 => [19]
            map.insert(35, &[35]);     // 35 => [35]
            map.insert(67, &[67]);     // 67 => [67]
            map.insert(131, &[131]);     // 131 => [131]
            map.insert(259, &[259]);     // 259 => [259]
            map.insert(436, &[515]);     // 436 => [515]
            map.insert(324, &[1027]);     // 324 => [1027]
            map.insert(515, &[2051]);     // 515 => [2051]
            map.insert(925, &[4099]);     // 925 => [4099]
            map.insert(590, &[8195]);     // 590 => [8195]
            map.insert(234, &[16387]);     // 234 => [16387]
            map.insert(220, &[32771]);     // 220 => [32771]
            map.insert(346, &[65539]);     // 346 => [65539]
            map.insert(696, &[131075]);     // 696 => [131075]
            map.insert(662, &[262147]);     // 662 => [262147]
            map.insert(121, &[524291]);     // 121 => [524291]
            map.insert(872, &[1048579]);     // 872 => [1048579]
            map.insert(375, &[2097155]);     // 375 => [2097155]
            map.insert(906, &[4194307]);     // 906 => [4194307]
            map.insert(626, &[8388611]);     // 626 => [8388611]
            map.insert(13, &[13]);     // 13 => [13]
            map.insert(21, &[21]);     // 21 => [21]
            map.insert(37, &[37]);     // 37 => [37]
            map.insert(69, &[69]);     // 69 => [69]
            map.insert(133, &[133]);     // 133 => [133]
            map.insert(261, &[261]);     // 261 => [261]
            map.insert(434, &[517]);     // 434 => [517]
            map.insert(322, &[1029]);     // 322 => [1029]
            map.insert(517, &[2053]);     // 517 => [2053]
            map.insert(923, &[4101]);     // 923 => [4101]
            map.insert(584, &[8197]);     // 584 => [8197]
            map.insert(236, &[16389]);     // 236 => [16389]
            map.insert(218, &[32773]);     // 218 => [32773]
            map.insert(348, &[65541]);     // 348 => [65541]
            map.insert(702, &[131077]);     // 702 => [131077]
            map.insert(656, &[262149]);     // 656 => [262149]
            map.insert(127, &[524293]);     // 127 => [524293]
            map.insert(878, &[1048581]);     // 878 => [1048581]
            map.insert(369, &[2097157]);     // 369 => [2097157]
            map.insert(908, &[4194309]);     // 908 => [4194309]
            map.insert(628, &[8388613]);     // 628 => [8388613]
            map.insert(25, &[25]);     // 25 => [25]
            map.insert(41, &[41]);     // 41 => [41]
            map.insert(73, &[73]);     // 73 => [73]
            map.insert(137, &[137]);     // 137 => [137]
            map.insert(265, &[265]);     // 265 => [265]
            map.insert(446, &[521]);     // 446 => [521]
            map.insert(334, &[1033]);     // 334 => [1033]
            map.insert(521, &[2057]);     // 521 => [2057]
            map.insert(919, &[4105]);     // 919 => [4105]
            map.insert(580, &[8201]);     // 580 => [8201]
            map.insert(224, &[16393]);     // 224 => [16393]
            map.insert(214, &[32777]);     // 214 => [32777]
            map.insert(336, &[65545]);     // 336 => [65545]
            map.insert(690, &[131081]);     // 690 => [131081]
            map.insert(668, &[262153]);     // 668 => [262153]
            map.insert(115, &[524297]);     // 115 => [524297]
            map.insert(866, &[1048585]);     // 866 => [1048585]
            map.insert(381, &[2097161]);     // 381 => [2097161]
            map.insert(896, &[4194313]);     // 896 => [4194313]
            map.insert(632, &[8388617]);     // 632 => [8388617]
            map.insert(49, &[49]);     // 49 => [49]
            map.insert(81, &[81]);     // 81 => [81]
            map.insert(145, &[145]);     // 145 => [145]
            map.insert(273, &[273]);     // 273 => [273]
            map.insert(422, &[529]);     // 422 => [529]
            map.insert(342, &[1041]);     // 342 => [1041]
            map.insert(529, &[2065]);     // 529 => [2065]
            map.insert(911, &[4113]);     // 911 => [4113]
            map.insert(604, &[8209]);     // 604 => [8209]
            map.insert(248, &[16401]);     // 248 => [16401]
            map.insert(206, &[32785]);     // 206 => [32785]
            map.insert(328, &[65553]);     // 328 => [65553]
            map.insert(682, &[131089]);     // 682 => [131089]
            map.insert(644, &[262161]);     // 644 => [262161]
            map.insert(107, &[524305]);     // 107 => [524305]
            map.insert(890, &[1048593]);     // 890 => [1048593]
            map.insert(357, &[2097169]);     // 357 => [2097169]
            map.insert(920, &[4194321]);     // 920 => [4194321]
            map.insert(608, &[8388625]);     // 608 => [8388625]
            map.insert(97, &[97]);     // 97 => [97]
            map.insert(161, &[161]);     // 161 => [161]
            map.insert(289, &[289]);     // 289 => [289]
            map.insert(406, &[545]);     // 406 => [545]
            map.insert(358, &[1057]);     // 358 => [1057]
            map.insert(545, &[2081]);     // 545 => [2081]
            map.insert(959, &[4129]);     // 959 => [4129]
            map.insert(620, &[8225]);     // 620 => [8225]
            map.insert(200, &[16417]);     // 200 => [16417]
            map.insert(254, &[32801]);     // 254 => [32801]
            map.insert(376, &[65569]);     // 376 => [65569]
            map.insert(666, &[131105]);     // 666 => [131105]
            map.insert(692, &[262177]);     // 692 => [262177]
            map.insert(91, &[524321]);     // 91 => [524321]
            map.insert(842, &[1048609]);     // 842 => [1048609]
            map.insert(341, &[2097185]);     // 341 => [2097185]
            map.insert(936, &[4194337]);     // 936 => [4194337]
            map.insert(592, &[8388641]);     // 592 => [8388641]
            map.insert(193, &[193]);     // 193 => [193]
            map.insert(321, &[321]);     // 321 => [321]
            map.insert(502, &[577]);     // 502 => [577]
            map.insert(262, &[1089]);     // 262 => [1089]
            map.insert(577, &[2113]);     // 577 => [2113]
            map.insert(991, &[4161]);     // 991 => [4161]
            map.insert(524, &[8257]);     // 524 => [8257]
            map.insert(168, &[16449]);     // 168 => [16449]
            map.insert(158, &[32833]);     // 158 => [32833]
            map.insert(280, &[65601]);     // 280 => [65601]
            map.insert(762, &[131137]);     // 762 => [131137]
            map.insert(724, &[262209]);     // 724 => [262209]
            map.insert(59, &[524353]);     // 59 => [524353]
            map.insert(810, &[1048641]);     // 810 => [1048641]
            map.insert(309, &[2097217]);     // 309 => [2097217]
            map.insert(968, &[4194369]);     // 968 => [4194369]
            map.insert(560, &[8388673]);     // 560 => [8388673]
            map.insert(385, &[385]);     // 385 => [385]
            map.insert(310, &[641]);     // 310 => [641]
            map.insert(454, &[1153]);     // 454 => [1153]
            map.insert(641, &[2177]);     // 641 => [2177]
            map.insert(799, &[4225]);     // 799 => [4225]
            map.insert(716, &[8321]);     // 716 => [8321]
            map.insert(104, &[16513]);     // 104 => [16513]
            map.insert(94, &[32897]);     // 94 => [32897]
            map.insert(472, &[65665]);     // 472 => [65665]
            map.insert(570, &[131201]);     // 570 => [131201]
            map.insert(532, &[262273]);     // 532 => [262273]
            map.insert(251, &[524417]);     // 251 => [524417]
            map.insert(1002, &[1048705]);     // 1002 => [1048705]
            map.insert(501, &[2097281]);     // 501 => [2097281]
            map.insert(776, &[4194433]);     // 776 => [4194433]
            map.insert(752, &[8388737]);     // 752 => [8388737]
            map.insert(182, &[769]);     // 182 => [769]
            map.insert(70, &[1281]);     // 70 => [1281]
            map.insert(769, &[2305]);     // 769 => [2305]
            map.insert(671, &[4353]);     // 671 => [4353]
            map.insert(844, &[8449]);     // 844 => [8449]
            map.insert(488, &[16641]);     // 488 => [16641]
            map.insert(478, &[33025]);     // 478 => [33025]
            map.insert(88, &[65793]);     // 88 => [65793]
            map.insert(954, &[131329]);     // 954 => [131329]
            map.insert(916, &[262401]);     // 916 => [262401]
            map.insert(379, &[524545]);     // 379 => [524545]
            map.insert(618, &[1048833]);     // 618 => [1048833]
            map.insert(117, &[2097409]);     // 117 => [2097409]
            map.insert(648, &[4194561]);     // 648 => [4194561]
            map.insert(880, &[8388865]);     // 880 => [8388865]
            map.insert(241, &[1537]);     // 241 => [1537]
            map.insert(950, &[2561]);     // 950 => [2561]
            map.insert(552, &[4609]);     // 552 => [4609]
            map.insert(1019, &[8705]);     // 1019 => [8705]
            map.insert(351, &[16897]);     // 351 => [16897]
            map.insert(361, &[33281]);     // 361 => [33281]
            map.insert(239, &[66049]);     // 239 => [66049]
            map.insert(781, &[131585]);     // 781 => [131585]
            map.insert(803, &[262657]);     // 803 => [262657]
            map.insert(460, &[524801]);     // 460 => [524801]
            map.insert(733, &[1049089]);     // 733 => [1049089]
            map.insert(194, &[2097665]);     // 194 => [2097665]
            map.insert(575, &[4194817]);     // 575 => [4194817]
            map.insert(967, &[8389121]);     // 967 => [8389121]
            map.insert(838, &[3073]);     // 838 => [3073]
            map.insert(728, &[5121]);     // 728 => [5121]
            map.insert(779, &[9217]);     // 779 => [9217]
            map.insert(431, &[17409]);     // 431 => [17409]
            map.insert(409, &[33793]);     // 409 => [33793]
            map.insert(31, &[66561]);     // 31 => [66561]
            map.insert(1021, &[132097]);     // 1021 => [132097]
            map.insert(979, &[263169]);     // 979 => [263169]
            map.insert(316, &[525313]);     // 316 => [525313]
            map.insert(557, &[1049601]);     // 557 => [1049601]
            map.insert(50, &[2098177]);     // 50 => [2098177]
            map.insert(719, &[4195329]);     // 719 => [4195329]
            map.insert(823, &[8389633]);     // 823 => [8389633]
            map.insert(415, &[6145]);     // 415 => [6145]
            map.insert(76, &[10241]);     // 76 => [10241]
            map.insert(744, &[18433]);     // 744 => [18433]
            map.insert(734, &[34817]);     // 734 => [34817]
            map.insert(856, &[67585]);     // 856 => [67585]
            map.insert(186, &[133121]);     // 186 => [133121]
            map.insert(148, &[264193]);     // 148 => [264193]
            map.insert(635, &[526337]);     // 635 => [526337]
            map.insert(362, &[1050625]);     // 362 => [1050625]
            map.insert(885, &[2099201]);     // 885 => [2099201]
            map.insert(392, &[4196353]);     // 392 => [4196353]
            map.insert(112, &[8390657]);     // 112 => [8390657]
            map.insert(466, &[12289]);     // 466 => [12289]
            map.insert(886, &[20481]);     // 886 => [20481]
            map.insert(832, &[36865]);     // 832 => [36865]
            map.insert(710, &[69633]);     // 710 => [69633]
            map.insert(292, &[135169]);     // 292 => [135169]
            map.insert(266, &[266241]);     // 266 => [266241]
            map.insert(997, &[528385]);     // 997 => [528385]
            map.insert(244, &[1052673]);     // 244 => [1052673]
            map.insert(747, &[2101249]);     // 747 => [2101249]
            map.insert(22, &[4198401]);     // 22 => [4198401]
            map.insert(494, &[8392705]);     // 494 => [8392705]
            map.insert(677, &[24577]);     // 677 => [24577]
            map.insert(659, &[40961]);     // 659 => [40961]
            map.insert(789, &[73729]);     // 789 => [73729]
            map.insert(247, &[139265]);     // 247 => [139265]
            map.insert(217, &[270337]);     // 217 => [270337]
            map.insert(566, &[532481]);     // 566 => [532481]
            map.insert(295, &[1056769]);     // 295 => [1056769]
            map.insert(824, &[2105345]);     // 824 => [2105345]
            map.insert(453, &[4202497]);     // 453 => [4202497]
            map.insert(61, &[8396801]);     // 61 => [8396801]
            map.insert(55, &[49153]);     // 55 => [49153]
            map.insert(433, &[81921]);     // 433 => [81921]
            map.insert(595, &[147457]);     // 595 => [147457]
            map.insert(637, &[278529]);     // 637 => [278529]
            map.insert(146, &[540673]);     // 146 => [540673]
            map.insert(899, &[1064961]);     // 899 => [1064961]
            map.insert(412, &[2113537]);     // 412 => [2113537]
            map.insert(865, &[4210689]);     // 865 => [4210689]
            map.insert(665, &[8404993]);     // 665 => [8404993]
            map.insert(391, &[98305]);     // 391 => [98305]
            map.insert(613, &[163841]);     // 613 => [163841]
            map.insert(587, &[294913]);     // 587 => [294913]
            map.insert(164, &[557057]);     // 164 => [557057]
            map.insert(949, &[1081345]);     // 949 => [1081345]
            map.insert(426, &[2129921]);     // 426 => [2129921]
            map.insert(855, &[4227073]);     // 855 => [4227073]
            map.insert(687, &[8421377]);     // 687 => [8421377]
            map.insert(995, &[196609]);     // 995 => [196609]
            map.insert(973, &[327681]);     // 973 => [327681]
            map.insert(290, &[589825]);     // 290 => [589825]
            map.insert(563, &[1114113]);     // 563 => [1114113]
            map.insert(44, &[2162689]);     // 44 => [2162689]
            map.insert(721, &[4259841]);     // 721 => [4259841]
            map.insert(809, &[8454145]);     // 809 => [8454145]
            map.insert(47, &[393217]);     // 47 => [393217]
            map.insert(704, &[655361]);     // 704 => [655361]
            map.insert(465, &[1179649]);     // 465 => [1179649]
            map.insert(974, &[2228225]);     // 974 => [2228225]
            map.insert(307, &[4325377]);     // 307 => [4325377]
            map.insert(203, &[8519681]);     // 203 => [8519681]
            map.insert(750, &[786433]);     // 750 => [786433]
            map.insert(511, &[1310721]);     // 511 => [1310721]
            map.insert(992, &[2359297]);     // 992 => [2359297]
            map.insert(285, &[4456449]);     // 285 => [4456449]
            map.insert(229, &[8650753]);     // 229 => [8650753]
            map.insert(784, &[1572865]);     // 784 => [1572865]
            map.insert(271, &[2621441]);     // 271 => [2621441]
            map.insert(1010, &[4718593]);     // 1010 => [4718593]
            map.insert(522, &[8912897]);     // 522 => [8912897]
            map.insert(542, &[3145729]);     // 542 => [3145729]
            map.insert(227, &[5242881]);     // 227 => [5242881]
            map.insert(283, &[9437185]);     // 283 => [9437185]
            map.insert(764, &[6291457]);     // 764 => [6291457]
            map.insert(772, &[10485761]);     // 772 => [10485761]
            map.insert(505, &[12582913]);     // 505 => [12582913]
            map.insert(14, &[14]);     // 14 => [14]
            map.insert(38, &[38]);     // 38 => [38]
            map.insert(134, &[134]);     // 134 => [134]
            map.insert(518, &[2054]);     // 518 => [2054]
            map.insert(701, &[131078]);     // 701 => [131078]
            map.insert(124, &[524294]);     // 124 => [524294]
            map.insert(877, &[1048582]);     // 877 => [1048582]
            map.insert(370, &[2097158]);     // 370 => [2097158]
            map.insert(631, &[8388614]);     // 631 => [8388614]
            map.insert(26, &[26]);     // 26 => [26]
            map.insert(42, &[42]);     // 42 => [42]
            map.insert(74, &[74]);     // 74 => [74]
            map.insert(138, &[138]);     // 138 => [138]
            map.insert(445, &[522]);     // 445 => [522]
            map.insert(333, &[1034]);     // 333 => [1034]
            map.insert(583, &[8202]);     // 583 => [8202]
            map.insert(213, &[32778]);     // 213 => [32778]
            map.insert(339, &[65546]);     // 339 => [65546]
            map.insert(689, &[131082]);     // 689 => [131082]
            map.insert(382, &[2097162]);     // 382 => [2097162]
            map.insert(82, &[82]);     // 82 => [82]
            map.insert(274, &[274]);     // 274 => [274]
            map.insert(421, &[530]);     // 421 => [530]
            map.insert(530, &[2066]);     // 530 => [2066]
            map.insert(607, &[8210]);     // 607 => [8210]
            map.insert(205, &[32786]);     // 205 => [32786]
            map.insert(331, &[65554]);     // 331 => [65554]
            map.insert(681, &[131090]);     // 681 => [131090]
            map.insert(647, &[262162]);     // 647 => [262162]
            map.insert(889, &[1048594]);     // 889 => [1048594]
            map.insert(611, &[8388626]);     // 611 => [8388626]
            map.insert(98, &[98]);     // 98 => [98]
            map.insert(162, &[162]);     // 162 => [162]
            map.insert(405, &[546]);     // 405 => [546]
            map.insert(546, &[2082]);     // 546 => [2082]
            map.insert(956, &[4130]);     // 956 => [4130]
            map.insert(623, &[8226]);     // 623 => [8226]
            map.insert(253, &[32802]);     // 253 => [32802]
            map.insert(695, &[262178]);     // 695 => [262178]
            map.insert(841, &[1048610]);     // 841 => [1048610]
            map.insert(939, &[4194338]);     // 939 => [4194338]
            map.insert(578, &[2114]);     // 578 => [2114]
            map.insert(988, &[4162]);     // 988 => [4162]
            map.insert(527, &[8258]);     // 527 => [8258]
            map.insert(171, &[16450]);     // 171 => [16450]
            map.insert(157, &[32834]);     // 157 => [32834]
            map.insert(761, &[131138]);     // 761 => [131138]
            map.insert(727, &[262210]);     // 727 => [262210]
            map.insert(56, &[524354]);     // 56 => [524354]
            map.insert(971, &[4194370]);     // 971 => [4194370]
            map.insert(386, &[386]);     // 386 => [386]
            map.insert(642, &[2178]);     // 642 => [2178]
            map.insert(796, &[4226]);     // 796 => [4226]
            map.insert(93, &[32898]);     // 93 => [32898]
            map.insert(475, &[65666]);     // 475 => [65666]
            map.insert(569, &[131202]);     // 569 => [131202]
            map.insert(535, &[262274]);     // 535 => [262274]
            map.insert(1001, &[1048706]);     // 1001 => [1048706]
            map.insert(755, &[8388738]);     // 755 => [8388738]
            map.insert(181, &[770]);     // 181 => [770]
            map.insert(770, &[2306]);     // 770 => [2306]
            map.insert(847, &[8450]);     // 847 => [8450]
            map.insert(491, &[16642]);     // 491 => [16642]
            map.insert(477, &[33026]);     // 477 => [33026]
            map.insert(953, &[131330]);     // 953 => [131330]
            map.insert(617, &[1048834]);     // 617 => [1048834]
            map.insert(118, &[2097410]);     // 118 => [2097410]
            map.insert(651, &[4194562]);     // 651 => [4194562]
            map.insert(883, &[8388866]);     // 883 => [8388866]
            map.insert(242, &[1538]);     // 242 => [1538]
            map.insert(555, &[4610]);     // 555 => [4610]
            map.insert(1016, &[8706]);     // 1016 => [8706]
            map.insert(782, &[131586]);     // 782 => [131586]
            map.insert(800, &[262658]);     // 800 => [262658]
            map.insert(463, &[524802]);     // 463 => [524802]
            map.insert(572, &[4194818]);     // 572 => [4194818]
            map.insert(964, &[8389122]);     // 964 => [8389122]
            map.insert(837, &[3074]);     // 837 => [3074]
            map.insert(731, &[5122]);     // 731 => [5122]
            map.insert(428, &[17410]);     // 428 => [17410]
            map.insert(410, &[33794]);     // 410 => [33794]
            map.insert(28, &[66562]);     // 28 => [66562]
            map.insert(1022, &[132098]);     // 1022 => [132098]
            map.insert(976, &[263170]);     // 976 => [263170]
            map.insert(319, &[525314]);     // 319 => [525314]
            map.insert(558, &[1049602]);     // 558 => [1049602]
            map.insert(820, &[8389634]);     // 820 => [8389634]
            map.insert(79, &[10242]);     // 79 => [10242]
            map.insert(859, &[67586]);     // 859 => [67586]
            map.insert(185, &[133122]);     // 185 => [133122]
            map.insert(151, &[264194]);     // 151 => [264194]
            map.insert(395, &[4196354]);     // 395 => [4196354]
            map.insert(835, &[36866]);     // 835 => [36866]
            map.insert(709, &[69634]);     // 709 => [69634]
            map.insert(998, &[528386]);     // 998 => [528386]
            map.insert(493, &[8392706]);     // 493 => [8392706]
            map.insert(678, &[24578]);     // 678 => [24578]
            map.insert(790, &[73730]);     // 790 => [73730]
            map.insert(565, &[532482]);     // 565 => [532482]
            map.insert(827, &[2105346]);     // 827 => [2105346]
            map.insert(62, &[8396802]);     // 62 => [8396802]
            map.insert(52, &[49154]);     // 52 => [49154]
            map.insert(638, &[278530]);     // 638 => [278530]
            map.insert(388, &[98306]);     // 388 => [98306]
            map.insert(614, &[163842]);     // 614 => [163842]
            map.insert(167, &[557058]);     // 167 => [557058]
            map.insert(425, &[2129922]);     // 425 => [2129922]
            map.insert(852, &[4227074]);     // 852 => [4227074]
            map.insert(684, &[8421378]);     // 684 => [8421378]
            map.insert(722, &[4259842]);     // 722 => [4259842]
            map.insert(707, &[655362]);     // 707 => [655362]
            map.insert(304, &[4325378]);     // 304 => [4325378]
            map.insert(749, &[786434]);     // 749 => [786434]
            map.insert(508, &[1310722]);     // 508 => [1310722]
            map.insert(286, &[4456450]);     // 286 => [4456450]
            map.insert(230, &[8650754]);     // 230 => [8650754]
            map.insert(787, &[1572866]);     // 787 => [1572866]
            map.insert(268, &[2621442]);     // 268 => [2621442]
            map.insert(1009, &[4718594]);     // 1009 => [4718594]
            map.insert(541, &[3145730]);     // 541 => [3145730]
            map.insert(767, &[6291458]);     // 767 => [6291458]
            map.insert(775, &[10485762]);     // 775 => [10485762]
            map.insert(506, &[12582914]);     // 506 => [12582914]
            map.insert(140, &[140]);     // 140 => [140]
            map.insert(443, &[524]);     // 443 => [524]
            map.insert(914, &[4108]);     // 914 => [4108]
            map.insert(211, &[32780]);     // 211 => [32780]
            map.insert(871, &[1048588]);     // 871 => [1048588]
            map.insert(901, &[4194316]);     // 901 => [4194316]
            map.insert(84, &[84]);     // 84 => [84]
            map.insert(276, &[276]);     // 276 => [276]
            map.insert(419, &[532]);     // 419 => [532]
            map.insert(601, &[8212]);     // 601 => [8212]
            map.insert(110, &[524308]);     // 110 => [524308]
            map.insert(895, &[1048596]);     // 895 => [1048596]
            map.insert(352, &[2097172]);     // 352 => [2097172]
            map.insert(100, &[100]);     // 100 => [100]
            map.insert(403, &[548]);     // 403 => [548]
            map.insert(355, &[1060]);     // 355 => [1060]
            map.insert(548, &[2084]);     // 548 => [2084]
            map.insert(941, &[4194340]);     // 941 => [4194340]
            map.insert(597, &[8388644]);     // 597 => [8388644]
            map.insert(196, &[196]);     // 196 => [196]
            map.insert(499, &[580]);     // 499 => [580]
            map.insert(986, &[4164]);     // 986 => [4164]
            map.insert(173, &[16452]);     // 173 => [16452]
            map.insert(155, &[32836]);     // 155 => [32836]
            map.insert(815, &[1048644]);     // 815 => [1048644]
            map.insert(451, &[1156]);     // 451 => [1156]
            map.insert(794, &[4228]);     // 794 => [4228]
            map.insert(713, &[8324]);     // 713 => [8324]
            map.insert(109, &[16516]);     // 109 => [16516]
            map.insert(1007, &[1048708]);     // 1007 => [1048708]
            map.insert(496, &[2097284]);     // 496 => [2097284]
            map.insert(757, &[8388740]);     // 757 => [8388740]
            map.insert(179, &[772]);     // 179 => [772]
            map.insert(913, &[262404]);     // 913 => [262404]
            map.insert(653, &[4194564]);     // 653 => [4194564]
            map.insert(947, &[2564]);     // 947 => [2564]
            map.insert(364, &[33284]);     // 364 => [33284]
            map.insert(806, &[262660]);     // 806 => [262660]
            map.insert(457, &[524804]);     // 457 => [524804]
            map.insert(199, &[2097668]);     // 199 => [2097668]
            map.insert(962, &[8389124]);     // 962 => [8389124]
            map.insert(982, &[263172]);     // 982 => [263172]
            map.insert(313, &[525316]);     // 313 => [525316]
            map.insert(714, &[4195332]);     // 714 => [4195332]
            map.insert(818, &[8389636]);     // 818 => [8389636]
            map.insert(861, &[67588]);     // 861 => [67588]
            map.insert(191, &[133124]);     // 191 => [133124]
            map.insert(367, &[1050628]);     // 367 => [1050628]
            map.insert(397, &[4196356]);     // 397 => [4196356]
            map.insert(471, &[12292]);     // 471 => [12292]
            map.insert(672, &[24580]);     // 672 => [24580]
            map.insert(829, &[2105348]);     // 829 => [2105348]
            map.insert(448, &[4202500]);     // 448 => [4202500]
            map.insert(598, &[147460]);     // 598 => [147460]
            map.insert(902, &[1064964]);     // 902 => [1064964]
            map.insert(868, &[4210692]);     // 868 => [4210692]
            map.insert(944, &[1081348]);     // 944 => [1081348]
            map.insert(850, &[4227076]);     // 850 => [4227076]
            map.insert(812, &[8454148]);     // 812 => [8454148]
            map.insert(468, &[1179652]);     // 468 => [1179652]
            map.insert(1015, &[4718596]);     // 1015 => [4718596]
            map.insert(539, &[3145732]);     // 539 => [3145732]
            map.insert(152, &[152]);     // 152 => [152]
            map.insert(536, &[2072]);     // 536 => [2072]
            map.insert(675, &[131096]);     // 675 => [131096]
            map.insert(296, &[296]);     // 296 => [296]
            map.insert(929, &[4194344]);     // 929 => [4194344]
            map.insert(961, &[4194376]);     // 961 => [4194376]
            map.insert(87, &[32904]);     // 87 => [32904]
            map.insert(481, &[16648]);     // 481 => [16648]
            map.insert(400, &[33800]);     // 400 => [33800]
            map.insert(1012, &[132104]);     // 1012 => [132104]
            map.insert(830, &[8389640]);     // 830 => [8389640]
            map.insert(737, &[18440]);     // 737 => [18440]
            map.insert(849, &[67592]);     // 849 => [67592]
            map.insert(892, &[2099208]);     // 892 => [2099208]
            map.insert(301, &[135176]);     // 301 => [135176]
            map.insert(1004, &[528392]);     // 1004 => [528392]
            map.insert(738, &[2101256]);     // 738 => [2101256]
            map.insert(487, &[8392712]);     // 487 => [8392712]
            map.insert(208, &[270344]);     // 208 => [270344]
            map.insert(302, &[1056776]);     // 302 => [1056776]
            map.insert(817, &[2105352]);     // 817 => [2105352]
            map.insert(440, &[81928]);     // 440 => [81928]
            map.insert(602, &[147464]);     // 602 => [147464]
            map.insert(398, &[98312]);     // 398 => [98312]
            map.insert(862, &[4227080]);     // 862 => [4227080]
            map.insert(299, &[589832]);     // 299 => [589832]
            map.insert(314, &[4325384]);     // 314 => [4325384]
            map.insert(743, &[786440]);     // 743 => [786440]
            map.insert(793, &[1572872]);     // 793 => [1572872]
            map.insert(176, &[176]);     // 176 => [176]
            map.insert(942, &[4144]);     // 942 => [4144]
            map.insert(279, &[1104]);     // 279 => [1104]
            map.insert(143, &[32848]);     // 143 => [32848]
            map.insert(985, &[4194384]);     // 985 => [4194384]
            map.insert(484, &[2097296]);     // 484 => [2097296]
            map.insert(654, &[4368]);     // 654 => [4368]
            map.insert(935, &[2576]);     // 935 => [2576]
            map.insert(551, &[532496]);     // 551 => [532496]
            map.insert(416, &[81936]);     // 416 => [81936]
            map.insert(932, &[1081360]);     // 932 => [1081360]
            map.insert(103, &[1312]);     // 103 => [1312]
            map.insert(930, &[1064992]);     // 930 => [1064992]
            map.insert(805, &[10485792]);     // 805 => [10485792]
            map.insert(981, &[262464]);     // 981 => [262464]
            map.insert(174, &[66112]);     // 174 => [66112]
            map.insert(740, &[24640]);     // 740 => [24640]
            map.insert(188, &[8396928]);     // 188 => [8396928]
            map.insert(458, &[8519936]);     // 458 => [8519936]
            map.insert(482, &[5243136]);     // 482 => [5243136]
            map.insert(758, &[37376]);     // 758 => [37376]
            map.insert(15, &[15]);     // 15 => [15]
            map.insert(39, &[39]);     // 39 => [39]
            map.insert(135, &[135]);     // 135 => [135]
            map.insert(519, &[2055]);     // 519 => [2055]
            map.insert(700, &[131079]);     // 700 => [131079]
            map.insert(125, &[524295]);     // 125 => [524295]
            map.insert(876, &[1048583]);     // 876 => [1048583]
            map.insert(371, &[2097159]);     // 371 => [2097159]
            map.insert(630, &[8388615]);     // 630 => [8388615]
            map.insert(27, &[27]);     // 27 => [27]
            map.insert(43, &[43]);     // 43 => [43]
            map.insert(75, &[75]);     // 75 => [75]
            map.insert(139, &[139]);     // 139 => [139]
            map.insert(444, &[523]);     // 444 => [523]
            map.insert(332, &[1035]);     // 332 => [1035]
            map.insert(582, &[8203]);     // 582 => [8203]
            map.insert(212, &[32779]);     // 212 => [32779]
            map.insert(338, &[65547]);     // 338 => [65547]
            map.insert(688, &[131083]);     // 688 => [131083]
            map.insert(383, &[2097163]);     // 383 => [2097163]
            map.insert(83, &[83]);     // 83 => [83]
            map.insert(275, &[275]);     // 275 => [275]
            map.insert(420, &[531]);     // 420 => [531]
            map.insert(531, &[2067]);     // 531 => [2067]
            map.insert(606, &[8211]);     // 606 => [8211]
            map.insert(204, &[32787]);     // 204 => [32787]
            map.insert(330, &[65555]);     // 330 => [65555]
            map.insert(680, &[131091]);     // 680 => [131091]
            map.insert(646, &[262163]);     // 646 => [262163]
            map.insert(888, &[1048595]);     // 888 => [1048595]
            map.insert(610, &[8388627]);     // 610 => [8388627]
            map.insert(99, &[99]);     // 99 => [99]
            map.insert(163, &[163]);     // 163 => [163]
            map.insert(404, &[547]);     // 404 => [547]
            map.insert(547, &[2083]);     // 547 => [2083]
            map.insert(957, &[4131]);     // 957 => [4131]
            map.insert(622, &[8227]);     // 622 => [8227]
            map.insert(252, &[32803]);     // 252 => [32803]
            map.insert(694, &[262179]);     // 694 => [262179]
            map.insert(840, &[1048611]);     // 840 => [1048611]
            map.insert(938, &[4194339]);     // 938 => [4194339]
            map.insert(579, &[2115]);     // 579 => [2115]
            map.insert(989, &[4163]);     // 989 => [4163]
            map.insert(526, &[8259]);     // 526 => [8259]
            map.insert(170, &[16451]);     // 170 => [16451]
            map.insert(156, &[32835]);     // 156 => [32835]
            map.insert(760, &[131139]);     // 760 => [131139]
            map.insert(726, &[262211]);     // 726 => [262211]
            map.insert(57, &[524355]);     // 57 => [524355]
            map.insert(970, &[4194371]);     // 970 => [4194371]
            map.insert(387, &[387]);     // 387 => [387]
            map.insert(643, &[2179]);     // 643 => [2179]
            map.insert(797, &[4227]);     // 797 => [4227]
            map.insert(92, &[32899]);     // 92 => [32899]
            map.insert(474, &[65667]);     // 474 => [65667]
            map.insert(568, &[131203]);     // 568 => [131203]
            map.insert(534, &[262275]);     // 534 => [262275]
            map.insert(1000, &[1048707]);     // 1000 => [1048707]
            map.insert(754, &[8388739]);     // 754 => [8388739]
            map.insert(180, &[771]);     // 180 => [771]
            map.insert(771, &[2307]);     // 771 => [2307]
            map.insert(846, &[8451]);     // 846 => [8451]
            map.insert(490, &[16643]);     // 490 => [16643]
            map.insert(476, &[33027]);     // 476 => [33027]
            map.insert(952, &[131331]);     // 952 => [131331]
            map.insert(616, &[1048835]);     // 616 => [1048835]
            map.insert(119, &[2097411]);     // 119 => [2097411]
            map.insert(650, &[4194563]);     // 650 => [4194563]
            map.insert(882, &[8388867]);     // 882 => [8388867]
            map.insert(243, &[1539]);     // 243 => [1539]
            map.insert(554, &[4611]);     // 554 => [4611]
            map.insert(1017, &[8707]);     // 1017 => [8707]
            map.insert(783, &[131587]);     // 783 => [131587]
            map.insert(801, &[262659]);     // 801 => [262659]
            map.insert(462, &[524803]);     // 462 => [524803]
            map.insert(573, &[4194819]);     // 573 => [4194819]
            map.insert(965, &[8389123]);     // 965 => [8389123]
            map.insert(836, &[3075]);     // 836 => [3075]
            map.insert(730, &[5123]);     // 730 => [5123]
            map.insert(429, &[17411]);     // 429 => [17411]
            map.insert(411, &[33795]);     // 411 => [33795]
            map.insert(29, &[66563]);     // 29 => [66563]
            map.insert(1023, &[132099]);     // 1023 => [132099]
            map.insert(977, &[263171]);     // 977 => [263171]
            map.insert(318, &[525315]);     // 318 => [525315]
            map.insert(559, &[1049603]);     // 559 => [1049603]
            map.insert(821, &[8389635]);     // 821 => [8389635]
            map.insert(78, &[10243]);     // 78 => [10243]
            map.insert(858, &[67587]);     // 858 => [67587]
            map.insert(184, &[133123]);     // 184 => [133123]
            map.insert(150, &[264195]);     // 150 => [264195]
            map.insert(394, &[4196355]);     // 394 => [4196355]
            map.insert(834, &[36867]);     // 834 => [36867]
            map.insert(708, &[69635]);     // 708 => [69635]
            map.insert(999, &[528387]);     // 999 => [528387]
            map.insert(492, &[8392707]);     // 492 => [8392707]
            map.insert(679, &[24579]);     // 679 => [24579]
            map.insert(791, &[73731]);     // 791 => [73731]
            map.insert(564, &[532483]);     // 564 => [532483]
            map.insert(826, &[2105347]);     // 826 => [2105347]
            map.insert(63, &[8396803]);     // 63 => [8396803]
            map.insert(53, &[49155]);     // 53 => [49155]
            map.insert(639, &[278531]);     // 639 => [278531]
            map.insert(389, &[98307]);     // 389 => [98307]
            map.insert(615, &[163843]);     // 615 => [163843]
            map.insert(166, &[557059]);     // 166 => [557059]
            map.insert(424, &[2129923]);     // 424 => [2129923]
            map.insert(853, &[4227075]);     // 853 => [4227075]
            map.insert(685, &[8421379]);     // 685 => [8421379]
            map.insert(723, &[4259843]);     // 723 => [4259843]
            map.insert(706, &[655363]);     // 706 => [655363]
            map.insert(305, &[4325379]);     // 305 => [4325379]
            map.insert(748, &[786435]);     // 748 => [786435]
            map.insert(509, &[1310723]);     // 509 => [1310723]
            map.insert(287, &[4456451]);     // 287 => [4456451]
            map.insert(231, &[8650755]);     // 231 => [8650755]
            map.insert(786, &[1572867]);     // 786 => [1572867]
            map.insert(269, &[2621443]);     // 269 => [2621443]
            map.insert(1008, &[4718595]);     // 1008 => [4718595]
            map.insert(540, &[3145731]);     // 540 => [3145731]
            map.insert(766, &[6291459]);     // 766 => [6291459]
            map.insert(774, &[10485763]);     // 774 => [10485763]
            map.insert(507, &[12582915]);     // 507 => [12582915]
            map.insert(141, &[141]);     // 141 => [141]
            map.insert(442, &[525]);     // 442 => [525]
            map.insert(915, &[4109]);     // 915 => [4109]
            map.insert(210, &[32781]);     // 210 => [32781]
            map.insert(870, &[1048589]);     // 870 => [1048589]
            map.insert(900, &[4194317]);     // 900 => [4194317]
            map.insert(85, &[85]);     // 85 => [85]
            map.insert(277, &[277]);     // 277 => [277]
            map.insert(418, &[533]);     // 418 => [533]
            map.insert(600, &[8213]);     // 600 => [8213]
            map.insert(111, &[524309]);     // 111 => [524309]
            map.insert(894, &[1048597]);     // 894 => [1048597]
            map.insert(353, &[2097173]);     // 353 => [2097173]
            map.insert(101, &[101]);     // 101 => [101]
            map.insert(402, &[549]);     // 402 => [549]
            map.insert(354, &[1061]);     // 354 => [1061]
            map.insert(549, &[2085]);     // 549 => [2085]
            map.insert(940, &[4194341]);     // 940 => [4194341]
            map.insert(596, &[8388645]);     // 596 => [8388645]
            map.insert(197, &[197]);     // 197 => [197]
            map.insert(498, &[581]);     // 498 => [581]
            map.insert(987, &[4165]);     // 987 => [4165]
            map.insert(172, &[16453]);     // 172 => [16453]
            map.insert(154, &[32837]);     // 154 => [32837]
            map.insert(814, &[1048645]);     // 814 => [1048645]
            map.insert(450, &[1157]);     // 450 => [1157]
            map.insert(795, &[4229]);     // 795 => [4229]
            map.insert(712, &[8325]);     // 712 => [8325]
            map.insert(108, &[16517]);     // 108 => [16517]
            map.insert(1006, &[1048709]);     // 1006 => [1048709]
            map.insert(497, &[2097285]);     // 497 => [2097285]
            map.insert(756, &[8388741]);     // 756 => [8388741]
            map.insert(178, &[773]);     // 178 => [773]
            map.insert(912, &[262405]);     // 912 => [262405]
            map.insert(652, &[4194565]);     // 652 => [4194565]
            map.insert(946, &[2565]);     // 946 => [2565]
            map.insert(365, &[33285]);     // 365 => [33285]
            map.insert(807, &[262661]);     // 807 => [262661]
            map.insert(456, &[524805]);     // 456 => [524805]
            map.insert(198, &[2097669]);     // 198 => [2097669]
            map.insert(963, &[8389125]);     // 963 => [8389125]
            map.insert(983, &[263173]);     // 983 => [263173]
            map.insert(312, &[525317]);     // 312 => [525317]
            map.insert(715, &[4195333]);     // 715 => [4195333]
            map.insert(819, &[8389637]);     // 819 => [8389637]
            map.insert(860, &[67589]);     // 860 => [67589]
            map.insert(190, &[133125]);     // 190 => [133125]
            map.insert(366, &[1050629]);     // 366 => [1050629]
            map.insert(396, &[4196357]);     // 396 => [4196357]
            map.insert(470, &[12293]);     // 470 => [12293]
            map.insert(673, &[24581]);     // 673 => [24581]
            map.insert(828, &[2105349]);     // 828 => [2105349]
            map.insert(449, &[4202501]);     // 449 => [4202501]
            map.insert(599, &[147461]);     // 599 => [147461]
            map.insert(903, &[1064965]);     // 903 => [1064965]
            map.insert(869, &[4210693]);     // 869 => [4210693]
            map.insert(945, &[1081349]);     // 945 => [1081349]
            map.insert(851, &[4227077]);     // 851 => [4227077]
            map.insert(813, &[8454149]);     // 813 => [8454149]
            map.insert(469, &[1179653]);     // 469 => [1179653]
            map.insert(1014, &[4718597]);     // 1014 => [4718597]
            map.insert(538, &[3145733]);     // 538 => [3145733]
            map.insert(153, &[153]);     // 153 => [153]
            map.insert(537, &[2073]);     // 537 => [2073]
            map.insert(674, &[131097]);     // 674 => [131097]
            map.insert(297, &[297]);     // 297 => [297]
            map.insert(928, &[4194345]);     // 928 => [4194345]
            map.insert(960, &[4194377]);     // 960 => [4194377]
            map.insert(86, &[32905]);     // 86 => [32905]
            map.insert(480, &[16649]);     // 480 => [16649]
            map.insert(401, &[33801]);     // 401 => [33801]
            map.insert(1013, &[132105]);     // 1013 => [132105]
            map.insert(831, &[8389641]);     // 831 => [8389641]
            map.insert(736, &[18441]);     // 736 => [18441]
            map.insert(848, &[67593]);     // 848 => [67593]
            map.insert(893, &[2099209]);     // 893 => [2099209]
            map.insert(300, &[135177]);     // 300 => [135177]
            map.insert(1005, &[528393]);     // 1005 => [528393]
            map.insert(739, &[2101257]);     // 739 => [2101257]
            map.insert(486, &[8392713]);     // 486 => [8392713]
            map.insert(209, &[270345]);     // 209 => [270345]
            map.insert(303, &[1056777]);     // 303 => [1056777]
            map.insert(816, &[2105353]);     // 816 => [2105353]
            map.insert(441, &[81929]);     // 441 => [81929]
            map.insert(603, &[147465]);     // 603 => [147465]
            map.insert(399, &[98313]);     // 399 => [98313]
            map.insert(863, &[4227081]);     // 863 => [4227081]
            map.insert(298, &[589833]);     // 298 => [589833]
            map.insert(315, &[4325385]);     // 315 => [4325385]
            map.insert(742, &[786441]);     // 742 => [786441]
            map.insert(792, &[1572873]);     // 792 => [1572873]
            map.insert(177, &[177]);     // 177 => [177]
            map.insert(943, &[4145]);     // 943 => [4145]
            map.insert(278, &[1105]);     // 278 => [1105]
            map.insert(142, &[32849]);     // 142 => [32849]
            map.insert(984, &[4194385]);     // 984 => [4194385]
            map.insert(485, &[2097297]);     // 485 => [2097297]
            map.insert(655, &[4369]);     // 655 => [4369]
            map.insert(934, &[2577]);     // 934 => [2577]
            map.insert(550, &[532497]);     // 550 => [532497]
            map.insert(417, &[81937]);     // 417 => [81937]
            map.insert(933, &[1081361]);     // 933 => [1081361]
            map.insert(102, &[1313]);     // 102 => [1313]
            map.insert(931, &[1064993]);     // 931 => [1064993]
            map.insert(804, &[10485793]);     // 804 => [10485793]
            map.insert(980, &[262465]);     // 980 => [262465]
            map.insert(175, &[66113]);     // 175 => [66113]
            map.insert(741, &[24641]);     // 741 => [24641]
            map.insert(189, &[8396929]);     // 189 => [8396929]
            map.insert(459, &[8519937]);     // 459 => [8519937]
            map.insert(483, &[5243137]);     // 483 => [5243137]
            map.insert(759, &[37377]);     // 759 => [37377]
            
            SYNDROME_MAP = Box::into_raw(map);
        }
    });
}

impl GuavaCode24_14 {
    fn parity_check_matrix_transposed(&self) -> &BinMatrix {
        init();
        unsafe {
            PARITY_MATRIX_T.as_ref().unwrap()
        }
    }
}

impl BinaryCode for GuavaCode24_14 {
    fn name(&self) -> String {
        "[24, 14] Guava code".to_owned()
    }

    fn length(&self) -> usize {
        24
    }

    fn dimension(&self) -> usize {
        14
    }

    fn generator_matrix(&self) -> &BinMatrix {
        init();
        unsafe {
            GENERATOR_MATRIX.as_ref().unwrap()
        }
    }

    fn parity_check_matrix(&self) -> &BinMatrix {
        init();
        unsafe {
            PARITY_MATRIX.as_ref().unwrap()
        }
    }

    fn decode_to_code(&self, c: &BinVector) -> Result<BinVector, &str> {
        init();
        let map = unsafe {
            SYNDROME_MAP.as_ref().unwrap()
        };
        debug_assert_eq!(c.len(), self.length(), "the length doesn't match the expected length (length of the code)");
        let he = c * self.parity_check_matrix_transposed();
        let mut error = BinVector::with_capacity(24);
        let stor = unsafe { error.get_storage_mut() };
        let errbytes = map[&he.as_u64()];
        debug_assert_eq!(errbytes.len(), 24 / 64 + if 24 % 64 != 0 { 1 } else { 0 });
        stor.clear();
        stor.extend_from_slice(&errbytes[..]);
        unsafe { error.set_len(24) };
        debug_assert_eq!(error.len(), self.length(), "internal: the error vector is of the wrong length");
        let result = c + &error;
        debug_assert_eq!(result.len(), self.length(), "internal: the result vector is of the wrong length");
        debug_assert_eq!((&result * self.parity_check_matrix_transposed()).count_ones(), 0);
        Ok(result)
    }

    fn decode_to_message(&self, c: &BinVector) -> Result<BinVector, &str> {
        
        let mut codeword = self.decode_to_code(c)?;
        codeword.truncate(14);
        Ok(codeword)
        
    }

    fn decode_slice(&self, c: &mut [u64]) {
        init();
        
        debug_assert_eq!(c[24 / 64] & !((1 << 24) - 1), 0, "this message has excess bits");

        let map = unsafe {
            SYNDROME_MAP.as_ref().unwrap()
        };
        let he = &BinMatrix::from_slices(&[&c[..]], self.length()) * self.parity_check_matrix_transposed();
        let error = map[unsafe { &he.get_word_unchecked(0, 0) }];
        c.iter_mut().zip(error.iter().copied()).for_each(|(sample, error)| *sample ^= error as u64);
    }

    
}

#[cfg(test)]
mod tests {
    use super::*;
    use m4ri_rust::friendly::BinVector;
    use crate::oracle::Sample;

    #[test]
    fn size() {
        let code = GuavaCode24_14.generator_matrix();
        assert_eq!(code.ncols(), 24);
        assert_eq!(code.nrows(), 14);
    }

    #[test]
    fn test_decode_sample() {
        let code = GuavaCode24_14;
        for _ in 0..1000 {
            // setup
            let vec = BinVector::random(code.length());
            let mut sample_a = Sample::from_binvector(&vec, false);
            let mut sample_b = Sample::from_binvector(&vec, true);
            
            let decoded_vec = code.decode_to_message(&vec).unwrap();
            println!("decoded_vec: {:?}", decoded_vec);

            // test vectors
            let decoded_vec_sample_a = Sample::from_binvector(&decoded_vec, false);
            let decoded_vec_sample_b = Sample::from_binvector(&decoded_vec, true);

            code.decode_sample(&mut sample_a);
            code.decode_sample(&mut sample_b);
            assert_eq!(sample_a.get_product(), false);
            assert_eq!(sample_b.get_product(), true);
            assert_eq!(sample_a, decoded_vec_sample_a);
            assert_eq!(sample_b, decoded_vec_sample_b);
        }
    }

    #[test]
    fn random_decode_tests() {

        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[false, true, true, false, true, false, false, true, false, false, false, false, false, true, true, true, true, true, false, true, false, true, false, true]);
            let codeword = BinVector::from_bools(&[true, true, true, false, true, false, false, true, false, false, false, false, false, true, true, true, true, true, false, true, false, true, false, false]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[false, true, true, true, true, false, true, false, true, false, true, false, true, false, false, false, false, false, false, false, false, true, false, false]);
            let codeword = BinVector::from_bools(&[false, false, true, true, true, false, true, true, true, false, true, false, true, false, false, false, false, false, false, false, false, true, false, true]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[false, false, false, true, true, true, true, true, true, true, true, false, false, true, true, false, true, false, true, true, false, false, true, true]);
            let codeword = BinVector::from_bools(&[false, false, false, true, true, true, true, true, false, true, true, false, false, true, true, false, true, false, true, true, true, false, false, true]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[true, true, true, false, true, false, true, false, false, false, true, true, true, false, true, true, true, false, false, false, false, true, true, false]);
            let codeword = BinVector::from_bools(&[true, false, true, false, true, false, true, true, false, false, true, true, false, false, true, true, true, false, false, false, false, true, true, false]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[false, true, true, false, true, true, false, true, false, true, true, true, false, true, true, false, true, true, true, false, false, true, true, true]);
            let codeword = BinVector::from_bools(&[false, true, true, false, true, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, false, true, true, true]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[true, false, true, false, false, true, false, true, false, true, true, true, true, false, false, true, false, true, true, true, false, true, false, false]);
            let codeword = BinVector::from_bools(&[true, true, true, false, false, true, false, true, false, true, true, true, true, false, true, false, false, true, true, true, false, true, false, false]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[true, true, false, true, true, true, true, true, false, false, false, false, false, true, true, true, false, true, true, true, false, true, false, false]);
            let codeword = BinVector::from_bools(&[false, true, false, false, true, false, true, true, false, false, false, false, false, true, true, true, false, true, true, true, false, true, true, false]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[true, true, true, true, false, false, true, true, true, false, true, false, false, false, true, true, true, false, false, false, true, false, true, false]);
            let codeword = BinVector::from_bools(&[false, true, false, true, false, false, true, true, false, false, true, false, false, false, true, true, true, false, false, false, true, false, true, false]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[false, false, true, true, false, true, true, false, true, false, true, false, false, false, true, false, false, false, true, true, false, true, false, true]);
            let codeword = BinVector::from_bools(&[false, false, true, false, false, false, true, false, false, false, true, false, false, false, true, false, false, false, true, true, false, true, false, true]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[false, false, true, false, true, true, false, false, true, true, false, true, false, true, false, false, true, false, false, true, false, true, true, true]);
            let codeword = BinVector::from_bools(&[true, false, false, false, false, true, false, false, true, true, false, true, false, true, false, false, true, false, false, true, false, false, true, true]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[false, false, true, true, true, true, false, false, false, true, true, false, false, true, false, true, false, true, false, true, true, false, false, true]);
            let codeword = BinVector::from_bools(&[true, true, true, true, true, true, false, false, false, true, true, false, false, true, false, false, true, true, false, true, true, false, false, true]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[true, false, false, false, false, true, false, false, false, false, false, false, false, true, false, true, true, false, false, false, false, false, false, true]);
            let codeword = BinVector::from_bools(&[false, true, false, false, false, true, false, false, false, false, true, false, false, true, false, false, true, false, false, false, false, false, false, true]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[true, false, false, false, false, false, true, false, false, true, true, true, true, true, true, true, true, false, true, false, true, false, false, true]);
            let codeword = BinVector::from_bools(&[true, true, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, false, true, false, true, false, false, true]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[false, true, false, true, false, true, false, true, true, false, false, false, false, false, true, false, false, false, true, false, false, true, false, true]);
            let codeword = BinVector::from_bools(&[false, true, true, false, false, true, false, true, true, false, false, false, false, false, true, true, false, false, true, false, false, true, false, true]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[true, false, true, false, true, false, false, true, false, true, true, true, false, true, true, true, false, false, true, true, false, true, true, true]);
            let codeword = BinVector::from_bools(&[false, false, true, false, true, false, false, true, false, true, true, true, false, true, false, true, false, false, false, true, false, true, true, true]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[false, false, false, false, true, true, false, false, true, false, true, true, true, false, false, true, false, true, true, true, true, false, true, false]);
            let codeword = BinVector::from_bools(&[false, false, false, false, true, true, false, true, false, false, true, true, true, false, false, true, false, true, true, true, true, false, true, false]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[true, true, true, false, false, true, true, true, false, true, true, true, true, false, false, true, true, false, true, true, false, true, false, false]);
            let codeword = BinVector::from_bools(&[false, true, true, false, false, true, true, true, true, true, true, true, true, false, false, true, true, false, false, true, false, true, false, false]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[true, false, true, false, false, true, false, false, false, false, false, true, false, true, true, true, true, true, false, false, false, false, false, true]);
            let codeword = BinVector::from_bools(&[true, false, true, false, false, true, false, false, false, true, false, true, false, true, true, true, true, true, false, true, false, false, false, true]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[false, false, true, true, true, false, false, false, true, false, true, true, true, true, false, true, false, true, false, true, true, true, true, true]);
            let codeword = BinVector::from_bools(&[false, false, true, true, true, false, false, false, true, false, true, true, true, true, false, true, false, true, false, true, true, true, true, false]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
        {
            let code = GuavaCode24_14;
            let randvec = BinVector::from_bools(&[true, false, false, false, false, false, true, true, true, true, true, false, true, false, false, false, false, false, true, false, false, true, false, true]);
            let codeword = BinVector::from_bools(&[false, false, false, true, false, false, true, true, true, true, false, false, true, false, false, false, false, false, true, false, false, true, false, false]);
            assert_eq!(code.decode_to_code(&randvec), Ok(codeword));
        }
        
    }

    #[test]
    fn test_generator_representation() {
        init();
        let generator_matrix = unsafe { GENERATOR_MATRIX.as_ref().unwrap() };
        let first_row = generator_matrix.get_window(0, 0, 1, generator_matrix.ncols());
        let vector = BinVector::from_bools(&[ true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, true, false, true, true, true, false, false ]);
        assert_eq!(vector, first_row.as_vector());
    }

}