
(/VERSIONCHECK 2) 

(DEFUN |FFPOLY2;rootOfIrreduciblePoly;SupF;1| (|pf| $)
  (PROG (|stillToFactor| |root| |degSTF| |degh| |h| |j| |trModp| |beta|
         #1=#:G1819 |i| |basispointer| |basis| |qexp| |p| |deg| #2=#:G1803
         |sizeGF|)
    (RETURN
     (SEQ
      (LETT |sizeGF| (SPADCALL (QREFELT $ 9))
            . #3=(|FFPOLY2;rootOfIrreduciblePoly;SupF;1|))
      (LETT |deg|
            (PROG1 (LETT #2# (SPADCALL |pf| (QREFELT $ 11)) . #3#)
              (|check-subtype| (> #2# 0) '(|PositiveInteger|) #2#))
            . #3#)
      (EXIT
       (COND ((EQL |deg| 0) (|error| "no roots"))
             ((EQL |deg| 1)
              (SPADCALL
               (SPADCALL (SPADCALL |pf| 0 (QREFELT $ 17)) (QREFELT $ 18))
               (QREFELT $ 19)))
             ('T
              (SEQ (LETT |p| (SPADCALL (ELT $ 18) |pf| (QREFELT $ 23)) . #3#)
                   (LETT |qexp| (SPADCALL |pf| (QREFELT $ 26)) . #3#)
                   (LETT |stillToFactor| |p| . #3#)
                   (LETT |basis| (SPADCALL |deg| (QREFELT $ 29)) . #3#)
                   (LETT |basispointer| 1 . #3#)
                   (LETT |root| (|spadConstant| $ 12) . #3#)
                   (SEQ G190
                        (COND
                         ((NULL (SPADCALL |root| (QREFELT $ 31)))
                          #4=(GO G191)))
                        (SEQ
                         (LETT |beta|
                               (SPADCALL |basis| |basispointer| (QREFELT $ 34))
                               . #3#)
                         (COND
                          ((SPADCALL |beta| (|spadConstant| $ 15)
                                     (QREFELT $ 35))
                           (SEQ
                            (LETT |basispointer| (+ |basispointer| 1) . #3#)
                            (EXIT
                             (LETT |beta|
                                   (SPADCALL |basis| |basispointer|
                                             (QREFELT $ 34))
                                   . #3#)))))
                         (LETT |basispointer| (+ |basispointer| 1) . #3#)
                         (LETT |trModp|
                               (SPADCALL
                                (SPADCALL (ELT $ 18) (QAREF1 |qexp| 0)
                                          (QREFELT $ 23))
                                |beta| (QREFELT $ 36))
                               . #3#)
                         (SEQ (LETT |i| 1 . #3#) (LETT #1# (- |deg| 1) . #3#)
                              G190 (COND ((QSGREATERP |i| #1#) #4#))
                              (SEQ
                               (LETT |beta| (SPADCALL |beta| (QREFELT $ 37))
                                     . #3#)
                               (EXIT
                                (LETT |trModp|
                                      (SPADCALL |trModp|
                                                (SPADCALL |beta|
                                                          (SPADCALL (ELT $ 18)
                                                                    (QAREF1
                                                                     |qexp|
                                                                     |i|)
                                                                    (QREFELT $
                                                                             23))
                                                          (QREFELT $ 38))
                                                (QREFELT $ 39))
                                      . #3#)))
                              (LETT |i| (QSADD1 |i|) . #3#) #5=(GO G190) G191
                              (EXIT NIL))
                         (EXIT
                          (COND
                           ((< 0 (SPADCALL |trModp| (QREFELT $ 41)))
                            (SEQ (LETT |j| 1 . #3#) G190
                                 (COND ((QSGREATERP |j| |sizeGF|) #4#))
                                 (SEQ
                                  (LETT |h|
                                        (SPADCALL |stillToFactor|
                                                  (SPADCALL |trModp|
                                                            (SPADCALL
                                                             (SPADCALL
                                                              (SPADCALL |j|
                                                                        (QREFELT
                                                                         $ 42))
                                                              (QREFELT $ 18))
                                                             (QREFELT $ 43))
                                                            (QREFELT $ 39))
                                                  (QREFELT $ 44))
                                        . #3#)
                                  (COND
                                   ((NULL
                                     (SPADCALL (SPADCALL |h| (QREFELT $ 45))
                                               (|spadConstant| $ 15)
                                               (QREFELT $ 35)))
                                    (LETT |h|
                                          (SPADCALL
                                           (SPADCALL
                                            (SPADCALL |h| (QREFELT $ 45))
                                            (QREFELT $ 46))
                                           |h| (QREFELT $ 38))
                                          . #3#)))
                                  (LETT |degh| (SPADCALL |h| (QREFELT $ 41))
                                        . #3#)
                                  (LETT |degSTF|
                                        (SPADCALL |stillToFactor|
                                                  (QREFELT $ 41))
                                        . #3#)
                                  (EXIT
                                   (COND
                                    ((EQL |degh| 1)
                                     (LETT |root|
                                           (SPADCALL
                                            (SPADCALL |h| 0 (QREFELT $ 47))
                                            (QREFELT $ 19))
                                           . #3#))
                                    ((EQL (- |degSTF| |degh|) 1)
                                     (LETT |root|
                                           (SPADCALL
                                            (SPADCALL
                                             (SPADCALL |stillToFactor| |h|
                                                       (QREFELT $ 48))
                                             0 (QREFELT $ 47))
                                            (QREFELT $ 19))
                                           . #3#))
                                    ((< 1 |degh|)
                                     (COND
                                      ((< |degh| |degSTF|)
                                       (COND
                                        ((< |degSTF|
                                            (SPADCALL 2 |degh| (QREFELT $ 49)))
                                         (LETT |stillToFactor|
                                               (SPADCALL |stillToFactor| |h|
                                                         (QREFELT $ 48))
                                               . #3#))
                                        ('T
                                         (LETT |stillToFactor| |h|
                                               . #3#)))))))))
                                 (LETT |j| (QSADD1 |j|) . #3#) #5# G191
                                 (EXIT NIL))))))
                        NIL #5# G191 (EXIT NIL))
                   (EXIT |root|))))))))) 

(DEFUN |FiniteFieldPolynomialPackage2| (&REST #1=#:G1820)
  (PROG ()
    (RETURN
     (PROG (#2=#:G1821)
       (RETURN
        (COND
         ((LETT #2#
                (|lassocShiftWithFunction| (|devaluateList| #1#)
                                           (HGET |$ConstructorCache|
                                                 '|FiniteFieldPolynomialPackage2|)
                                           '|domainEqualList|)
                . #3=(|FiniteFieldPolynomialPackage2|))
          (|CDRwithIncrement| #2#))
         ('T
          (UNWIND-PROTECT
              (PROG1 (APPLY (|function| |FiniteFieldPolynomialPackage2;|) #1#)
                (LETT #2# T . #3#))
            (COND
             ((NOT #2#)
              (HREM |$ConstructorCache|
                    '|FiniteFieldPolynomialPackage2|))))))))))) 

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

(MAKEPROP '|FiniteFieldPolynomialPackage2| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
              (|NonNegativeInteger|) (0 . |size|)
              (|SparseUnivariatePolynomial| 7) (4 . |degree|) (9 . |Zero|)
              (13 . |Zero|) (17 . |Zero|) (21 . |One|) (25 . |One|)
              (29 . |coefficient|) (35 . |coerce|) (40 . -)
              (|SparseUnivariatePolynomial| 6) (|Mapping| 6 7)
              (|SparseUnivariatePolynomialFunctions2| 7 6) (45 . |map|)
              (|PrimitiveArray| 10) (|FiniteFieldPolynomialPackage| 7)
              (51 . |reducedQPowers|) (|Vector| $) (|PositiveInteger|)
              (56 . |basis|) (|Boolean|) (61 . |zero?|) (|Integer|)
              (|Vector| 6) (66 . |elt|) (72 . =) (78 . *) (84 . |Frobenius|)
              (89 . *) (95 . +) (101 . |Zero|) (105 . |degree|) (110 . |index|)
              (115 . |coerce|) (120 . |gcd|) (126 . |leadingCoefficient|)
              (131 . |inv|) (136 . |coefficient|) (142 . |quo|) (148 . *)
              |FFPOLY2;rootOfIrreduciblePoly;SupF;1|)
           '#(|rootOfIrreduciblePoly| 154) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 50
                                                 '(0 7 8 9 1 10 8 0 11 0 6 0 12
                                                   0 7 0 13 0 10 0 14 0 6 0 15
                                                   0 7 0 16 2 10 7 0 8 17 1 6 0
                                                   7 18 1 6 0 0 19 2 22 20 21
                                                   10 23 1 25 24 10 26 1 6 27
                                                   28 29 1 6 30 0 31 2 33 6 0
                                                   32 34 2 6 30 0 0 35 2 20 0 0
                                                   6 36 1 6 0 0 37 2 20 0 6 0
                                                   38 2 20 0 0 0 39 0 20 0 40 1
                                                   20 8 0 41 1 7 0 28 42 1 20 0
                                                   6 43 2 20 0 0 0 44 1 20 6 0
                                                   45 1 6 0 0 46 2 20 6 0 8 47
                                                   2 20 0 0 0 48 2 8 0 28 0 49
                                                   1 0 6 10 50)))))
           '|lookupComplete|)) 
