flint-sys 0.9.0

Bindings to the FLINT C library
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
/* automatically generated by rust-bindgen 0.70.1 */

use libc::*;
use crate::deps::*;
use crate::flint::*;
use crate::fmpz_types::*;


#[repr(C)]
pub struct _fmpz_multi_CRT_instr {
    pub a_idx: slong,
    pub b_idx: slong,
    pub c_idx: slong,
    pub b_modulus: fmpz_t,
    pub c_modulus: fmpz_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of _fmpz_multi_CRT_instr"][::std::mem::size_of::<_fmpz_multi_CRT_instr>() - 40usize];
    ["Alignment of _fmpz_multi_CRT_instr"]
        [::std::mem::align_of::<_fmpz_multi_CRT_instr>() - 8usize];
    ["Offset of field: _fmpz_multi_CRT_instr::a_idx"]
        [::std::mem::offset_of!(_fmpz_multi_CRT_instr, a_idx) - 0usize];
    ["Offset of field: _fmpz_multi_CRT_instr::b_idx"]
        [::std::mem::offset_of!(_fmpz_multi_CRT_instr, b_idx) - 8usize];
    ["Offset of field: _fmpz_multi_CRT_instr::c_idx"]
        [::std::mem::offset_of!(_fmpz_multi_CRT_instr, c_idx) - 16usize];
    ["Offset of field: _fmpz_multi_CRT_instr::b_modulus"]
        [::std::mem::offset_of!(_fmpz_multi_CRT_instr, b_modulus) - 24usize];
    ["Offset of field: _fmpz_multi_CRT_instr::c_modulus"]
        [::std::mem::offset_of!(_fmpz_multi_CRT_instr, c_modulus) - 32usize];
};
impl Default for _fmpz_multi_CRT_instr {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[repr(C)]
pub struct fmpz_multi_CRT_struct {
    pub prog: *mut _fmpz_multi_CRT_instr,
    pub moduli: *mut fmpz,
    pub fracmoduli: *mut fmpz,
    pub final_modulus: fmpz_t,
    pub moduli_count: slong,
    pub min_modulus_bits: flint_bitcnt_t,
    pub length: slong,
    pub alloc: slong,
    pub localsize: slong,
    pub temp1loc: slong,
    pub temp2loc: slong,
    pub temp3loc: slong,
    pub temp4loc: slong,
    pub good: libc::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fmpz_multi_CRT_struct"][::std::mem::size_of::<fmpz_multi_CRT_struct>() - 112usize];
    ["Alignment of fmpz_multi_CRT_struct"]
        [::std::mem::align_of::<fmpz_multi_CRT_struct>() - 8usize];
    ["Offset of field: fmpz_multi_CRT_struct::prog"]
        [::std::mem::offset_of!(fmpz_multi_CRT_struct, prog) - 0usize];
    ["Offset of field: fmpz_multi_CRT_struct::moduli"]
        [::std::mem::offset_of!(fmpz_multi_CRT_struct, moduli) - 8usize];
    ["Offset of field: fmpz_multi_CRT_struct::fracmoduli"]
        [::std::mem::offset_of!(fmpz_multi_CRT_struct, fracmoduli) - 16usize];
    ["Offset of field: fmpz_multi_CRT_struct::final_modulus"]
        [::std::mem::offset_of!(fmpz_multi_CRT_struct, final_modulus) - 24usize];
    ["Offset of field: fmpz_multi_CRT_struct::moduli_count"]
        [::std::mem::offset_of!(fmpz_multi_CRT_struct, moduli_count) - 32usize];
    ["Offset of field: fmpz_multi_CRT_struct::min_modulus_bits"]
        [::std::mem::offset_of!(fmpz_multi_CRT_struct, min_modulus_bits) - 40usize];
    ["Offset of field: fmpz_multi_CRT_struct::length"]
        [::std::mem::offset_of!(fmpz_multi_CRT_struct, length) - 48usize];
    ["Offset of field: fmpz_multi_CRT_struct::alloc"]
        [::std::mem::offset_of!(fmpz_multi_CRT_struct, alloc) - 56usize];
    ["Offset of field: fmpz_multi_CRT_struct::localsize"]
        [::std::mem::offset_of!(fmpz_multi_CRT_struct, localsize) - 64usize];
    ["Offset of field: fmpz_multi_CRT_struct::temp1loc"]
        [::std::mem::offset_of!(fmpz_multi_CRT_struct, temp1loc) - 72usize];
    ["Offset of field: fmpz_multi_CRT_struct::temp2loc"]
        [::std::mem::offset_of!(fmpz_multi_CRT_struct, temp2loc) - 80usize];
    ["Offset of field: fmpz_multi_CRT_struct::temp3loc"]
        [::std::mem::offset_of!(fmpz_multi_CRT_struct, temp3loc) - 88usize];
    ["Offset of field: fmpz_multi_CRT_struct::temp4loc"]
        [::std::mem::offset_of!(fmpz_multi_CRT_struct, temp4loc) - 96usize];
    ["Offset of field: fmpz_multi_CRT_struct::good"]
        [::std::mem::offset_of!(fmpz_multi_CRT_struct, good) - 104usize];
};
impl Default for fmpz_multi_CRT_struct {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type fmpz_multi_CRT_t = [fmpz_multi_CRT_struct; 1usize];
#[repr(C)]
pub struct _fmpz_multi_mod_instr {
    pub in_idx: slong,
    pub out_idx: slong,
    pub modulus: fmpz_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of _fmpz_multi_mod_instr"][::std::mem::size_of::<_fmpz_multi_mod_instr>() - 24usize];
    ["Alignment of _fmpz_multi_mod_instr"]
        [::std::mem::align_of::<_fmpz_multi_mod_instr>() - 8usize];
    ["Offset of field: _fmpz_multi_mod_instr::in_idx"]
        [::std::mem::offset_of!(_fmpz_multi_mod_instr, in_idx) - 0usize];
    ["Offset of field: _fmpz_multi_mod_instr::out_idx"]
        [::std::mem::offset_of!(_fmpz_multi_mod_instr, out_idx) - 8usize];
    ["Offset of field: _fmpz_multi_mod_instr::modulus"]
        [::std::mem::offset_of!(_fmpz_multi_mod_instr, modulus) - 16usize];
};
impl Default for _fmpz_multi_mod_instr {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[repr(C)]
pub struct fmpz_multi_mod_struct {
    pub prog: *mut _fmpz_multi_mod_instr,
    pub moduli: *mut fmpz,
    pub moduli_count: slong,
    pub min_modulus_bits: flint_bitcnt_t,
    pub length: slong,
    pub alloc: slong,
    pub localsize: slong,
    pub temp1loc: slong,
    pub good: libc::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fmpz_multi_mod_struct"][::std::mem::size_of::<fmpz_multi_mod_struct>() - 72usize];
    ["Alignment of fmpz_multi_mod_struct"]
        [::std::mem::align_of::<fmpz_multi_mod_struct>() - 8usize];
    ["Offset of field: fmpz_multi_mod_struct::prog"]
        [::std::mem::offset_of!(fmpz_multi_mod_struct, prog) - 0usize];
    ["Offset of field: fmpz_multi_mod_struct::moduli"]
        [::std::mem::offset_of!(fmpz_multi_mod_struct, moduli) - 8usize];
    ["Offset of field: fmpz_multi_mod_struct::moduli_count"]
        [::std::mem::offset_of!(fmpz_multi_mod_struct, moduli_count) - 16usize];
    ["Offset of field: fmpz_multi_mod_struct::min_modulus_bits"]
        [::std::mem::offset_of!(fmpz_multi_mod_struct, min_modulus_bits) - 24usize];
    ["Offset of field: fmpz_multi_mod_struct::length"]
        [::std::mem::offset_of!(fmpz_multi_mod_struct, length) - 32usize];
    ["Offset of field: fmpz_multi_mod_struct::alloc"]
        [::std::mem::offset_of!(fmpz_multi_mod_struct, alloc) - 40usize];
    ["Offset of field: fmpz_multi_mod_struct::localsize"]
        [::std::mem::offset_of!(fmpz_multi_mod_struct, localsize) - 48usize];
    ["Offset of field: fmpz_multi_mod_struct::temp1loc"]
        [::std::mem::offset_of!(fmpz_multi_mod_struct, temp1loc) - 56usize];
    ["Offset of field: fmpz_multi_mod_struct::good"]
        [::std::mem::offset_of!(fmpz_multi_mod_struct, good) - 64usize];
};
impl Default for fmpz_multi_mod_struct {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type fmpz_multi_mod_t = [fmpz_multi_mod_struct; 1usize];
#[repr(C)]
pub struct crt_lut_entry {
    pub mod_: nmod_t,
    pub i0: ulong,
    pub i1: ulong,
    pub i2: ulong,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of crt_lut_entry"][::std::mem::size_of::<crt_lut_entry>() - 48usize];
    ["Alignment of crt_lut_entry"][::std::mem::align_of::<crt_lut_entry>() - 8usize];
    ["Offset of field: crt_lut_entry::mod_"][::std::mem::offset_of!(crt_lut_entry, mod_) - 0usize];
    ["Offset of field: crt_lut_entry::i0"][::std::mem::offset_of!(crt_lut_entry, i0) - 24usize];
    ["Offset of field: crt_lut_entry::i1"][::std::mem::offset_of!(crt_lut_entry, i1) - 32usize];
    ["Offset of field: crt_lut_entry::i2"][::std::mem::offset_of!(crt_lut_entry, i2) - 40usize];
};
impl Default for crt_lut_entry {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[repr(C)]
pub struct mod_lut_entry {
    pub mod_: nmod_t,
    pub mod0: nmod_t,
    pub mod1: nmod_t,
    pub mod2: nmod_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of mod_lut_entry"][::std::mem::size_of::<mod_lut_entry>() - 96usize];
    ["Alignment of mod_lut_entry"][::std::mem::align_of::<mod_lut_entry>() - 8usize];
    ["Offset of field: mod_lut_entry::mod_"][::std::mem::offset_of!(mod_lut_entry, mod_) - 0usize];
    ["Offset of field: mod_lut_entry::mod0"][::std::mem::offset_of!(mod_lut_entry, mod0) - 24usize];
    ["Offset of field: mod_lut_entry::mod1"][::std::mem::offset_of!(mod_lut_entry, mod1) - 48usize];
    ["Offset of field: mod_lut_entry::mod2"][::std::mem::offset_of!(mod_lut_entry, mod2) - 72usize];
};
impl Default for mod_lut_entry {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[repr(C)]
pub struct fmpz_comb_struct {
    pub crt_P: fmpz_multi_CRT_t,
    pub mod_P: fmpz_multi_mod_t,
    pub packed_multipliers: *mut ulong,
    pub step: *mut slong,
    pub crt_offsets: *mut slong,
    pub crt_offsets_alloc: slong,
    pub mod_offsets: *mut slong,
    pub mod_offsets_alloc: slong,
    pub crt_lu: *mut crt_lut_entry,
    pub crt_lu_alloc: slong,
    pub crt_klen: slong,
    pub mod_lu: *mut mod_lut_entry,
    pub mod_lu_alloc: slong,
    pub mod_klen: slong,
    pub num_primes: slong,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fmpz_comb_struct"][::std::mem::size_of::<fmpz_comb_struct>() - 288usize];
    ["Alignment of fmpz_comb_struct"][::std::mem::align_of::<fmpz_comb_struct>() - 8usize];
    ["Offset of field: fmpz_comb_struct::crt_P"]
        [::std::mem::offset_of!(fmpz_comb_struct, crt_P) - 0usize];
    ["Offset of field: fmpz_comb_struct::mod_P"]
        [::std::mem::offset_of!(fmpz_comb_struct, mod_P) - 112usize];
    ["Offset of field: fmpz_comb_struct::packed_multipliers"]
        [::std::mem::offset_of!(fmpz_comb_struct, packed_multipliers) - 184usize];
    ["Offset of field: fmpz_comb_struct::step"]
        [::std::mem::offset_of!(fmpz_comb_struct, step) - 192usize];
    ["Offset of field: fmpz_comb_struct::crt_offsets"]
        [::std::mem::offset_of!(fmpz_comb_struct, crt_offsets) - 200usize];
    ["Offset of field: fmpz_comb_struct::crt_offsets_alloc"]
        [::std::mem::offset_of!(fmpz_comb_struct, crt_offsets_alloc) - 208usize];
    ["Offset of field: fmpz_comb_struct::mod_offsets"]
        [::std::mem::offset_of!(fmpz_comb_struct, mod_offsets) - 216usize];
    ["Offset of field: fmpz_comb_struct::mod_offsets_alloc"]
        [::std::mem::offset_of!(fmpz_comb_struct, mod_offsets_alloc) - 224usize];
    ["Offset of field: fmpz_comb_struct::crt_lu"]
        [::std::mem::offset_of!(fmpz_comb_struct, crt_lu) - 232usize];
    ["Offset of field: fmpz_comb_struct::crt_lu_alloc"]
        [::std::mem::offset_of!(fmpz_comb_struct, crt_lu_alloc) - 240usize];
    ["Offset of field: fmpz_comb_struct::crt_klen"]
        [::std::mem::offset_of!(fmpz_comb_struct, crt_klen) - 248usize];
    ["Offset of field: fmpz_comb_struct::mod_lu"]
        [::std::mem::offset_of!(fmpz_comb_struct, mod_lu) - 256usize];
    ["Offset of field: fmpz_comb_struct::mod_lu_alloc"]
        [::std::mem::offset_of!(fmpz_comb_struct, mod_lu_alloc) - 264usize];
    ["Offset of field: fmpz_comb_struct::mod_klen"]
        [::std::mem::offset_of!(fmpz_comb_struct, mod_klen) - 272usize];
    ["Offset of field: fmpz_comb_struct::num_primes"]
        [::std::mem::offset_of!(fmpz_comb_struct, num_primes) - 280usize];
};
impl Default for fmpz_comb_struct {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type fmpz_comb_t = [fmpz_comb_struct; 1usize];
#[repr(C)]
pub struct fmpz_comb_temp_struct {
    pub Alen: slong,
    pub Tlen: slong,
    pub A: *mut fmpz,
    pub T: *mut fmpz,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fmpz_comb_temp_struct"][::std::mem::size_of::<fmpz_comb_temp_struct>() - 32usize];
    ["Alignment of fmpz_comb_temp_struct"]
        [::std::mem::align_of::<fmpz_comb_temp_struct>() - 8usize];
    ["Offset of field: fmpz_comb_temp_struct::Alen"]
        [::std::mem::offset_of!(fmpz_comb_temp_struct, Alen) - 0usize];
    ["Offset of field: fmpz_comb_temp_struct::Tlen"]
        [::std::mem::offset_of!(fmpz_comb_temp_struct, Tlen) - 8usize];
    ["Offset of field: fmpz_comb_temp_struct::A"]
        [::std::mem::offset_of!(fmpz_comb_temp_struct, A) - 16usize];
    ["Offset of field: fmpz_comb_temp_struct::T"]
        [::std::mem::offset_of!(fmpz_comb_temp_struct, T) - 24usize];
};
impl Default for fmpz_comb_temp_struct {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type fmpz_comb_temp_t = [fmpz_comb_temp_struct; 1usize];
extern "C" {
    pub fn _fmpz_new_mpz() -> mpz_ptr;
    pub fn _fmpz_promote(f: *mut fmpz) -> mpz_ptr;
    pub fn _fmpz_promote_val(f: *mut fmpz) -> mpz_ptr;
    pub fn _fmpz_init_readonly_mpz(f: *mut fmpz, z: *const __mpz_struct);
    pub fn flint_mpz_init_set_readonly(z: *mut __mpz_struct, f: *const fmpz);
    pub fn fmpz_init_set_readonly(f: *mut fmpz, z: *const __mpz_struct);
    pub fn flint_mpz_clear_readonly(z: *mut __mpz_struct);
    pub fn _fmpz_clear_readonly_mpz(z: *mut __mpz_struct);
    pub fn _fmpz_clear_mpz(f: fmpz);
    pub fn _fmpz_cleanup_mpz_content();
    pub fn _fmpz_cleanup();
    #[link_name = "_fmpz_demote__extern"]
    pub fn _fmpz_demote(f: *mut fmpz);
    pub fn _fmpz_demote_val(f: *mut fmpz);
    #[link_name = "fmpz_init__extern"]
    pub fn fmpz_init(f: *mut fmpz);
    #[link_name = "fmpz_clear__extern"]
    pub fn fmpz_clear(f: *mut fmpz);
    pub fn fmpz_init2(f: *mut fmpz, limbs: ulong);
    pub fn _fmpz_promote_set_ui(f: *mut fmpz, v: ulong);
    pub fn _fmpz_promote_set_si(f: *mut fmpz, v: slong);
    pub fn _fmpz_promote_neg_ui(f: *mut fmpz, v: ulong);
    pub fn _fmpz_promote_set_uiui(f: *mut fmpz, hi: ulong, lo: ulong);
    pub fn _fmpz_promote_neg_uiui(f: *mut fmpz, hi: ulong, lo: ulong);
    pub fn _fmpz_init_promote_set_ui(f: *mut fmpz, v: ulong);
    pub fn _fmpz_init_promote_set_si(f: *mut fmpz, v: slong);
    pub fn fmpz_set(f: *mut fmpz, g: *const fmpz);
    #[link_name = "fmpz_init_set__extern"]
    pub fn fmpz_init_set(f: *mut fmpz, g: *const fmpz);
    #[link_name = "fmpz_init_set_ui__extern"]
    pub fn fmpz_init_set_ui(f: *mut fmpz, g: ulong);
    #[link_name = "fmpz_init_set_si__extern"]
    pub fn fmpz_init_set_si(f: *mut fmpz, g: slong);
    pub fn fmpz_clear_readonly(f: *mut fmpz);
    pub fn _fmpz_is_canonical(x: *const fmpz) -> libc::c_int;
    pub fn fmpz_randbits_unsigned(
        f: *mut fmpz,
        state: *mut flint_rand_struct,
        bits: flint_bitcnt_t,
    );
    pub fn fmpz_randbits(f: *mut fmpz, state: *mut flint_rand_struct, bits: flint_bitcnt_t);
    pub fn fmpz_randm(f: *mut fmpz, state: *mut flint_rand_struct, m: *const fmpz);
    pub fn fmpz_randtest(f: *mut fmpz, state: *mut flint_rand_struct, bits: flint_bitcnt_t);
    pub fn fmpz_randtest_unsigned(
        f: *mut fmpz,
        state: *mut flint_rand_struct,
        bits: flint_bitcnt_t,
    );
    pub fn fmpz_randtest_not_zero(
        f: *mut fmpz,
        state: *mut flint_rand_struct,
        bits: flint_bitcnt_t,
    );
    pub fn fmpz_randtest_mod(f: *mut fmpz, state: *mut flint_rand_struct, m: *const fmpz);
    pub fn fmpz_randtest_mod_signed(f: *mut fmpz, state: *mut flint_rand_struct, m: *const fmpz);
    pub fn fmpz_randprime(
        f: *mut fmpz,
        state: *mut flint_rand_struct,
        bits: flint_bitcnt_t,
        proved: libc::c_int,
    );
    #[link_name = "fmpz_zero__extern"]
    pub fn fmpz_zero(f: *mut fmpz);
    #[link_name = "fmpz_one__extern"]
    pub fn fmpz_one(f: *mut fmpz);
    #[link_name = "fmpz_swap__extern"]
    pub fn fmpz_swap(f: *mut fmpz, g: *mut fmpz);
    pub fn fmpz_get_si(f: *const fmpz) -> slong;
    pub fn fmpz_get_ui(f: *const fmpz) -> ulong;
    #[link_name = "fmpz_set_si__extern"]
    pub fn fmpz_set_si(f: *mut fmpz, val: slong);
    #[link_name = "fmpz_set_ui__extern"]
    pub fn fmpz_set_ui(f: *mut fmpz, val: ulong);
    #[link_name = "fmpz_neg_ui__extern"]
    pub fn fmpz_neg_ui(f: *mut fmpz, val: ulong);
    #[link_name = "fmpz_get_uiui__extern"]
    pub fn fmpz_get_uiui(hi: *mut ulong, low: *mut ulong, f: *const fmpz);
    #[link_name = "fmpz_set_uiui__extern"]
    pub fn fmpz_set_uiui(f: *mut fmpz, hi: ulong, lo: ulong);
    #[link_name = "fmpz_neg_uiui__extern"]
    pub fn fmpz_neg_uiui(f: *mut fmpz, hi: ulong, lo: ulong);
    pub fn fmpz_get_signed_uiui(hi: *mut ulong, lo: *mut ulong, x: *const fmpz);
    #[link_name = "fmpz_set_signed_uiui__extern"]
    pub fn fmpz_set_signed_uiui(r: *mut fmpz, hi: ulong, lo: ulong);
    pub fn fmpz_set_signed_uiuiui(r: *mut fmpz, hi: ulong, mid: ulong, lo: ulong);
    pub fn fmpz_get_ui_array(out: *mut ulong, n: slong, in_: *const fmpz);
    pub fn fmpz_set_ui_array(out: *mut fmpz, in_: *const ulong, n: slong);
    pub fn fmpz_get_signed_ui_array(out: *mut ulong, n: slong, in_: *const fmpz);
    pub fn fmpz_set_signed_ui_array(out: *mut fmpz, in_: *const ulong, n: slong);
    pub fn fmpz_set_mpn_large(z: *mut fmpz, src: nn_srcptr, n: slong, negative: libc::c_int);
    pub fn fmpz_get_nmod(f: *const fmpz, mod_: nmod_t) -> ulong;
    pub fn fmpz_get_d(f: *const fmpz) -> f64;
    pub fn fmpz_set_d(f: *mut fmpz, c: f64);
    pub fn fmpz_get_mpz(x: *mut __mpz_struct, f: *const fmpz);
    pub fn fmpz_set_mpz(f: *mut fmpz, x: *const __mpz_struct);
    pub fn fmpz_get_mpf(x: *mut __mpf_struct, f: *const fmpz);
    pub fn fmpz_set_mpf(f: *mut fmpz, x: *const __mpf_struct);
    pub fn fmpz_get_mpfr(x: *mut __mpfr_struct, f: *const fmpz, rnd: mpfr_rnd_t);
    pub fn fmpz_get_mpn(n: *mut nn_ptr, n_in: *mut fmpz) -> libc::c_int;
    #[link_name = "fmpz_is_zero__extern"]
    pub fn fmpz_is_zero(f: *const fmpz) -> libc::c_int;
    #[link_name = "fmpz_is_one__extern"]
    pub fn fmpz_is_one(f: *const fmpz) -> libc::c_int;
    #[link_name = "fmpz_is_pm1__extern"]
    pub fn fmpz_is_pm1(f: *const fmpz) -> libc::c_int;
    pub fn fmpz_equal(f: *const fmpz, g: *const fmpz) -> libc::c_int;
    pub fn fmpz_equal_si(f: *const fmpz, g: slong) -> libc::c_int;
    pub fn fmpz_equal_ui(f: *const fmpz, g: ulong) -> libc::c_int;
    pub fn fmpz_cmp(f: *const fmpz, g: *const fmpz) -> libc::c_int;
    pub fn fmpz_cmp_ui(f: *const fmpz, g: ulong) -> libc::c_int;
    pub fn fmpz_cmp_si(f: *const fmpz, g: slong) -> libc::c_int;
    pub fn fmpz_cmpabs(f: *const fmpz, g: *const fmpz) -> libc::c_int;
    pub fn fmpz_cmp2abs(f: *const fmpz, g: *const fmpz) -> libc::c_int;
    #[link_name = "fmpz_is_even__extern"]
    pub fn fmpz_is_even(f: *const fmpz) -> libc::c_int;
    #[link_name = "fmpz_is_odd__extern"]
    pub fn fmpz_is_odd(f: *const fmpz) -> libc::c_int;
    pub fn fmpz_sgn(f: *const fmpz) -> libc::c_int;
    pub fn fmpz_abs_fits_ui(f: *const fmpz) -> libc::c_int;
    pub fn fmpz_fits_si(f: *const fmpz) -> libc::c_int;
    pub fn fmpz_sizeinbase(f: *const fmpz, b: libc::c_int) -> usize;
    pub fn fmpz_size(f: *const fmpz) -> slong;
    pub fn fmpz_bits(f: *const fmpz) -> flint_bitcnt_t;
    pub fn fmpz_val2(x: *const fmpz) -> flint_bitcnt_t;
    pub fn fmpz_is_square(f: *const fmpz) -> libc::c_int;
    pub fn fmpz_is_perfect_power(root: *mut fmpz, f: *const fmpz) -> libc::c_int;
    pub fn fmpz_abs_ubound_ui_2exp(exp: *mut slong, x: *const fmpz, bits: libc::c_int) -> ulong;
    pub fn fmpz_abs_lbound_ui_2exp(exp: *mut slong, x: *const fmpz, bits: libc::c_int) -> ulong;
    pub fn fmpz_read(f: *mut fmpz) -> libc::c_int;
    pub fn fmpz_print(x: *const fmpz) -> libc::c_int;
    pub fn fmpz_set_str(f: *mut fmpz, str_: *const libc::c_char, b: libc::c_int) -> libc::c_int;
    pub fn fmpz_get_str(
        str_: *mut libc::c_char,
        b: libc::c_int,
        f: *const fmpz,
    ) -> *mut libc::c_char;
    pub fn fmpz_fread(file: *mut FILE, f: *mut fmpz) -> libc::c_int;
    pub fn fmpz_fprint(file: *mut FILE, x: *const fmpz) -> libc::c_int;
    pub fn fmpz_inp_raw(x: *mut fmpz, fin: *mut FILE) -> usize;
    pub fn fmpz_out_raw(fout: *mut FILE, x: *const fmpz) -> usize;
    pub fn fmpz_add(f: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_add_ui(f: *mut fmpz, g: *const fmpz, x: ulong);
    pub fn fmpz_sub(f: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_sub_ui(f: *mut fmpz, g: *const fmpz, x: ulong);
    #[link_name = "fmpz_add_si__extern"]
    pub fn fmpz_add_si(f: *mut fmpz, g: *const fmpz, x: slong);
    #[link_name = "fmpz_sub_si__extern"]
    pub fn fmpz_sub_si(f: *mut fmpz, g: *const fmpz, x: slong);
    pub fn fmpz_abs(f1: *mut fmpz, f2: *const fmpz);
    pub fn fmpz_neg(f1: *mut fmpz, f2: *const fmpz);
    pub fn fmpz_mul_ui(f: *mut fmpz, g: *const fmpz, x: ulong);
    pub fn fmpz_mul_si(f: *mut fmpz, g: *const fmpz, x: slong);
    pub fn fmpz_mul(f: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_mul2_uiui(f: *mut fmpz, g: *const fmpz, h1: ulong, h2: ulong);
    pub fn fmpz_mul_2exp(f: *mut fmpz, g: *const fmpz, exp: ulong);
    pub fn fmpz_one_2exp(f: *mut fmpz, exp: ulong);
    pub fn fmpz_addmul(f: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_addmul_si(f: *mut fmpz, g: *const fmpz, x: slong);
    pub fn fmpz_addmul_ui(f: *mut fmpz, g: *const fmpz, x: ulong);
    pub fn fmpz_submul(f: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_submul_si(f: *mut fmpz, g: *const fmpz, x: slong);
    pub fn fmpz_submul_ui(f: *mut fmpz, g: *const fmpz, x: ulong);
    pub fn fmpz_fmma(f: *mut fmpz, a: *const fmpz, b: *const fmpz, c: *const fmpz, d: *const fmpz);
    pub fn fmpz_fmms(f: *mut fmpz, a: *const fmpz, b: *const fmpz, c: *const fmpz, d: *const fmpz);
    pub fn fmpz_pow_ui(f: *mut fmpz, g: *const fmpz, exp: ulong);
    pub fn fmpz_ui_pow_ui(x: *mut fmpz, b: ulong, e: ulong);
    pub fn fmpz_pow_fmpz(a: *mut fmpz, b: *const fmpz, e: *const fmpz) -> libc::c_int;
    pub fn fmpz_sqrt(f: *mut fmpz, g: *const fmpz);
    pub fn fmpz_sqrtrem(f: *mut fmpz, r: *mut fmpz, g: *const fmpz);
    pub fn fmpz_root(r: *mut fmpz, f: *const fmpz, n: slong) -> libc::c_int;
    pub fn fmpz_divisible(f: *const fmpz, g: *const fmpz) -> libc::c_int;
    pub fn fmpz_divisible_ui(f: *const fmpz, g: ulong) -> libc::c_int;
    #[link_name = "fmpz_divisible_si__extern"]
    pub fn fmpz_divisible_si(f: *const fmpz, g: slong) -> libc::c_int;
    pub fn fmpz_divides(q: *mut fmpz, g: *const fmpz, h: *const fmpz) -> libc::c_int;
    pub fn fmpz_divexact(f: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_divexact_ui(f: *mut fmpz, g: *const fmpz, h: ulong);
    pub fn fmpz_divexact_si(f: *mut fmpz, g: *const fmpz, h: slong);
    pub fn fmpz_divexact2_uiui(f: *mut fmpz, g: *const fmpz, h1: ulong, h2: ulong);
    pub fn fmpz_cdiv_qr(f: *mut fmpz, s: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_fdiv_qr(f: *mut fmpz, s: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_tdiv_qr(f: *mut fmpz, s: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_ndiv_qr(q: *mut fmpz, r: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn fmpz_cdiv_r_2exp(f: *mut fmpz, g: *const fmpz, exp: ulong);
    pub fn fmpz_fdiv_r_2exp(f: *mut fmpz, g: *const fmpz, exp: ulong);
    pub fn fmpz_tdiv_r_2exp(f: *mut fmpz, g: *const fmpz, exp: ulong);
    pub fn fmpz_cdiv_q_2exp(f: *mut fmpz, g: *const fmpz, exp: ulong);
    pub fn fmpz_fdiv_q_2exp(f: *mut fmpz, g: *const fmpz, exp: ulong);
    pub fn fmpz_tdiv_q_2exp(f: *mut fmpz, g: *const fmpz, exp: ulong);
    pub fn fmpz_cdiv_ui(g: *const fmpz, h: ulong) -> ulong;
    pub fn fmpz_fdiv_ui(g: *const fmpz, h: ulong) -> ulong;
    pub fn fmpz_tdiv_ui(g: *const fmpz, h: ulong) -> ulong;
    pub fn fmpz_cdiv_q(f: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_fdiv_q(f: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_tdiv_q(f: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_fdiv_r(f: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_cdiv_q_ui(f: *mut fmpz, g: *const fmpz, h: ulong);
    pub fn fmpz_fdiv_q_ui(f: *mut fmpz, g: *const fmpz, h: ulong);
    pub fn fmpz_tdiv_q_ui(f: *mut fmpz, g: *const fmpz, h: ulong);
    pub fn fmpz_cdiv_q_si(f: *mut fmpz, g: *const fmpz, h: slong);
    pub fn fmpz_fdiv_q_si(f: *mut fmpz, g: *const fmpz, h: slong);
    pub fn fmpz_tdiv_q_si(f: *mut fmpz, g: *const fmpz, h: slong);
    pub fn fmpz_mul_tdiv_q_2exp(f: *mut fmpz, g: *const fmpz, h: *const fmpz, exp: ulong);
    pub fn fmpz_mul_si_tdiv_q_2exp(f: *mut fmpz, g: *const fmpz, x: slong, exp: ulong);
    pub fn fmpz_dlog(x: *const fmpz) -> f64;
    pub fn fmpz_clog(x: *const fmpz, b: *const fmpz) -> slong;
    pub fn fmpz_flog(x: *const fmpz, b: *const fmpz) -> slong;
    pub fn fmpz_clog_ui(x: *const fmpz, b: ulong) -> slong;
    pub fn fmpz_flog_ui(x: *const fmpz, b: ulong) -> slong;
    pub fn fmpz_get_d_2exp(exp: *mut slong, f: *const fmpz) -> f64;
    pub fn fmpz_set_d_2exp(f: *mut fmpz, m: f64, exp: slong);
    pub fn _fmpz_tdiv_q_newton(q: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn _fmpz_fdiv_q_newton(q: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn _fmpz_cdiv_q_newton(q: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn _fmpz_tdiv_qr_newton(q: *mut fmpz, r: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn _fmpz_fdiv_qr_newton(q: *mut fmpz, r: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn _fmpz_cdiv_qr_newton(q: *mut fmpz, r: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn _fmpz_tdiv_r_newton(r: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn _fmpz_fdiv_r_newton(r: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn _fmpz_cdiv_r_newton(r: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn _fmpz_mod_newton(r: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn _fmpz_divexact_newton(q: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn fmpz_setbit(f: *mut fmpz, i: ulong);
    pub fn fmpz_clrbit(f: *mut fmpz, i: ulong);
    pub fn fmpz_tstbit(f: *const fmpz, i: ulong) -> libc::c_int;
    pub fn fmpz_complement(r: *mut fmpz, f: *const fmpz);
    pub fn fmpz_combit(f: *mut fmpz, i: ulong);
    pub fn fmpz_and(r: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn fmpz_or(r: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn fmpz_xor(r: *mut fmpz, a: *const fmpz, b: *const fmpz);
    pub fn fmpz_popcnt(c: *const fmpz) -> flint_bitcnt_t;
    pub fn fmpz_bit_pack(
        arr: nn_ptr,
        shift: flint_bitcnt_t,
        bits: flint_bitcnt_t,
        coeff: *const fmpz,
        negate: libc::c_int,
        borrow: libc::c_int,
    ) -> libc::c_int;
    pub fn fmpz_bit_unpack(
        coeff: *mut fmpz,
        arr: nn_srcptr,
        shift: flint_bitcnt_t,
        bits: flint_bitcnt_t,
        negate: libc::c_int,
        borrow: libc::c_int,
    ) -> libc::c_int;
    pub fn fmpz_bit_unpack_unsigned(
        coeff: *mut fmpz,
        arr: nn_srcptr,
        shift: flint_bitcnt_t,
        bits: flint_bitcnt_t,
    );
    #[link_name = "fmpz_mod_ui__extern"]
    pub fn fmpz_mod_ui(f: *mut fmpz, g: *const fmpz, h: ulong) -> ulong;
    #[link_name = "fmpz_set_ui_smod__extern"]
    pub fn fmpz_set_ui_smod(f: *mut fmpz, x: ulong, m: ulong);
    pub fn fmpz_mod(f: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_smod(f: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn _fmpz_smod(
        r: *mut fmpz,
        a: *const fmpz,
        m: *const fmpz,
        sign: libc::c_int,
        t: *mut fmpz,
    );
    #[link_name = "fmpz_negmod__extern"]
    pub fn fmpz_negmod(r: *mut fmpz, a: *const fmpz, mod_: *const fmpz);
    pub fn fmpz_invmod(f: *mut fmpz, g: *const fmpz, h: *const fmpz) -> libc::c_int;
    pub fn fmpz_sqrtmod(b: *mut fmpz, a: *const fmpz, p: *const fmpz) -> libc::c_int;
    pub fn fmpz_powm_ui(f: *mut fmpz, g: *const fmpz, exp: ulong, m: *const fmpz);
    pub fn fmpz_powm(f: *mut fmpz, g: *const fmpz, e: *const fmpz, m: *const fmpz);
    pub fn fmpz_divides_mod_list(
        xstart: *mut fmpz,
        xstride: *mut fmpz,
        xlength: *mut fmpz,
        a: *const fmpz,
        b: *const fmpz,
        n: *const fmpz,
    );
    pub fn _fmpz_remove(x: *mut fmpz, f: *const fmpz, finv: f64) -> slong;
    pub fn fmpz_remove(rop: *mut fmpz, op: *const fmpz, f: *const fmpz) -> slong;
    pub fn fmpz_gcd(f: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_gcd_ui(res: *mut fmpz, a: *const fmpz, b: ulong);
    pub fn fmpz_gcd3(f: *mut fmpz, a: *const fmpz, b: *const fmpz, c: *const fmpz);
    pub fn fmpz_gcdinv(d: *mut fmpz, a: *mut fmpz, f: *const fmpz, g: *const fmpz);
    pub fn fmpz_xgcd(d: *mut fmpz, a: *mut fmpz, b: *mut fmpz, f: *const fmpz, g: *const fmpz);
    pub fn fmpz_xgcd_canonical_bezout(
        d: *mut fmpz,
        a: *mut fmpz,
        b: *mut fmpz,
        f: *const fmpz,
        g: *const fmpz,
    );
    pub fn fmpz_xgcd_partial(
        co2: *mut fmpz,
        co1: *mut fmpz,
        r2: *mut fmpz,
        r1: *mut fmpz,
        L: *const fmpz,
    );
    pub fn fmpz_lcm(f: *mut fmpz, g: *const fmpz, h: *const fmpz);
    pub fn fmpz_fdiv_qr_preinvn(
        f: *mut fmpz,
        s: *mut fmpz,
        g: *const fmpz,
        h: *const fmpz,
        inv: *const fmpz_preinvn_struct,
    );
    pub fn fmpz_fdiv_r_preinvn(
        f: *mut fmpz,
        g: *const fmpz,
        h: *const fmpz,
        inv: *const fmpz_preinvn_struct,
    );
    pub fn fmpz_preinvn_init(inv: *mut fmpz_preinvn_struct, f: *const fmpz);
    pub fn fmpz_preinvn_clear(inv: *mut fmpz_preinvn_struct);
    pub fn fmpz_fac_ui(f: *mut fmpz, n: ulong);
    pub fn fmpz_bin_uiui(res: *mut fmpz, n: ulong, k: ulong);
    pub fn _fmpz_rfac_ui(r: *mut fmpz, x: *const fmpz, a: ulong, b: ulong);
    pub fn fmpz_rfac_ui(r: *mut fmpz, x: *const fmpz, n: ulong);
    pub fn fmpz_rfac_uiui(r: *mut fmpz, x: ulong, n: ulong);
    pub fn fmpz_jacobi(a: *const fmpz, p: *const fmpz) -> libc::c_int;
    pub fn fmpz_kronecker(a: *const fmpz, n: *const fmpz) -> libc::c_int;
    pub fn fmpz_fib_ui(f: *mut fmpz, n: ulong);
    pub fn _fmpz_CRT_ui_precomp(
        out: *mut fmpz,
        r1: *const fmpz,
        m1: *const fmpz,
        r2: ulong,
        m2: ulong,
        m2inv: ulong,
        m1m2: *const fmpz,
        c: ulong,
        sign: libc::c_int,
    );
    pub fn fmpz_CRT_ui(
        out: *mut fmpz,
        r1: *const fmpz,
        m1: *const fmpz,
        r2: ulong,
        m2: ulong,
        sign: libc::c_int,
    );
    pub fn fmpz_CRT(
        out: *mut fmpz,
        r1: *const fmpz,
        m1: *const fmpz,
        r2: *const fmpz,
        m2: *const fmpz,
        sign: libc::c_int,
    );
    pub fn fmpz_multi_CRT_init(CRT: *mut fmpz_multi_CRT_struct);
    pub fn fmpz_multi_CRT_clear(P: *mut fmpz_multi_CRT_struct);
    pub fn _fmpz_multi_CRT_precomp(
        outputs: *mut fmpz,
        P: *const fmpz_multi_CRT_struct,
        inputs: *const fmpz,
        sign: libc::c_int,
    );
    pub fn fmpz_multi_CRT_precomp(
        output: *mut fmpz,
        P: *const fmpz_multi_CRT_struct,
        inputs: *const fmpz,
        sign: libc::c_int,
    );
    pub fn fmpz_multi_CRT_precompute(
        CRT: *mut fmpz_multi_CRT_struct,
        moduli: *const fmpz,
        len: slong,
    ) -> libc::c_int;
    pub fn fmpz_multi_CRT(
        output: *mut fmpz,
        moduli: *const fmpz,
        values: *const fmpz,
        len: slong,
        sign: libc::c_int,
    ) -> libc::c_int;
    pub fn fmpz_multi_mod_init(P: *mut fmpz_multi_mod_struct);
    pub fn fmpz_multi_mod_clear(P: *mut fmpz_multi_mod_struct);
    pub fn fmpz_multi_mod_precompute(
        P: *mut fmpz_multi_mod_struct,
        f: *const fmpz,
        r: slong,
    ) -> libc::c_int;
    pub fn _fmpz_multi_mod_precomp(
        outputs: *mut fmpz,
        P: *const fmpz_multi_mod_struct,
        input: *const fmpz,
        sign: libc::c_int,
        tmp: *mut fmpz,
    );
    pub fn fmpz_multi_mod_precomp(
        outputs: *mut fmpz,
        P: *const fmpz_multi_mod_struct,
        input: *const fmpz,
        sign: libc::c_int,
    );
    pub fn fmpz_comb_temp_init(CT: *mut fmpz_comb_temp_struct, C: *const fmpz_comb_struct);
    pub fn fmpz_comb_temp_clear(CT: *mut fmpz_comb_temp_struct);
    pub fn fmpz_comb_init(C: *mut fmpz_comb_struct, primes: nn_srcptr, num_primes: slong);
    pub fn fmpz_comb_clear(C: *mut fmpz_comb_struct);
    pub fn fmpz_multi_mod_ui(
        out: *mut ulong,
        in_: *const fmpz,
        C: *const fmpz_comb_struct,
        CT: *mut fmpz_comb_temp_struct,
    );
    pub fn fmpz_multi_CRT_ui(
        output: *mut fmpz,
        residues: nn_srcptr,
        comb: *const fmpz_comb_struct,
        temp: *mut fmpz_comb_temp_struct,
        sign: libc::c_int,
    );
    pub fn fmpz_lucas_chain(
        Vm: *mut fmpz,
        Vm1: *mut fmpz,
        A: *const fmpz,
        m: *const fmpz,
        n: *const fmpz,
    );
    pub fn fmpz_lucas_chain_full(
        Vm: *mut fmpz,
        Vm1: *mut fmpz,
        A: *const fmpz,
        B: *const fmpz,
        m: *const fmpz,
        n: *const fmpz,
    );
    pub fn fmpz_lucas_chain_double(
        U2m: *mut fmpz,
        U2m1: *mut fmpz,
        Um: *const fmpz,
        Um1: *const fmpz,
        A: *const fmpz,
        B: *const fmpz,
        n: *const fmpz,
    );
    pub fn fmpz_lucas_chain_add(
        Umn: *mut fmpz,
        Umn1: *mut fmpz,
        Um: *const fmpz,
        Um1: *const fmpz,
        Un: *const fmpz,
        Un1: *const fmpz,
        A: *const fmpz,
        B: *const fmpz,
        n: *const fmpz,
    );
    pub fn fmpz_lucas_chain_mul(
        Ukm: *mut fmpz,
        Ukm1: *mut fmpz,
        Um: *const fmpz,
        Um1: *const fmpz,
        A: *const fmpz,
        B: *const fmpz,
        k: *const fmpz,
        n: *const fmpz,
    );
    pub fn fmpz_lucas_chain_VtoU(
        Um: *mut fmpz,
        Um1: *mut fmpz,
        Vm: *const fmpz,
        Vm1: *const fmpz,
        A: *const fmpz,
        UNUSED_B: *const fmpz,
        Dinv: *const fmpz,
        n: *const fmpz,
    );
    pub fn fmpz_is_probabprime_lucas(n: *const fmpz) -> libc::c_int;
    pub fn fmpz_is_probabprime_BPSW(n: *const fmpz) -> libc::c_int;
    pub fn fmpz_is_probabprime(p: *const fmpz) -> libc::c_int;
    pub fn fmpz_is_strong_probabprime(n: *const fmpz, a: *const fmpz) -> libc::c_int;
    pub fn fmpz_is_prime_pseudosquare(n: *const fmpz) -> libc::c_int;
    pub fn fmpz_is_prime_pocklington(
        F: *mut fmpz,
        R: *mut fmpz,
        n: *const fmpz,
        pm1: nn_ptr,
        num_pm1: slong,
    ) -> libc::c_int;
    pub fn fmpz_is_prime_morrison(
        F: *mut fmpz,
        R: *mut fmpz,
        n: *const fmpz,
        pm1: nn_ptr,
        num_pm1: slong,
    ) -> libc::c_int;
    pub fn fmpz_is_prime(p: *const fmpz) -> libc::c_int;
    pub fn fmpz_nextprime(res: *mut fmpz, n: *const fmpz, proved: libc::c_int);
    pub fn _fmpz_nm1_trial_factors(n: *const fmpz, pm1: nn_ptr, num_pm1: *mut slong, limit: ulong);
    pub fn _fmpz_np1_trial_factors(n: *const fmpz, pp1: nn_ptr, num_pp1: *mut slong, limit: ulong);
    pub fn fmpz_divisor_in_residue_class_lenstra(
        fac: *mut fmpz,
        n: *const fmpz,
        r: *const fmpz,
        s: *const fmpz,
    ) -> libc::c_int;
    pub fn fmpz_primorial(res: *mut fmpz, n: ulong);
    pub fn fmpz_euler_phi(res: *mut fmpz, n: *const fmpz);
    pub fn fmpz_moebius_mu(n: *const fmpz) -> libc::c_int;
    pub fn fmpz_divisor_sigma(res: *mut fmpz, k: ulong, n: *const fmpz);
}