
(/VERSIONCHECK 2) 

(DEFUN |UPMP;noKaratsuba;3U;1| (|a| |b| $)
  (PROG (|lu| |u| #0=#:G1838 |res|)
    (RETURN
      (SEQ (COND
             ((SPADCALL |a| (QREFELT $ 9)) |a|)
             ((SPADCALL |b| (QREFELT $ 9)) |b|)
             ((ZEROP (SPADCALL |a| (QREFELT $ 11)))
              (SPADCALL (SPADCALL |a| (QREFELT $ 12)) |b|
                  (QREFELT $ 13)))
             ((ZEROP (SPADCALL |b| (QREFELT $ 11)))
              (SPADCALL |a| (SPADCALL |b| (QREFELT $ 12))
                  (QREFELT $ 14)))
             ('T
              (SEQ (LETT |lu| (REVERSE (SPADCALL |a| (QREFELT $ 16)))
                         . #1=(|UPMP;noKaratsuba;3U;1|))
                   (LETT |res| (|spadConstant| $ 17) . #1#)
                   (SEQ (LETT |u| NIL . #1#) (LETT #0# |lu| . #1#) G190
                        (COND
                          ((OR (ATOM #0#)
                               (PROGN (LETT |u| (CAR #0#) . #1#) NIL))
                           (GO G191)))
                        (SEQ (EXIT (LETT |res|
                                    (SPADCALL |res|
                                     (SPADCALL |u| (QREFELT $ 12))
                                     (SPADCALL |u| (QREFELT $ 11)) |b|
                                     (QREFELT $ 18)) . #1#)))
                        (LETT #0# (CDR #0#) . #1#) (GO G190) G191
                        (EXIT NIL))
                   (EXIT |res|)))))))) 

(DEFUN |UPMP;karatsubaOnce;3U;2| (|a| |b| $)
  (PROG (|da| |db| |d| |n| |ha| |la| |rec| |hb| |lb| |u| |v| |w|)
    (RETURN
      (SEQ (LETT |da| (SPADCALL |a| (QREFELT $ 20))
                 . #0=(|UPMP;karatsubaOnce;3U;2|))
           (LETT |db| (SPADCALL |b| (QREFELT $ 20)) . #0#)
           (COND
             ((NULL (ZEROP |da|))
              (LETT |a| (SPADCALL |a| |da| (QREFELT $ 21)) . #0#)))
           (COND
             ((NULL (ZEROP |db|))
              (LETT |b| (SPADCALL |b| |db| (QREFELT $ 21)) . #0#)))
           (LETT |d| (+ |da| |db|) . #0#)
           (LETT |n|
                 (QUOTIENT2
                     (MIN (SPADCALL |a| (QREFELT $ 11))
                          (SPADCALL |b| (QREFELT $ 11)))
                     2) . #0#)
           (LETT |rec| (SPADCALL |a| |n| (QREFELT $ 23)) . #0#)
           (LETT |ha| (QCAR |rec|) . #0#)
           (LETT |la| (QCDR |rec|) . #0#)
           (LETT |rec| (SPADCALL |b| |n| (QREFELT $ 23)) . #0#)
           (LETT |hb| (QCAR |rec|) . #0#)
           (LETT |lb| (QCDR |rec|) . #0#)
           (LETT |w|
                 (SPADCALL (SPADCALL |ha| |la| (QREFELT $ 24))
                     (SPADCALL |lb| |hb| (QREFELT $ 24))
                     (QREFELT $ 25)) . #0#)
           (LETT |u| (SPADCALL |la| |lb| (QREFELT $ 25)) . #0#)
           (LETT |v| (SPADCALL |ha| |hb| (QREFELT $ 25)) . #0#)
           (LETT |w|
                 (SPADCALL |w| (SPADCALL |u| |v| (QREFELT $ 26))
                     (QREFELT $ 26)) . #0#)
           (LETT |w|
                 (SPADCALL (SPADCALL |w| |n| (QREFELT $ 27)) |u|
                     (QREFELT $ 26)) . #0#)
           (EXIT (COND
                   ((ZEROP |d|)
                    (SPADCALL
                        (SPADCALL |v| (SPADCALL 2 |n| (QREFELT $ 29))
                            (QREFELT $ 27))
                        |w| (QREFELT $ 26)))
                   ('T
                    (SPADCALL
                        (SPADCALL |v|
                            (+ (SPADCALL 2 |n| (QREFELT $ 29)) |d|)
                            (QREFELT $ 27))
                        (SPADCALL |w| |d| (QREFELT $ 27))
                        (QREFELT $ 26))))))))) 

(DEFUN |UPMP;karatsuba;2U2NniU;3| (|a| |b| |l| |k| $)
  (PROG (|da| |db| |d| |n| #0=#:G1851 |ha| |la| |rec| |hb| |lb| |u| |v|
              |w|)
    (RETURN
      (SEQ (COND
             ((OR (ZEROP |k|)
                  (OR (< (SPADCALL |a| (QREFELT $ 11)) |l|)
                      (OR (< (SPADCALL |b| (QREFELT $ 11)) |l|)
                          (OR (< (SPADCALL |a| (QREFELT $ 31)) |l|)
                              (< (SPADCALL |b| (QREFELT $ 31)) |l|)))))
              (SPADCALL |a| |b| (QREFELT $ 19)))
             ('T
              (SEQ (LETT |da| (SPADCALL |a| (QREFELT $ 20))
                         . #1=(|UPMP;karatsuba;2U2NniU;3|))
                   (LETT |db| (SPADCALL |b| (QREFELT $ 20)) . #1#)
                   (COND
                     ((NULL (ZEROP |da|))
                      (LETT |a|
                            (SPADCALL |a| |da| (QREFELT $ 21)) . #1#)))
                   (COND
                     ((NULL (ZEROP |db|))
                      (LETT |b|
                            (SPADCALL |b| |db| (QREFELT $ 21)) . #1#)))
                   (LETT |d| (+ |da| |db|) . #1#)
                   (LETT |n|
                         (QUOTIENT2
                             (MIN (SPADCALL |a| (QREFELT $ 11))
                                  (SPADCALL |b| (QREFELT $ 11)))
                             2) . #1#)
                   (LETT |k|
                         (PROG2 (LETT #0#
                                      (SPADCALL |k| 1 (QREFELT $ 35)) . #1#)
                                (QCDR #0#)
                           (|check-union| (QEQCAR #0# 0)
                               (|NonNegativeInteger|) #0#)) . #1#)
                   (LETT |rec| (SPADCALL |a| |n| (QREFELT $ 23)) . #1#)
                   (LETT |ha| (QCAR |rec|) . #1#)
                   (LETT |la| (QCDR |rec|) . #1#)
                   (LETT |rec| (SPADCALL |b| |n| (QREFELT $ 23)) . #1#)
                   (LETT |hb| (QCAR |rec|) . #1#)
                   (LETT |lb| (QCDR |rec|) . #1#)
                   (LETT |w|
                         (SPADCALL (SPADCALL |ha| |la| (QREFELT $ 24))
                             (SPADCALL |lb| |hb| (QREFELT $ 24)) |l|
                             |k| (QREFELT $ 36)) . #1#)
                   (LETT |u|
                         (SPADCALL |la| |lb| |l| |k| (QREFELT $ 36)) . #1#)
                   (LETT |v|
                         (SPADCALL |ha| |hb| |l| |k| (QREFELT $ 36)) . #1#)
                   (LETT |w|
                         (SPADCALL |w|
                             (SPADCALL |u| |v| (QREFELT $ 26))
                             (QREFELT $ 26)) . #1#)
                   (LETT |w|
                         (SPADCALL (SPADCALL |w| |n| (QREFELT $ 27))
                             |u| (QREFELT $ 26)) . #1#)
                   (EXIT (COND
                           ((ZEROP |d|)
                            (SPADCALL
                                (SPADCALL |v|
                                    (SPADCALL 2 |n| (QREFELT $ 29))
                                    (QREFELT $ 27))
                                |w| (QREFELT $ 26)))
                           ('T
                            (SPADCALL
                                (SPADCALL |v|
                                    (+ (SPADCALL 2 |n| (QREFELT $ 29))
                                     |d|)
                                    (QREFELT $ 27))
                                (SPADCALL |w| |d| (QREFELT $ 27))
                                (QREFELT $ 26)))))))))))) 

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

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

(MAKEPROP '|UnivariatePolynomialMultiplicationPackage| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|Boolean|) (0 . |zero?|) (|NonNegativeInteger|)
             (5 . |degree|) (10 . |leadingCoefficient|) (15 . *)
             (21 . *) (|List| $) (27 . |monomials|) (32 . |Zero|)
             (36 . |pomopo!|) |UPMP;noKaratsuba;3U;1|
             (44 . |minimumDegree|) (49 . |shiftRight|)
             (|Record| (|:| |quotient| $) (|:| |remainder| $))
             (55 . |karatsubaDivide|) (61 . -) (67 . *) (73 . +)
             (79 . |shiftLeft|) (|PositiveInteger|) (85 . *)
             |UPMP;karatsubaOnce;3U;2| (91 . |numberOfMonomials|)
             (96 . |One|) (100 . |One|) (|Union| $ '"failed")
             (104 . |subtractIfCan|) |UPMP;karatsuba;2U2NniU;3|)
          '#(|noKaratsuba| 110 |karatsubaOnce| 116 |karatsuba| 122)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 36
                                '(1 7 8 0 9 1 7 10 0 11 1 7 6 0 12 2 7
                                  0 6 0 13 2 7 0 0 6 14 1 7 15 0 16 0 7
                                  0 17 4 7 0 0 6 10 0 18 1 7 10 0 20 2
                                  7 0 0 10 21 2 7 22 0 10 23 2 7 0 0 0
                                  24 2 7 0 0 0 25 2 7 0 0 0 26 2 7 0 0
                                  10 27 2 10 0 28 0 29 1 7 10 0 31 0 6
                                  0 32 0 7 0 33 2 10 34 0 0 35 2 0 7 7
                                  7 19 2 0 7 7 7 30 4 0 7 7 7 10 10 36)))))
          '|lookupComplete|)) 
