
(/VERSIONCHECK 2) 

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

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

(DEFUN |FiniteFieldPolynomialPackage2;| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|)
              . #0=(|FiniteFieldPolynomialPackage2|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT |dv$|
              (LIST '|FiniteFieldPolynomialPackage2| DV$1 DV$2) . #0#)
        (LETT $ (GETREFV 52) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|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 . |One|)
             (152 . *) |FFPOLY2;rootOfIrreduciblePoly;SupF;1|)
          '#(|rootOfIrreduciblePoly| 158) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 51
                                '(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 0 10 0 49 2 8 0 28 0
                                  50 1 0 6 10 51)))))
          '|lookupComplete|)) 
