
(/VERSIONCHECK 2) 

(DEFUN |LEADCDET;polCase;ZNniLB;1| (|d| |nk| |lval| $)
  (PROG (|i| |j| #0=#:G1823 #1=#:G1833 #2=#:G1824 |y| |q| #3=#:G1832
             |distlist|)
    (RETURN
      (SEQ (EXIT (SEQ (LETT |distlist| (LIST |d|)
                            . #4=(|LEADCDET;polCase;ZNniLB;1|))
                      (SEQ (LETT |i| 1 . #4#) G190
                           (COND ((QSGREATERP |i| |nk|) #5=(GO G191)))
                           (SEQ (LETT |q|
                                      (QVELT
                                       (SPADCALL
                                        (SPADCALL |lval| |i|
                                         (QREFELT $ 12))
                                        (QREFELT $ 14))
                                       1) . #4#)
                                (SEQ (LETT |j| 0 . #4#)
                                     (LETT #1#
                                      (PROG1 (LETT #0# (- |i| 1) . #4#)
                                        (|check-subtype| (>= #0# 0)
                                         '(|NonNegativeInteger|) #0#)) . #4#)
                                     G190
                                     (COND ((QSGREATERP |j| #1#) #5#))
                                     (SEQ
                                      (LETT |y|
                                       (SPADCALL |distlist|
                                        (PROG1
                                         (LETT #2# (- |i| |j|) . #4#)
                                          (|check-subtype| (>= #2# 0)
                                           '(|NonNegativeInteger|) #2#))
                                        (QREFELT $ 12)) . #4#)
                                      (SEQ G190
                                       (COND
                                         ((NULL
                                           (COND
                                             ((SPADCALL |y|
                                               (|spadConstant| $ 15)
                                               (QREFELT $ 18))
                                              'NIL)
                                             ('T 'T)))
                                          #5#))
                                       (SEQ
                                        (LETT |y|
                                         (SPADCALL |y| |q|
                                          (QREFELT $ 19)) . #4#)
                                        (EXIT
                                         (LETT |q|
                                          (SPADCALL |q| |y|
                                           (QREFELT $ 20)) . #4#)))
                                       NIL #6=(GO G190) G191
                                       (EXIT NIL))
                                      (EXIT
                                       (COND
                                         ((SPADCALL |q|
                                           (|spadConstant| $ 15)
                                           (QREFELT $ 18))
                                          (PROGN
                                            (LETT #3# 'NIL . #4#)
                                            (GO #3#))))))
                                     (LETT |j| (QSADD1 |j|) . #4#) #6#
                                     G191 (EXIT NIL))
                                (EXIT (LETT |distlist|
                                       (APPEND |distlist| (LIST |q|)) . #4#)))
                           (LETT |i| (QSADD1 |i|) . #4#) #6# G191
                           (EXIT NIL))
                      (EXIT 'T)))
           #3# (EXIT #3#))))) 

(DEFUN |LEADCDET;checkpow| (|a| |b| $)
  (PROG (|i| |qt| #0=#:G1843)
    (RETURN
      (SEQ (EXIT (SEQ (LETT |i| 0 . #1=(|LEADCDET;checkpow|)) G190 NIL
                      (SEQ (LETT |qt|
                                 (SPADCALL |b| |a| (QREFELT $ 24)) . #1#)
                           (COND
                             ((QEQCAR |qt| 1)
                              (PROGN (LETT #0# |i| . #1#) (GO #0#))))
                           (EXIT (LETT |b| (QCDR |qt|) . #1#)))
                      (LETT |i| (QSADD1 |i|) . #1#) (GO G190) G191
                      (EXIT NIL)))
           #0# (EXIT #0#))))) 

(DEFUN |LEADCDET;distribute|
       (|contm| |unilist| |pl| |vl| |lvar| |lval| $)
  (PROG (|nf| |lcp| |d| |i|)
    (RETURN
      (SEQ (LETT |nf| (LENGTH |unilist|) . #0=(|LEADCDET;distribute|))
           (SEQ (LETT |i| 1 . #0#) G190
                (COND ((QSGREATERP |i| |nf|) #1=(GO G191)))
                (SEQ (LETT |lcp|
                           (SPADCALL
                               (SPADCALL |unilist| |i| (QREFELT $ 27))
                               (QREFELT $ 28)) . #0#)
                     (LETT |d|
                           (SPADCALL |lcp|
                               (SPADCALL |vl| |i| (QREFELT $ 12))
                               (QREFELT $ 19)) . #0#)
                     (SPADCALL |pl| |i|
                         (SPADCALL (SPADCALL |lcp| |d| (QREFELT $ 20))
                             (SPADCALL |pl| |i| (QREFELT $ 30))
                             (QREFELT $ 31))
                         (QREFELT $ 32))
                     (LETT |d|
                           (SPADCALL (SPADCALL |vl| |i| (QREFELT $ 12))
                               |d| (QREFELT $ 20)) . #0#)
                     (SPADCALL |unilist| |i|
                         (SPADCALL |d|
                             (SPADCALL |unilist| |i| (QREFELT $ 27))
                             (QREFELT $ 33))
                         (QREFELT $ 34))
                     (EXIT (LETT |contm|
                                 (SPADCALL |contm| |d| (QREFELT $ 20)) . #0#)))
                (LETT |i| (QSADD1 |i|) . #0#) #2=(GO G190) G191
                (EXIT NIL))
           (COND
             ((NULL (SPADCALL |contm| (|spadConstant| $ 15)
                        (QREFELT $ 18)))
              (SEQ (LETT |i| 1 . #0#) G190
                   (COND ((QSGREATERP |i| |nf|) #1#))
                   (SEQ (EXIT (SPADCALL |pl| |i|
                                  (SPADCALL |contm|
                                      (SPADCALL |pl| |i|
                                       (QREFELT $ 30))
                                      (QREFELT $ 31))
                                  (QREFELT $ 32))))
                   (LETT |i| (QSADD1 |i|) . #0#) #2# G191 (EXIT NIL))))
           (EXIT (VECTOR |pl| |contm| |unilist|)))))) 

(DEFUN |LEADCDET;distFact;ZLRLLLU;4|
       (|contm| |unilist| |plead| |vl| |lvar| |lval| $)
  (PROG (|nf| |fpl| #0=#:G1878 |lpol| |lexp| #1=#:G1879 |vlp|
              #2=#:G1880 |aux| #3=#:G1881 |h| |d| |c| |k| #4=#:G1882
              #5=#:G1877 #6=#:G1883 |i|)
    (RETURN
      (SEQ (EXIT (SEQ (LETT |lpol| NIL
                            . #7=(|LEADCDET;distFact;ZLRLLLU;4|))
                      (LETT |lexp| NIL . #7#)
                      (LETT |nf| (LENGTH |unilist|) . #7#)
                      (LETT |vl| (REVERSE |vl|) . #7#)
                      (SEQ (LETT |fpl| NIL . #7#)
                           (LETT #0# (QCDR |plead|) . #7#) G190
                           (COND
                             ((OR (ATOM #0#)
                                  (PROGN
                                    (LETT |fpl| (CAR #0#) . #7#)
                                    NIL))
                              #8=(GO G191)))
                           (SEQ (LETT |lpol|
                                      (CONS (QCAR |fpl|) |lpol|) . #7#)
                                (EXIT (LETT |lexp|
                                       (CONS (QCDR |fpl|) |lexp|) . #7#)))
                           (LETT #0# (CDR #0#) . #7#) #9=(GO G190) G191
                           (EXIT NIL))
                      (LETT |vlp|
                            (PROGN
                              (LETT #1# NIL . #7#)
                              (SEQ (LETT |i| 1 . #7#) G190
                                   (COND ((QSGREATERP |i| |nf|) #8#))
                                   (SEQ
                                    (EXIT
                                     (LETT #1#
                                      (CONS (|spadConstant| $ 15) #1#) . #7#)))
                                   (LETT |i| (QSADD1 |i|) . #7#) #9#
                                   G191 (EXIT (NREVERSE0 #1#)))) . #7#)
                      (LETT |aux|
                            (PROGN
                              (LETT #2# NIL . #7#)
                              (SEQ (LETT |i| 1 . #7#) G190
                                   (COND ((QSGREATERP |i| |nf|) #8#))
                                   (SEQ
                                    (EXIT
                                     (LETT #2#
                                      (CONS (|spadConstant| $ 16) #2#) . #7#)))
                                   (LETT |i| (QSADD1 |i|) . #7#) #9#
                                   G191 (EXIT (NREVERSE0 #2#)))) . #7#)
                      (SEQ (LETT |i| 1 . #7#) G190
                           (COND ((QSGREATERP |i| |nf|) #8#))
                           (SEQ (LETT |c|
                                      (SPADCALL |contm|
                                       (SPADCALL
                                        (SPADCALL |unilist| |i|
                                         (QREFELT $ 27))
                                        (QREFELT $ 28))
                                       (QREFELT $ 35)) . #7#)
                                (COND
                                  ((OR
                                    (SPADCALL |c| (|spadConstant| $ 15)
                                     (QREFELT $ 18))
                                    (SPADCALL |c|
                                     (SPADCALL (|spadConstant| $ 15)
                                      (QREFELT $ 36))
                                     (QREFELT $ 18)))
                                   (EXIT "next i")))
                                (SEQ (LETT |k| 1 . #7#)
                                     (LETT #3# (LENGTH |lpol|) . #7#)
                                     G190
                                     (COND ((QSGREATERP |k| #3#) #8#))
                                     (SEQ
                                      (EXIT
                                       (COND
                                         ((EQL
                                           (SPADCALL |lexp| |k|
                                            (QREFELT $ 38))
                                           0)
                                          "next factor")
                                         ('T
                                          (SEQ
                                           (LETT |h|
                                            (|LEADCDET;checkpow|
                                             (SPADCALL |vl| |k|
                                              (QREFELT $ 12))
                                             |c| $) . #7#)
                                           (EXIT
                                            (COND
                                              ((NULL (EQL |h| 0))
                                               (SEQ
                                                (COND
                                                  ((<
                                                    (SPADCALL |lexp|
                                                     |k|
                                                     (QREFELT $ 38))
                                                    |h|)
                                                   (PROGN
                                                     (LETT #5#
                                                      (CONS 1 "failed") . #7#)
                                                     (GO #5#))))
                                                (SPADCALL |lexp| |k|
                                                 (-
                                                  (SPADCALL |lexp| |k|
                                                   (QREFELT $ 38))
                                                  |h|)
                                                 (QREFELT $ 41))
                                                (SPADCALL |aux| |i|
                                                 (SPADCALL
                                                  (SPADCALL |aux| |i|
                                                   (QREFELT $ 30))
                                                  (SPADCALL
                                                   (SPADCALL |lpol| |k|
                                                    (QREFELT $ 30))
                                                   |h| (QREFELT $ 42))
                                                  (QREFELT $ 43))
                                                 (QREFELT $ 32))
                                                (LETT |d|
                                                 (SPADCALL
                                                  (SPADCALL |vl| |k|
                                                   (QREFELT $ 12))
                                                  |h| (QREFELT $ 44)) . #7#)
                                                (SPADCALL |vlp| |i|
                                                 (SPADCALL
                                                  (SPADCALL |vlp| |i|
                                                   (QREFELT $ 12))
                                                  |d| (QREFELT $ 35))
                                                 (QREFELT $ 45))
                                                (EXIT
                                                 (LETT |c|
                                                  (SPADCALL |c| |d|
                                                   (QREFELT $ 20)) . #7#)))))))))))
                                     (LETT |k| (QSADD1 |k|) . #7#) #9#
                                     G191 (EXIT NIL))
                                (EXIT (COND
                                        ((SPADCALL |contm|
                                          (|spadConstant| $ 15)
                                          (QREFELT $ 18))
                                         (SPADCALL |vlp| |i| |c|
                                          (QREFELT $ 45))))))
                           (LETT |i| (QSADD1 |i|) . #7#) #9# G191
                           (EXIT NIL))
                      (SEQ (LETT |k| 1 . #7#)
                           (LETT #4# (LENGTH |lpol|) . #7#) G190
                           (COND ((QSGREATERP |k| #4#) #8#))
                           (SEQ (EXIT (COND
                                        ((NULL
                                          (EQL
                                           (SPADCALL |lexp| |k|
                                            (QREFELT $ 38))
                                           0))
                                         (PROGN
                                           (LETT #5#
                                            (CONS 1 "failed") . #7#)
                                           (GO #5#))))))
                           (LETT |k| (QSADD1 |k|) . #7#) #9# G191
                           (EXIT NIL))
                      (EXIT (COND
                              ((SPADCALL |contm| (|spadConstant| $ 15)
                                   (QREFELT $ 18))
                               (CONS 0
                                     (VECTOR
                                      (PROGN
                                        (LETT #6# NIL . #7#)
                                        (SEQ (LETT |i| 1 . #7#) G190
                                         (COND
                                           ((QSGREATERP |i| |nf|) #8#))
                                         (SEQ
                                          (EXIT
                                           (LETT #6#
                                            (CONS
                                             (SPADCALL
                                              (SPADCALL |vlp| |i|
                                               (QREFELT $ 12))
                                              (SPADCALL |aux| |i|
                                               (QREFELT $ 30))
                                              (QREFELT $ 31))
                                             #6#) . #7#)))
                                         (LETT |i| (QSADD1 |i|) . #7#)
                                         #9# G191
                                         (EXIT (NREVERSE0 #6#))))
                                      (|spadConstant| $ 15) |unilist|)))
                              ('T
                               (CONS 0
                                     (|LEADCDET;distribute| |contm|
                                      |unilist| |aux| |vlp| |lvar|
                                      |lval| $)))))))
           #5# (EXIT #5#))))) 

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

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

(MAKEPROP '|LeadingCoefDetermination| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|local| |#3|) (|local| |#4|) (|Integer|) (|List| 8)
             (0 . |elt|)
             (|Record| (|:| |unit| $) (|:| |canonical| $)
                 (|:| |associate| $))
             (6 . |unitNormal|) (11 . |One|) (15 . |One|) (|Boolean|)
             (19 . =) (25 . |gcd|) (31 . |quo|) (|NonNegativeInteger|)
             |LEADCDET;polCase;ZNniLB;1| (|Union| $ '"failed")
             (37 . |exquo|) (|SparseUnivariatePolynomial| 8)
             (|List| 25) (43 . |elt|) (49 . |leadingCoefficient|)
             (|List| 9) (54 . |elt|) (60 . *) (66 . |setelt|) (73 . *)
             (79 . |setelt|) (86 . *) (92 . -) (|List| 10) (97 . |elt|)
             (103 . |Zero|) (107 . |Zero|) (111 . |setelt|) (118 . **)
             (124 . *) (130 . **) (136 . |setelt|)
             (|Record| (|:| |polfac| 29) (|:| |correct| 8)
                 (|:| |corrfact| 26))
             (|Union| 46 '"failed")
             (|Record| (|:| |irr| 9) (|:| |pow| 10))
             (|Record| (|:| |contp| 8) (|:| |factors| (|List| 48)))
             (|List| 6) |LEADCDET;distFact;ZLRLLLU;4|)
          '#(|polCase| 143 |distFact| 150) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 51
                                '(2 11 8 0 10 12 1 8 13 0 14 0 8 0 15 0
                                  9 0 16 2 8 17 0 0 18 2 8 0 0 0 19 2 8
                                  0 0 0 20 2 8 23 0 0 24 2 26 25 0 10
                                  27 1 25 8 0 28 2 29 9 0 10 30 2 9 0 8
                                  0 31 3 29 9 0 10 9 32 2 25 0 8 0 33 3
                                  26 25 0 10 25 34 2 8 0 0 0 35 1 8 0 0
                                  36 2 37 10 0 10 38 0 7 0 39 0 8 0 40
                                  3 37 10 0 10 10 41 2 9 0 0 21 42 2 9
                                  0 0 0 43 2 8 0 0 21 44 3 11 8 0 10 8
                                  45 3 0 17 8 21 11 22 6 0 47 8 26 49
                                  11 50 11 51)))))
          '|lookupComplete|)) 
