
(/VERSIONCHECK 2) 

(DEFUN |PDECOMP;leftFactor;2UPU;1| (|f| |h| $)
  (PROG (|g| #1=#:G675 |r| |fr| |i|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ (LETT |g| (|spadConstant| $ 8) . #2=(|PDECOMP;leftFactor;2UPU;1|))
            (SEQ (LETT |i| 0 . #2#) G190
                 (COND
                  ((NULL
                    (COND
                     ((SPADCALL |f| (|spadConstant| $ 8) (QREFELT $ 11)) 'NIL)
                     ('T 'T)))
                   (GO G191)))
                 (SEQ (LETT |fr| (SPADCALL |f| |h| (QREFELT $ 13)) . #2#)
                      (LETT |f| (QCAR |fr|) . #2#) (LETT |r| (QCDR |fr|) . #2#)
                      (EXIT
                       (COND
                        ((< 0 (SPADCALL |r| (QREFELT $ 15)))
                         (PROGN (LETT #1# (CONS 1 "failed") . #2#) (GO #1#)))
                        ('T
                         (LETT |g|
                               (SPADCALL |g|
                                         (SPADCALL |r|
                                                   (SPADCALL
                                                    (|spadConstant| $ 17) |i|
                                                    (QREFELT $ 18))
                                                   (QREFELT $ 19))
                                         (QREFELT $ 20))
                               . #2#)))))
                 (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191 (EXIT NIL))
            (EXIT (CONS 0 |g|))))
      #1# (EXIT #1#))))) 

(DEFUN |PDECOMP;decompose;UP2NniU;2| (|f| |dg| |dh| $)
  (PROG (|g| |h| |df|)
    (RETURN
     (SEQ
      (LETT |df| (SPADCALL |f| (QREFELT $ 15))
            . #1=(|PDECOMP;decompose;UP2NniU;2|))
      (COND ((NULL (EQL (* |dg| |dh|) |df|)) (EXIT (CONS 1 "failed"))))
      (LETT |h| (SPADCALL |f| |dh| (QREFELT $ 23)) . #1#)
      (LETT |g| (SPADCALL |f| |h| (QREFELT $ 22)) . #1#)
      (EXIT
       (COND ((QEQCAR |g| 1) (CONS 1 "failed"))
             ('T (CONS 0 (CONS (QCDR |g|) |h|))))))))) 

(DEFUN |PDECOMP;decompose;UPL;3| (|f| $)
  (PROG (#1=#:G696 |g| |h| #2=#:G697 |dh| |df|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |df| (SPADCALL |f| (QREFELT $ 15))
              . #3=(|PDECOMP;decompose;UPL;3|))
        (SEQ (LETT |dh| 2 . #3#) (LETT #2# (- |df| 1) . #3#) G190
             (COND ((QSGREATERP |dh| #2#) (GO G191)))
             (SEQ
              (EXIT
               (COND
                ((EQL (REMAINDER2 |df| |dh|) 0)
                 (SEQ (LETT |h| (SPADCALL |f| |dh| (QREFELT $ 23)) . #3#)
                      (LETT |g| (SPADCALL |f| |h| (QREFELT $ 22)) . #3#)
                      (EXIT
                       (COND
                        ((QEQCAR |g| 0)
                         (PROGN
                          (LETT #1#
                                (APPEND (SPADCALL (QCDR |g|) (QREFELT $ 28))
                                        (SPADCALL |h| (QREFELT $ 28)))
                                . #3#)
                          (GO #1#))))))))))
             (LETT |dh| (QSADD1 |dh|) . #3#) (GO G190) G191 (EXIT NIL))
        (EXIT (LIST |f|))))
      #1# (EXIT #1#))))) 

(DEFUN |PDECOMP;rightFactorCandidate;UPNniUP;4| (|f| |dh| $)
  (PROG (|h| #1=#:G712 |c| #2=#:G711 #3=#:G710 |hdg| |k| |dg| |df|)
    (RETURN
     (SEQ
      (LETT |f| (SPADCALL |f| (SPADCALL |f| (QREFELT $ 29)) (QREFELT $ 30))
            . #4=(|PDECOMP;rightFactorCandidate;UPNniUP;4|))
      (LETT |df| (SPADCALL |f| (QREFELT $ 15)) . #4#)
      (LETT |dg| (QUOTIENT2 |df| |dh|) . #4#)
      (LETT |h| (SPADCALL (|spadConstant| $ 17) |dh| (QREFELT $ 18)) . #4#)
      (SEQ (LETT |k| 1 . #4#) G190 (COND ((QSGREATERP |k| |dh|) (GO G191)))
           (SEQ (LETT |hdg| (SPADCALL |h| |dg| (QREFELT $ 31)) . #4#)
                (LETT |c|
                      (SPADCALL
                       (SPADCALL
                        (SPADCALL |f|
                                  (PROG1 (LETT #3# (- |df| |k|) . #4#)
                                    (|check-subtype| (>= #3# 0)
                                                     '(|NonNegativeInteger|)
                                                     #3#))
                                  (QREFELT $ 32))
                        (SPADCALL |hdg|
                                  (PROG1 (LETT #2# (- |df| |k|) . #4#)
                                    (|check-subtype| (>= #2# 0)
                                                     '(|NonNegativeInteger|)
                                                     #2#))
                                  (QREFELT $ 32))
                        (QREFELT $ 33))
                       (SPADCALL |dg| (QREFELT $ 35)) (QREFELT $ 36))
                      . #4#)
                (EXIT
                 (LETT |h|
                       (SPADCALL |h|
                                 (SPADCALL |c|
                                           (PROG1 (LETT #1# (- |dh| |k|) . #4#)
                                             (|check-subtype| (>= #1# 0)
                                                              '(|NonNegativeInteger|)
                                                              #1#))
                                           (QREFELT $ 18))
                                 (QREFELT $ 20))
                       . #4#)))
           (LETT |k| (QSADD1 |k|) . #4#) (GO G190) G191 (EXIT NIL))
      (EXIT
       (SPADCALL |h|
                 (SPADCALL (SPADCALL |h| 0 (QREFELT $ 32)) 0 (QREFELT $ 18))
                 (QREFELT $ 37))))))) 

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

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

(MAKEPROP '|PolynomialDecomposition| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
              (0 . |Zero|) (4 . |Zero|) (|Boolean|) (8 . =)
              (|Record| (|:| |quotient| $) (|:| |remainder| $)) (14 . |divide|)
              (|NonNegativeInteger|) (20 . |degree|) (25 . |One|) (29 . |One|)
              (33 . |monomial|) (39 . *) (45 . +) (|Union| 6 '"failed")
              |PDECOMP;leftFactor;2UPU;1|
              |PDECOMP;rightFactorCandidate;UPNniUP;4|
              (|Record| (|:| |left| 6) (|:| |right| 6)) (|Union| 24 '"failed")
              |PDECOMP;decompose;UP2NniU;2| (|List| 6)
              |PDECOMP;decompose;UPL;3| (51 . |leadingCoefficient|) (56 . /)
              (62 . ^) (68 . |coefficient|) (74 . -) (|Integer|)
              (80 . |coerce|) (85 . /) (91 . -))
           '#(|rightFactorCandidate| 97 |leftFactor| 103 |decompose| 109) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 37
                                                 '(0 6 0 8 0 7 0 9 2 6 10 0 0
                                                   11 2 6 12 0 0 13 1 6 14 0 15
                                                   0 6 0 16 0 7 0 17 2 6 0 7 14
                                                   18 2 6 0 0 0 19 2 6 0 0 0 20
                                                   1 6 7 0 29 2 6 0 0 7 30 2 6
                                                   0 0 14 31 2 6 7 0 14 32 2 7
                                                   0 0 0 33 1 7 0 34 35 2 7 0 0
                                                   0 36 2 6 0 0 0 37 2 0 6 6 14
                                                   23 2 0 21 6 6 22 3 0 25 6 14
                                                   14 26 1 0 27 6 28)))))
           '|lookupComplete|)) 
