
(/VERSIONCHECK 2) 

(DEFUN |CPMATCH;makeComplex| (|p| $)
  (PROG (|rcoef| |icoef| |up|)
    (RETURN
     (SEQ
      (LETT |up| (SPADCALL |p| (QREFELT $ 14)) . #1=(|CPMATCH;makeComplex|))
      (EXIT
       (COND
        ((< 1 (SPADCALL |up| (QREFELT $ 20))) (|error| "not linear in %i"))
        ('T
         (SEQ (LETT |icoef| (SPADCALL |up| (QREFELT $ 21)) . #1#)
              (LETT |rcoef|
                    (SPADCALL (SPADCALL |p| (QREFELT $ 22)) (QREFELT $ 23))
                    . #1#)
              (EXIT (SPADCALL |rcoef| |icoef| (QREFELT $ 24))))))))))) 

(DEFUN |CPMATCH;makePoly| (|cs| $)
  (SPADCALL
   (SPADCALL (SPADCALL |cs| (QREFELT $ 25)) (QREFELT $ 12) (QREFELT $ 26))
   (SPADCALL (SPADCALL |cs| (QREFELT $ 27)) (QREFELT $ 28)) (QREFELT $ 29))) 

(DEFUN |CPMATCH;patternMatch;CSP2Pmr;3| (|cs| |pat| |result| $)
  (COND
   ((SPADCALL (SPADCALL |cs| (QREFELT $ 27)) (QREFELT $ 31))
    (SPADCALL (SPADCALL |cs| (QREFELT $ 25)) |pat| |result| (QREFELT $ 35)))
   ('T
    (SPADCALL (CONS (|function| |CPMATCH;makeComplex|) $)
              (SPADCALL (|CPMATCH;makePoly| |cs| $) |pat|
                        (SPADCALL (CONS (|function| |CPMATCH;makePoly|) $)
                                  |result| (QREFELT $ 39))
                        (QREFELT $ 41))
              (QREFELT $ 44))))) 

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

(DEFUN |ComplexPatternMatch;| (|#1| |#2| |#3|)
  (PROG (|pv$| $ |dv$| DV$3 DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|ComplexPatternMatch|))
      (LETT DV$2 (|devaluate| |#2|) . #1#)
      (LETT DV$3 (|devaluate| |#3|) . #1#)
      (LETT |dv$| (LIST '|ComplexPatternMatch| DV$1 DV$2 DV$3) . #1#)
      (LETT $ (GETREFV 46) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3
                (LETT |pv$|
                      (|buildPredVector| 0 0
                                         (LIST
                                          (|HasCategory| (|Polynomial| |#2|)
                                                         (LIST
                                                          '|PatternMatchable|
                                                          (|devaluate|
                                                           |#1|)))))
                      . #1#))
      (|haddProp| |$ConstructorCache| '|ComplexPatternMatch|
                  (LIST DV$1 DV$2 DV$3) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 |#2|)
      (QSETREFV $ 8 |#3|)
      (QSETREFV $ 12 (SPADCALL '|%i| (QREFELT $ 11)))
      (COND
       ((|testBitVector| |pv$| 1)
        (QSETREFV $ 45
                  (CONS (|dispatchFunction| |CPMATCH;patternMatch;CSP2Pmr;3|)
                        $))))
      $)))) 

(MAKEPROP '|ComplexPatternMatch| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
              (|local| |#3|) (|Symbol|) (|Polynomial| 7) (0 . |coerce|) '|ivar|
              (|SparseUnivariatePolynomial| 7) (5 . |univariate|) (10 . |One|)
              (14 . |One|) (18 . |One|) (22 . |One|) (|NonNegativeInteger|)
              (26 . |degree|) (31 . |leadingCoefficient|) (36 . |reductum|)
              (41 . |leadingCoefficient|) (46 . |complex|) (52 . |real|)
              (57 . *) (63 . |imag|) (68 . |coerce|) (73 . +) (|Boolean|)
              (79 . |zero?|) (|PatternMatchResult| 6 8) (|Pattern| 6)
              (|PatternMatchPushDown| 6 7 8) (84 . |patternMatch|)
              (|PatternMatchResult| 6 10) (|Mapping| 10 8)
              (|PatternMatchResultFunctions2| 6 8 10) (91 . |map|)
              (|PatternMatchResult| 6 $) (97 . |patternMatch|) (|Mapping| 8 10)
              (|PatternMatchResultFunctions2| 6 10 8) (104 . |map|)
              (110 . |patternMatch|))
           '#(|patternMatch| 117) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 45
                                                 '(1 10 0 9 11 1 10 13 0 14 0 7
                                                   0 15 0 8 0 16 0 10 0 17 0 13
                                                   0 18 1 13 19 0 20 1 13 7 0
                                                   21 1 10 0 0 22 1 10 7 0 23 2
                                                   8 0 7 7 24 1 8 7 0 25 2 10 0
                                                   7 0 26 1 8 7 0 27 1 10 0 7
                                                   28 2 10 0 0 0 29 1 7 30 0 31
                                                   3 34 32 7 33 32 35 2 38 36
                                                   37 32 39 3 10 40 0 33 40 41
                                                   2 43 32 42 36 44 3 0 32 8 33
                                                   32 45 3 1 32 8 33 32 45)))))
           '|lookupComplete|)) 
