
(/VERSIONCHECK 2) 

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

(DEFUN |CPMATCH;makePoly| (|cs| $)
  (SPADCALL
      (SPADCALL (SPADCALL |cs| (QREFELT $ 27)) (QREFELT $ 14)
          (QREFELT $ 28))
      (SPADCALL (SPADCALL |cs| (QREFELT $ 29)) (QREFELT $ 30))
      (QREFELT $ 31))) 

(DEFUN |CPMATCH;patternMatch;CSP2Pmr;3| (|cs| |pat| |result| $)
  (COND
    ((SPADCALL (SPADCALL |cs| (QREFELT $ 29)) (QREFELT $ 33))
     (SPADCALL (SPADCALL |cs| (QREFELT $ 27)) |pat| |result|
         (QREFELT $ 37)))
    ('T
     (SPADCALL (CONS (|function| |CPMATCH;makeComplex|) $)
         (SPADCALL (|CPMATCH;makePoly| |cs| $) |pat|
             (SPADCALL (CONS (|function| |CPMATCH;makePoly|) $)
                 |result| (QREFELT $ 41))
             (QREFELT $ 43))
         (QREFELT $ 46))))) 

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

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

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