
(/VERSIONCHECK 2) 

(DEFUN |PRIMELT;multi| (|p| |v| $)
  (SPADCALL (SPADCALL (LIST #'|PRIMELT;multi!0|) |p| (QREFELT $ 9)) |v|
            (QREFELT $ 12))) 

(DEFUN |PRIMELT;multi!0| (|f1| $$) |f1|) 

(DEFUN |PRIMELT;randomInts| (|n| |m| $)
  (PROG (|i| #1=#:G673)
    (RETURN
     (SEQ
      (PROGN
       (LETT #1# NIL . #2=(|PRIMELT;randomInts|))
       (SEQ (LETT |i| 1 . #2#) G190 (COND ((QSGREATERP |i| |n|) (GO G191)))
            (SEQ
             (EXIT
              (LETT #1# (CONS (SPADCALL (RANDOM |m|) |m| (QREFELT $ 14)) #1#)
                    . #2#)))
            (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191
            (EXIT (NREVERSE0 #1#)))))))) 

(DEFUN |PRIMELT;incl?| (|a| |b| $)
  (PROG ()
    (RETURN
     (SPADCALL (CONS #'|PRIMELT;incl?!0| (VECTOR $ |b|)) |a| (QREFELT $ 19))))) 

(DEFUN |PRIMELT;incl?!0| (|s1| $$)
  (PROG (|b| $)
    (LETT |b| (QREFELT $$ 1) . #1=(|PRIMELT;incl?|))
    (LETT $ (QREFELT $$ 0) . #1#)
    (RETURN (PROGN (SPADCALL |s1| |b| (QREFELT $ 17)))))) 

(DEFUN |PRIMELT;primitiveElement;LLR;4| (|l| |v| $)
  (SPADCALL |l| |v| (SPADCALL (QREFELT $ 20)) (QREFELT $ 23))) 

(DEFUN |PRIMELT;primitiveElement;PSPSR;5| (|p1| |a1| |p2| |a2| $)
  (PROG (#1=#:G681 #2=#:G686 |r| |w| |c| |i| |b| |u|)
    (RETURN
     (SEQ
      (EXIT
       (COND
        ((EQL (SPADCALL |p2| |a1| (QREFELT $ 26)) 1)
         (VECTOR 0 1
                 (SPADCALL (SPADCALL |p1| |p2| |a1| (QREFELT $ 30))
                           (QREFELT $ 31))))
        ('T
         (SEQ
          (LETT |u| (SPADCALL (SPADCALL (QREFELT $ 20)) (QREFELT $ 32))
                . #3=(|PRIMELT;primitiveElement;PSPSR;5|))
          (LETT |b| (SPADCALL |a2| (QREFELT $ 32)) . #3#)
          (EXIT
           (SEQ (LETT |i| 10 . #3#) G190 NIL
                (SEQ
                 (EXIT
                  (SEQ
                   (LETT |c| (SPADCALL (RANDOM |i|) |i| (QREFELT $ 14)) . #3#)
                   (LETT |w|
                         (SPADCALL |u| (SPADCALL |c| |b| (QREFELT $ 33))
                                   (QREFELT $ 34))
                         . #3#)
                   (LETT |r|
                         (SPADCALL
                          (SPADCALL (SPADCALL |p1| |a1| |w| (QREFELT $ 35))
                                    (SPADCALL |p2| |a1| |w| (QREFELT $ 35))
                                    |a2| (QREFELT $ 30))
                          (QREFELT $ 31))
                         . #3#)
                   (EXIT
                    (COND
                     ((NULL (SPADCALL |r| (QREFELT $ 36)))
                      (COND
                       ((SPADCALL |r| (SPADCALL |r| (QREFELT $ 37))
                                  (QREFELT $ 38))
                        (PROGN
                         (LETT #1#
                               (PROGN
                                (LETT #2# (VECTOR 1 |c| |r|) . #3#)
                                (GO #2#))
                               . #3#)
                         (GO #1#)))))))))
                 #1# (EXIT #1#))
                (LETT |i| (+ |i| 1) . #3#) (GO G190) G191 (EXIT NIL)))))))
      #2# (EXIT #2#))))) 

(DEFUN |PRIMELT;findUniv| (|l| |v| |opt| $)
  (PROG (#1=#:G692 #2=#:G694 #3=#:G695 |p|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (SEQ
         (EXIT
          (SEQ (LETT |p| NIL . #4=(|PRIMELT;findUniv|)) (LETT #3# |l| . #4#)
               G190
               (COND
                ((OR (ATOM #3#) (PROGN (LETT |p| (CAR #3#) . #4#) NIL))
                 (GO G191)))
               (SEQ
                (EXIT
                 (COND
                  ((< 0 (SPADCALL |p| |v| (QREFELT $ 26)))
                   (COND
                    ((|PRIMELT;incl?| (SPADCALL |p| (QREFELT $ 42))
                      (LIST |v| |opt|) $)
                     (PROGN
                      (LETT #1# (PROGN (LETT #2# (CONS 0 |p|) . #4#) (GO #2#))
                            . #4#)
                      (GO #1#))))))))
               (LETT #3# (CDR #3#) . #4#) (GO G190) G191 (EXIT NIL)))
         #1# (EXIT #1#))
        (EXIT (CONS 1 "failed"))))
      #2# (EXIT #2#))))) 

(DEFUN |PRIMELT;triangularLinearIfCan| (|l| |lv| |w| $)
  (PROG (|ll| |bc| #1=#:G712 #2=#:G716 |p| |u| #3=#:G717 |v| |pw|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |u| (|PRIMELT;findUniv| |l| |w| |w| $)
              . #4=(|PRIMELT;triangularLinearIfCan|))
        (EXIT
         (COND ((QEQCAR |u| 1) (CONS 1 "failed"))
               ('T
                (SEQ (LETT |pw| (SPADCALL (QCDR |u|) (QREFELT $ 31)) . #4#)
                     (LETT |ll| NIL . #4#)
                     (SEQ (LETT |v| NIL . #4#) (LETT #3# |lv| . #4#) G190
                          (COND
                           ((OR (ATOM #3#)
                                (PROGN (LETT |v| (CAR #3#) . #4#) NIL))
                            (GO G191)))
                          (SEQ
                           (EXIT
                            (SEQ
                             (SEQ
                              (LETT |u| (|PRIMELT;findUniv| |l| |v| |w| $)
                                    . #4#)
                              (EXIT
                               (COND
                                ((OR (QEQCAR |u| 1)
                                     (NULL
                                      (EQL
                                       (SPADCALL
                                        (LETT |p|
                                              (SPADCALL (QCDR |u|) |v|
                                                        (QREFELT $ 44))
                                              . #4#)
                                        (QREFELT $ 46))
                                       1)))
                                 (PROGN
                                  (LETT #1#
                                        (PROGN
                                         (LETT #2# (CONS 1 "failed") . #4#)
                                         (GO #2#))
                                        . #4#)
                                  (GO #1#))))))
                             (LETT |bc|
                                   (SPADCALL
                                    (SPADCALL (SPADCALL |p| (QREFELT $ 47))
                                              (QREFELT $ 31))
                                    |pw| (|spadConstant| $ 48) (QREFELT $ 51))
                                   . #4#)
                             (EXIT
                              (COND
                               ((QEQCAR |bc| 1) (|error| "Should not happen"))
                               ('T
                                (LETT |ll|
                                      (CONS
                                       (SPADCALL
                                        (LIST
                                         #'|PRIMELT;triangularLinearIfCan!0|)
                                        (SPADCALL
                                         (SPADCALL
                                          (SPADCALL
                                           (SPADCALL
                                            (SPADCALL |p| 0 (QREFELT $ 53))
                                            (QREFELT $ 31))
                                           (QCAR (QCDR |bc|)) (QREFELT $ 54))
                                          (QREFELT $ 55))
                                         |pw| (QREFELT $ 56))
                                        (QREFELT $ 9))
                                       |ll|)
                                      . #4#))))))
                           #1# (EXIT #1#))
                          (LETT #3# (CDR #3#) . #4#) (GO G190) G191 (EXIT NIL))
                     (EXIT
                      (CONS 0
                            (CONS
                             (SPADCALL
                              (LIST #'|PRIMELT;triangularLinearIfCan!1|) |pw|
                              (QREFELT $ 9))
                             (NREVERSE |ll|))))))))))
      #2# (EXIT #2#))))) 

(DEFUN |PRIMELT;triangularLinearIfCan!1| (|f1| $$) |f1|) 

(DEFUN |PRIMELT;triangularLinearIfCan!0| (|z1| $$) |z1|) 

(DEFUN |PRIMELT;primitiveElement;LLSR;8| (|l| |vars| |uu| $)
  (PROG (#1=#:G730 #2=#:G733 |ltt| #3=#:G727 |tt| #4=#:G724 #5=#:G723 #6=#:G725
         #7=#:G736 |c| #8=#:G737 |t| |cf| |i| |n| |w| |elim| |vv| #9=#:G735 |v|
         #10=#:G734 |u|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |u| (SPADCALL |uu| (QREFELT $ 32))
              . #11=(|PRIMELT;primitiveElement;LLSR;8|))
        (LETT |vv|
              (PROGN
               (LETT #10# NIL . #11#)
               (SEQ (LETT |v| NIL . #11#) (LETT #9# |vars| . #11#) G190
                    (COND
                     ((OR (ATOM #9#) (PROGN (LETT |v| (CAR #9#) . #11#) NIL))
                      #12=(GO G191)))
                    (SEQ
                     (EXIT
                      (LETT #10# (CONS (SPADCALL |v| (QREFELT $ 32)) #10#)
                            . #11#)))
                    (LETT #9# (CDR #9#) . #11#) #13=(GO G190) G191
                    (EXIT (NREVERSE0 #10#))))
              . #11#)
        (LETT |elim| (SPADCALL |vars| |uu| (QREFELT $ 57)) . #11#)
        (LETT |w| (SPADCALL |uu| (QREFELT $ 32)) . #11#)
        (LETT |n| (LENGTH |l|) . #11#)
        (EXIT
         (SEQ (LETT |i| 10 . #11#) G190 NIL
              (SEQ
               (EXIT
                (SEQ (LETT |cf| (|PRIMELT;randomInts| |n| |i| $) . #11#)
                     (EXIT
                      (COND
                       ((QEQCAR
                         (LETT |tt|
                               (|PRIMELT;triangularLinearIfCan|
                                (SPADCALL
                                 (CONS
                                  (SPADCALL |w|
                                            (PROGN
                                             (LETT #4# NIL . #11#)
                                             (SEQ (LETT |t| NIL . #11#)
                                                  (LETT #8# |vv| . #11#)
                                                  (LETT |c| NIL . #11#)
                                                  (LETT #7# |cf| . #11#) G190
                                                  (COND
                                                   ((OR (ATOM #7#)
                                                        (PROGN
                                                         (LETT |c| (CAR #7#)
                                                               . #11#)
                                                         NIL)
                                                        (ATOM #8#)
                                                        (PROGN
                                                         (LETT |t| (CAR #8#)
                                                               . #11#)
                                                         NIL))
                                                    #12#))
                                                  (SEQ
                                                   (EXIT
                                                    (PROGN
                                                     (LETT #6#
                                                           (SPADCALL |c| |t|
                                                                     (QREFELT $
                                                                              33))
                                                           . #11#)
                                                     (COND
                                                      (#4#
                                                       (LETT #5#
                                                             (SPADCALL #5# #6#
                                                                       (QREFELT
                                                                        $ 58))
                                                             . #11#))
                                                      ('T
                                                       (PROGN
                                                        (LETT #5# #6# . #11#)
                                                        (LETT #4# 'T
                                                              . #11#)))))))
                                                  (LETT #7#
                                                        (PROG1 (CDR #7#)
                                                          (LETT #8# (CDR #8#)
                                                                . #11#))
                                                        . #11#)
                                                  #13# G191 (EXIT NIL))
                                             (COND (#4# #5#)
                                                   ('T (|spadConstant| $ 29))))
                                            (QREFELT $ 34))
                                  |l|)
                                 |elim| (QREFELT $ 60))
                                |vars| |uu| $)
                               . #11#)
                         0)
                        (PROGN
                         (LETT #1#
                               (SEQ
                                (LETT |ltt|
                                      (PROG2
                                          (LETT #3# |tt| . #11#)
                                          (QCDR #3#)
                                        (|check-union| (QEQCAR #3# 0)
                                                       (|List|
                                                        (|SparseUnivariatePolynomial|
                                                         (QREFELT $ 6)))
                                                       #3#))
                                      . #11#)
                                (EXIT
                                 (PROGN
                                  (LETT #2#
                                        (VECTOR |cf| (CDR |ltt|)
                                                (|SPADfirst| |ltt|))
                                        . #11#)
                                  (GO #2#))))
                               . #11#)
                         (GO #1#)))))))
               #1# (EXIT #1#))
              (LETT |i| (+ |i| 1) . #11#) #13# G191 (EXIT NIL)))))
      #2# (EXIT #2#))))) 

(DEFUN |PrimitiveElement| (#1=#:G738)
  (PROG ()
    (RETURN
     (PROG (#2=#:G739)
       (RETURN
        (COND
         ((LETT #2#
                (|lassocShiftWithFunction| (LIST (|devaluate| #1#))
                                           (HGET |$ConstructorCache|
                                                 '|PrimitiveElement|)
                                           '|domainEqualList|)
                . #3=(|PrimitiveElement|))
          (|CDRwithIncrement| #2#))
         ('T
          (UNWIND-PROTECT (PROG1 (|PrimitiveElement;| #1#) (LETT #2# T . #3#))
            (COND
             ((NOT #2#) (HREM |$ConstructorCache| '|PrimitiveElement|))))))))))) 

(DEFUN |PrimitiveElement;| (|#1|)
  (PROG (|pv$| $ |dv$| DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|PrimitiveElement|))
      (LETT |dv$| (LIST '|PrimitiveElement| DV$1) . #1#)
      (LETT $ (GETREFV 61) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|PrimitiveElement| (LIST DV$1)
                  (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      $)))) 

(MAKEPROP '|PrimitiveElement| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|Mapping| 6 6)
              (|SparseUnivariatePolynomial| 6) (0 . |map|) (|Symbol|)
              (|Polynomial| 6) (6 . |multivariate|) (|Integer|)
              (12 . |symmetricRemainder|) (|Boolean|) (|List| 10)
              (18 . |member?|) (|Mapping| 15 10) (24 . |every?|) (30 . |new|)
              (|Record| (|:| |coef| (|List| 13)) (|:| |poly| (|List| 8))
                        (|:| |prim| 8))
              (|List| 11) |PRIMELT;primitiveElement;LLSR;8|
              |PRIMELT;primitiveElement;LLR;4| (|NonNegativeInteger|)
              (34 . |degree|) (40 . |One|) (44 . |Zero|) (48 . |Zero|)
              (52 . |resultant|) (59 . |univariate|) (64 . |coerce|) (69 . *)
              (75 . -) (81 . |eval|) (88 . |zero?|) (93 . |squareFreePart|)
              (98 . =) (104 . |One|)
              (|Record| (|:| |coef1| 13) (|:| |coef2| 13) (|:| |prim| 8))
              |PRIMELT;primitiveElement;PSPSR;5| (108 . |variables|)
              (|SparseUnivariatePolynomial| $) (113 . |univariate|)
              (|SparseUnivariatePolynomial| 11) (119 . |degree|)
              (124 . |leadingCoefficient|) (129 . |One|)
              (|Record| (|:| |coef1| $) (|:| |coef2| $)) (|Union| 49 '"failed")
              (133 . |extendedEuclidean|) (140 . |Zero|) (144 . |coefficient|)
              (150 . *) (156 . -) (161 . |rem|) (167 . |concat|) (173 . +)
              (|PolyGroebner| 6) (179 . |lexGroebner|))
           '#(|primitiveElement| 185) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 60
                                                 '(2 8 0 7 0 9 2 11 0 8 10 12 2
                                                   13 0 0 0 14 2 16 15 10 0 17
                                                   2 16 15 18 0 19 0 10 0 20 2
                                                   11 25 0 10 26 0 6 0 27 0 6 0
                                                   28 0 11 0 29 3 11 0 0 0 10
                                                   30 1 11 8 0 31 1 11 0 10 32
                                                   2 11 0 13 0 33 2 11 0 0 0 34
                                                   3 11 0 0 10 0 35 1 8 15 0 36
                                                   1 8 0 0 37 2 8 15 0 0 38 0
                                                   11 0 39 1 11 16 0 42 2 11 43
                                                   0 10 44 1 45 25 0 46 1 45 11
                                                   0 47 0 8 0 48 3 8 50 0 0 0
                                                   51 0 8 0 52 2 45 11 0 25 53
                                                   2 8 0 0 0 54 1 8 0 0 55 2 8
                                                   0 0 0 56 2 16 0 0 10 57 2 11
                                                   0 0 0 58 2 59 22 22 16 60 4
                                                   0 40 11 10 11 10 41 3 0 21
                                                   22 16 10 23 2 0 21 22 16
                                                   24)))))
           '|lookupComplete|)) 
