
(/VERSIONCHECK 2) 

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

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

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

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

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

(DEFUN |PolynomialDecomposition;| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|PolynomialDecomposition|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT |dv$| (LIST '|PolynomialDecomposition| DV$1 DV$2) . #0#)
        (LETT $ (GETREFV 38) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|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|)) 
