2 gcd_ll (unsigned long long x
, unsigned long long y
)
7 return (unsigned long) x
;
10 return (unsigned long) y
;
16 powmod_ll (unsigned long long b
, unsigned e
, unsigned long long m
)
19 unsigned long long pow
;
25 /* Find the most significant bit in E. */
27 for (i
= 0; t
!= 0; i
++)
30 /* The most sign bit in E is handled outside of the loop, by beginning
31 with B in POW, and decrementing I. */
45 unsigned long factab
[10];
48 facts (t
, a_int
, x0
, p
)
54 unsigned long *xp
= factab
;
55 unsigned long long x
, y
;
57 unsigned long long a
= a_int
;
67 for (i
= 1; i
< 10000; i
++)
69 x
= powmod_ll (x
, p
, t
) + a
;
70 y
= powmod_ll (y
, p
, t
) + a
;
71 y
= powmod_ll (y
, p
, t
) + a
;
77 q
= (unsigned long long) q
* tmp
% t
;
100 unsigned long long t
;
111 if (factab
[0] != 7 || factab
[1] != 73 || factab
[2] != 262657)