
(/VERSIONCHECK 2) 

(DEFUN |COMPFACT;myMap| (|r| $)
  (PROG (|cr|)
    (RETURN
      (SEQ (COND
             ((|domainEqual| (|Complex| (QREFELT $ 6))
                  (|Complex| (|Integer|)))
              (SEQ (LETT |cr| |r| |COMPFACT;myMap|)
                   (EXIT (SPADCALL
                             (SPADCALL (SPADCALL |cr| (QREFELT $ 13))
                                 (QREFELT $ 15))
                             (SPADCALL (SPADCALL |cr| (QREFELT $ 16))
                                 (QREFELT $ 15))
                             (QREFELT $ 18)))))
             ((|domainEqual| (|Complex| (QREFELT $ 6))
                  (|Complex| (|Fraction| (|Integer|))))
              |r|)))))) 

(DEFUN |COMPFACT;compND| (|cc| $)
  (PROG (|ccr| |cci| |dccr| |dcci| |ccd| #0=#:G1823)
    (RETURN
      (SEQ (LETT |ccr| (SPADCALL |cc| (QREFELT $ 19))
                 . #1=(|COMPFACT;compND|))
           (LETT |cci| (SPADCALL |cc| (QREFELT $ 20)) . #1#)
           (LETT |dccr| (SPADCALL |ccr| (QREFELT $ 21)) . #1#)
           (LETT |dcci| (SPADCALL |cci| (QREFELT $ 21)) . #1#)
           (LETT |ccd| (SPADCALL |dccr| |dcci| (QREFELT $ 22)) . #1#)
           (EXIT (CONS (SPADCALL
                           (* (PROG2 (LETT #0#
                                      (SPADCALL |ccd| |dccr|
                                       (QREFELT $ 24)) . #1#)
                                     (QCDR #0#)
                                (|check-union| (QEQCAR #0# 0)
                                    (|Integer|) #0#))
                              (SPADCALL |ccr| (QREFELT $ 25)))
                           (* (PROG2 (LETT #0#
                                      (SPADCALL |ccd| |dcci|
                                       (QREFELT $ 24)) . #1#)
                                     (QCDR #0#)
                                (|check-union| (QEQCAR #0# 0)
                                    (|Integer|) #0#))
                              (SPADCALL |cci| (QREFELT $ 25)))
                           (QREFELT $ 26))
                       |ccd|)))))) 

(DEFUN |COMPFACT;conv| (|f| $)
  (PROG (|pdris| |i| #0=#:G1836 |cf| |cdf| |dris| #1=#:G1829 |pris|
                 |dris1|)
    (RETURN
      (SEQ (LETT |pris| (|spadConstant| $ 28) . #2=(|COMPFACT;conv|))
           (LETT |dris| 1 . #2#) (LETT |dris1| 1 . #2#)
           (LETT |pdris| 1 . #2#)
           (SEQ (LETT |i| 0 . #2#)
                (LETT #0# (SPADCALL |f| (QREFELT $ 31)) . #2#) G190
                (COND ((QSGREATERP |i| #0#) (GO G191)))
                (SEQ (LETT |cf|
                           (SPADCALL |f| |i| (QREFELT $ 32)) . #2#)
                     (EXIT (COND
                             ((SPADCALL |cf| (|spadConstant| $ 35)
                                  (QREFELT $ 37))
                              "next i")
                             ('T
                              (SEQ (LETT |cdf|
                                    (|COMPFACT;compND| |cf| $) . #2#)
                                   (LETT |dris|
                                    (SPADCALL (QCDR |cdf|) |dris1|
                                     (QREFELT $ 22)) . #2#)
                                   (LETT |pris|
                                    (SPADCALL
                                     (SPADCALL
                                      (PROG2
                                       (LETT #1#
                                        (SPADCALL |dris| |dris1|
                                         (QREFELT $ 24)) . #2#)
                                       (QCDR #1#)
                                        (|check-union| (QEQCAR #1# 0)
                                         (|Integer|) #1#))
                                      |pris| (QREFELT $ 38))
                                     (SPADCALL
                                      (PROG2
                                       (LETT #1#
                                        (SPADCALL |dris| (QCDR |cdf|)
                                         (QREFELT $ 24)) . #2#)
                                       (QCDR #1#)
                                        (|check-union| (QEQCAR #1# 0)
                                         (|Integer|) #1#))
                                      (SPADCALL (QCAR |cdf|) |i|
                                       (QREFELT $ 39))
                                      (QREFELT $ 38))
                                     (QREFELT $ 40)) . #2#)
                                   (EXIT (LETT |dris1| |dris| . #2#)))))))
                (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191
                (EXIT NIL))
           (EXIT (CONS |pris| (SPADCALL |dris| (QREFELT $ 15)))))))) 

(DEFUN |COMPFACT;backConv| (|ffr| $)
  (PROG (#0=#:G1858 |f| #1=#:G1859 |ff| #2=#:G1860 |fact| |expf| |ris|
            |lc| |const| |uconst|)
    (RETURN
      (SEQ (COND
             ((|domainEqual| (|Complex| (QREFELT $ 6))
                  (|Complex| (|Fraction| (|Integer|))))
              (SPADCALL (SPADCALL |ffr| (QREFELT $ 42))
                  (PROGN
                    (LETT #0# NIL . #3=(|COMPFACT;backConv|))
                    (SEQ (LETT |f| NIL . #3#)
                         (LETT #1#
                               (SPADCALL |ffr| (QREFELT $ 46)) . #3#)
                         G190
                         (COND
                           ((OR (ATOM #1#)
                                (PROGN (LETT |f| (CAR #1#) . #3#) NIL))
                            #4=(GO G191)))
                         (SEQ (EXIT (LETT #0#
                                     (CONS
                                      (VECTOR (QVELT |f| 0)
                                       (QVELT |f| 1) (QVELT |f| 2))
                                      #0#) . #3#)))
                         (LETT #1# (CDR #1#) . #3#) #5=(GO G190) G191
                         (EXIT (NREVERSE0 #0#))))
                  (QREFELT $ 50)))
             ((|domainEqual| (|Complex| (QREFELT $ 6))
                  (|Complex| (|Integer|)))
              (SEQ (LETT |const| (SPADCALL |ffr| (QREFELT $ 42)) . #3#)
                   (LETT |ris| NIL . #3#)
                   (SEQ (LETT |ff| NIL . #3#)
                        (LETT #2#
                              (SPADCALL |ffr| (QREFELT $ 46)) . #3#)
                        G190
                        (COND
                          ((OR (ATOM #2#)
                               (PROGN (LETT |ff| (CAR #2#) . #3#) NIL))
                           #4#))
                        (SEQ (LETT |fact|
                                   (SPADCALL
                                    (QCAR
                                     (|COMPFACT;conv| (QVELT |ff| 1) $))
                                    (QREFELT $ 51)) . #3#)
                             (LETT |expf| (QVELT |ff| 2) . #3#)
                             (LETT |ris|
                                   (CONS
                                    (VECTOR (QVELT |ff| 0) |fact|
                                     |expf|)
                                    |ris|) . #3#)
                             (LETT |lc|
                                   (|COMPFACT;myMap|
                                    (SPADCALL |fact| (QREFELT $ 53)) $) . #3#)
                             (EXIT (LETT |const|
                                    (SPADCALL |const|
                                     (SPADCALL
                                      (SPADCALL
                                       (SPADCALL (QVELT |ff| 1)
                                        (QREFELT $ 54))
                                       |lc| (QREFELT $ 55))
                                      |expf| (QREFELT $ 56))
                                     (QREFELT $ 57)) . #3#)))
                        (LETT #2# (CDR #2#) . #3#) #5# G191 (EXIT NIL))
                   (LETT |uconst|
                         (QCAR (|COMPFACT;compND|
                                   (SPADCALL |const| 0 (QREFELT $ 32))
                                   $)) . #3#)
                   (EXIT (SPADCALL (SPADCALL |uconst| (QREFELT $ 58))
                             |ris| (QREFELT $ 50)))))))))) 

(DEFUN |COMPFACT;factor;PRF;5| (|pol| $)
  (PROG (|ratPol| |ffr|)
    (RETURN
      (SEQ (LETT |ratPol| (|spadConstant| $ 59)
                 . #0=(|COMPFACT;factor;PRF;5|))
           (LETT |ratPol|
                 (SPADCALL (CONS (|function| |COMPFACT;myMap|) $) |pol|
                     (QREFELT $ 61)) . #0#)
           (LETT |ffr| (SPADCALL |ratPol| (QREFELT $ 62)) . #0#)
           (EXIT (|COMPFACT;backConv| |ffr| $)))))) 

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

(DEFUN |ComplexFactorization;| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|ComplexFactorization|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT |dv$| (LIST '|ComplexFactorization| DV$1 DV$2) . #0#)
        (LETT $ (GETREFV 64) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|ComplexFactorization|
            (LIST DV$1 DV$2) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 8
            (|SimpleAlgebraicExtensionAlgFactor|
                (|SparseUnivariatePolynomial| (|Fraction| (|Integer|)))
                (|Complex| (|Fraction| (|Integer|)))
                (|SparseUnivariatePolynomial|
                    (|Complex| (|Fraction| (|Integer|))))))
        (QSETREFV $ 9
            (|UnivariatePolynomialCategoryFunctions2| (|Complex| |#1|)
                |#2| (|Complex| (|Fraction| (|Integer|)))
                (|SparseUnivariatePolynomial|
                    (|Complex| (|Fraction| (|Integer|))))))
        (QSETREFV $ 10
            (|UnivariatePolynomialCategoryFunctions2|
                (|Complex| (|Fraction| (|Integer|)))
                (|SparseUnivariatePolynomial|
                    (|Complex| (|Fraction| (|Integer|))))
                (|Complex| |#1|) |#2|))
        $)))) 

(MAKEPROP '|ComplexFactorization| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             'SAEF 'UPCF2 'UPCFB (|Integer|) (|Complex| 11)
             (0 . |real|) (|Fraction| 11) (5 . |coerce|) (10 . |imag|)
             (|Complex| 14) (15 . |complex|) (21 . |real|)
             (26 . |imag|) (31 . |denom|) (36 . |lcm|)
             (|Union| $ '"failed") (42 . |exquo|) (48 . |numer|)
             (53 . |complex|) (|SparseUnivariatePolynomial| 12)
             (59 . |Zero|) (|NonNegativeInteger|)
             (|SparseUnivariatePolynomial| 17) (63 . |degree|)
             (68 . |coefficient|) (74 . |Zero|) (78 . |Zero|)
             (82 . |Zero|) (|Boolean|) (86 . =) (92 . *)
             (98 . |monomial|) (104 . +) (|Factored| 30) (110 . |unit|)
             (|Union| '"nil" '"sqfr" '"irred" '"prime")
             (|Record| (|:| |flg| 43) (|:| |fctr| 30) (|:| |xpnt| 11))
             (|List| 44) (115 . |factorList|)
             (|Record| (|:| |flg| 43) (|:| |fctr| 7) (|:| |xpnt| 11))
             (|List| 47) (|Factored| 7) (120 . |makeFR|)
             (126 . |primitivePart|) (|Complex| 6)
             (131 . |leadingCoefficient|) (136 . |leadingCoefficient|)
             (141 . /) (147 . **) (153 . *) (159 . |coerce|)
             (164 . |Zero|) (|Mapping| 17 52) (168 . |map|)
             (174 . |factor|) |COMPFACT;factor;PRF;5|)
          '#(|factor| 179) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 63
                                '(1 12 11 0 13 1 14 0 11 15 1 12 11 0
                                  16 2 17 0 14 14 18 1 17 14 0 19 1 17
                                  14 0 20 1 14 11 0 21 2 11 0 0 0 22 2
                                  11 23 0 0 24 1 14 11 0 25 2 12 0 11
                                  11 26 0 27 0 28 1 30 29 0 31 2 30 17
                                  0 29 32 0 6 0 33 0 7 0 34 0 17 0 35 2
                                  17 36 0 0 37 2 27 0 11 0 38 2 27 0 12
                                  29 39 2 27 0 0 0 40 1 41 30 0 42 1 41
                                  45 0 46 2 49 0 7 48 50 1 27 0 0 51 1
                                  7 52 0 53 1 30 17 0 54 2 17 0 0 0 55
                                  2 17 0 0 11 56 2 30 0 0 17 57 1 7 0
                                  52 58 0 30 0 59 2 9 30 60 7 61 1 8 41
                                  30 62 1 0 49 7 63)))))
          '|lookupComplete|)) 
