
(/VERSIONCHECK 2) 

(DEFUN |PMKERNEL;patternMatchArg| (|ls| |lp| |l| $)
  (PROG (#0=#:G1844 #1=#:G1843 #2=#:G1837 |s| #3=#:G1846 |p| #4=#:G1845
            #5=#:G1842 #6=#:G1840)
    (RETURN
      (SEQ (EXIT (COND
                   ((NULL (EQL (LENGTH |ls|) (LENGTH |lp|)))
                    (SPADCALL (QREFELT $ 9)))
                   ('T
                    (SEQ (SEQ (EXIT (SEQ
                                     (LETT |s| NIL
                                      . #7=(|PMKERNEL;patternMatchArg|))
                                     (LETT #0# |ls| . #7#)
                                     (LETT |p| NIL . #7#)
                                     (LETT #1# |lp| . #7#) G190
                                     (COND
                                       ((OR (ATOM #1#)
                                         (PROGN
                                           (LETT |p| (CAR #1#) . #7#)
                                           NIL)
                                         (ATOM #0#)
                                         (PROGN
                                           (LETT |s| (CAR #0#) . #7#)
                                           NIL))
                                        #8=(GO G191)))
                                     (SEQ
                                      (EXIT
                                       (COND
                                         ((SPADCALL |p| (QREFELT $ 12))
                                          (COND
                                            ((SPADCALL
                                              (LETT |l|
                                               (SPADCALL |p| |s| |l|
                                                (QREFELT $ 13)) . #7#)
                                              (QREFELT $ 14))
                                             (PROGN
                                               (LETT #2#
                                                (PROGN
                                                  (LETT #5#
                                                   (SPADCALL
                                                    (QREFELT $ 9)) . #7#)
                                                  (GO #5#)) . #7#)
                                               (GO #2#))))))))
                                     (LETT #1#
                                      (PROG1 (CDR #1#)
                                        (LETT #0# (CDR #0#) . #7#)) . #7#)
                                     #9=(GO G190) G191 (EXIT NIL)))
                              #2# (EXIT #2#))
                         (SEQ (EXIT (SEQ (LETT |s| NIL . #7#)
                                     (LETT #3# |ls| . #7#)
                                     (LETT |p| NIL . #7#)
                                     (LETT #4# |lp| . #7#) G190
                                     (COND
                                       ((OR (ATOM #4#)
                                         (PROGN
                                           (LETT |p| (CAR #4#) . #7#)
                                           NIL)
                                         (ATOM #3#)
                                         (PROGN
                                           (LETT |s| (CAR #3#) . #7#)
                                           NIL))
                                        #8#))
                                     (SEQ
                                      (EXIT
                                       (COND
                                         ((NULL
                                           (SPADCALL |p|
                                            (QREFELT $ 12)))
                                          (COND
                                            ((SPADCALL
                                              (LETT |l|
                                               (SPADCALL |s| |p| |l|
                                                (QREFELT $ 16)) . #7#)
                                              (QREFELT $ 14))
                                             (PROGN
                                               (LETT #6#
                                                (PROGN
                                                  (LETT #5#
                                                   (SPADCALL
                                                    (QREFELT $ 9)) . #7#)
                                                  (GO #5#)) . #7#)
                                               (GO #6#))))))))
                                     (LETT #4#
                                      (PROG1 (CDR #4#)
                                        (LETT #3# (CDR #3#) . #7#)) . #7#)
                                     #9# G191 (EXIT NIL)))
                              #6# (EXIT #6#))
                         (EXIT |l|)))))
           #5# (EXIT #5#))))) 

(DEFUN |PMKERNEL;patternMatchInner| (|s| |p| |l| $)
  (PROG (|u| #0=#:G1856 |ur| |v| |w| #1=#:G1867)
    (RETURN
      (SEQ (COND
             ((SPADCALL |p| (QREFELT $ 12))
              (CONS 0
                    (SPADCALL |p| (SPADCALL |s| (QREFELT $ 18)) |l|
                        (QREFELT $ 13))))
             ((QEQCAR (LETT |u| (SPADCALL |p| (QREFELT $ 21))
                            . #2=(|PMKERNEL;patternMatchInner|))
                      0)
              (SEQ (LETT |ur|
                         (PROG2 (LETT #0# |u| . #2#) (QCDR #0#)
                           (|check-union| (QEQCAR #0# 0)
                               (|Record| (|:| |op| (|BasicOperator|))
                                   (|:| |arg|
                                    (|List| (|Pattern| (QREFELT $ 6)))))
                               #0#)) . #2#)
                   (EXIT (COND
                           ((SPADCALL (QCAR |ur|)
                                (SPADCALL |s| (QREFELT $ 24))
                                (QREFELT $ 25))
                            (CONS 0
                                  (|PMKERNEL;patternMatchArg|
                                      (SPADCALL |s| (QREFELT $ 27))
                                      (QCDR |ur|) |l| $)))
                           ('T (CONS 0 (SPADCALL (QREFELT $ 9))))))))
             ((SPADCALL |p| (QREFELT $ 28))
              (SEQ (EXIT (SEQ (SEQ (LETT |v|
                                    (SPADCALL |p| (QREFELT $ 30)) . #2#)
                                   (EXIT
                                    (COND
                                      ((QEQCAR |v| 0)
                                       (SEQ
                                        (LETT |w|
                                         (SPADCALL |s| (QREFELT $ 31)) . #2#)
                                        (EXIT
                                         (COND
                                           ((QEQCAR |w| 0)
                                            (COND
                                              ((EQUAL (QCDR |v|)
                                                (QCDR |w|))
                                               (PROGN
                                                 (LETT #1#
                                                  (CONS 0 |l|) . #2#)
                                                 (GO #1#))))))))))))
                              (EXIT (CONS 0 (SPADCALL (QREFELT $ 9))))))
                   #1# (EXIT #1#)))
             ('T (CONS 1 "failed"))))))) 

(DEFUN |PMKERNEL;patternMatchOpt| (|x| |lp| |l| |id| $)
  (PROG (|u| #0=#:G1876)
    (RETURN
      (COND
        ((QEQCAR (LETT |u| (SPADCALL |lp| (QREFELT $ 34))
                       . #1=(|PMKERNEL;patternMatchOpt|))
                 0)
         (COND
           ((SPADCALL
                (LETT |l|
                      (SPADCALL
                          (|SPADfirst|
                              (PROG2 (LETT #0# |u| . #1#) (QCDR #0#)
                                (|check-union| (QEQCAR #0# 0)
                                    (|List| (|Pattern| (QREFELT $ 6)))
                                    #0#)))
                          |id| |l| (QREFELT $ 13)) . #1#)
                (QREFELT $ 14))
            (SPADCALL (QREFELT $ 9)))
           ('T
            (SPADCALL |x|
                (SPADCALL
                    (PROG2 (LETT #0# |u| . #1#) (QCDR #0#)
                      (|check-union| (QEQCAR #0# 0)
                          (|List| (|Pattern| (QREFELT $ 6))) #0#))
                    (QREFELT $ 36))
                |l| (QREFELT $ 16)))))
        ('T (SPADCALL (QREFELT $ 9))))))) 

(DEFUN |PMKERNEL;patternMatchMonoid| (|s| |p| |l| $)
  (PROG (|u| |v| #0=#:G1890 |vr| |op| |arg| |r| #1=#:G1901 |w|
             #2=#:G1904)
    (RETURN
      (SEQ (LETT |u| (|PMKERNEL;patternMatchInner| |s| |p| |l| $)
                 . #3=(|PMKERNEL;patternMatchMonoid|))
           (EXIT (COND
                   ((QEQCAR |u| 0) (CONS 0 (QCDR |u|)))
                   ((QEQCAR (LETT |v|
                                  (SPADCALL |p| (QREFELT $ 39)) . #3#)
                            0)
                    (SEQ (LETT |vr|
                               (PROG2 (LETT #0# |v| . #3#) (QCDR #0#)
                                 (|check-union| (QEQCAR #0# 0)
                                     (|Record|
                                      (|:| |val|
                                       (|Pattern| (QREFELT $ 6)))
                                      (|:| |exponent|
                                       (|Pattern| (QREFELT $ 6))))
                                     #0#)) . #3#)
                         (EXIT (COND
                                 ((SPADCALL
                                      (LETT |op|
                                       (SPADCALL |s| (QREFELT $ 24)) . #3#)
                                      (SPADCALL "%power"
                                       (QREFELT $ 42))
                                      (QREFELT $ 43))
                                  (CONS 0
                                        (|PMKERNEL;patternMatchArg|
                                         (SPADCALL |s| (QREFELT $ 27))
                                         (LIST (QCAR |vr|) (QCDR |vr|))
                                         |l| $)))
                                 ('T
                                  (SEQ (EXIT
                                        (SEQ
                                         (COND
                                           ((SPADCALL |op|
                                             (SPADCALL "nthRoot"
                                              (QREFELT $ 42))
                                             (QREFELT $ 43))
                                            (SEQ
                                             (LETT |r|
                                              (SPADCALL
                                               (SPADCALL
                                                (LETT |arg|
                                                 (SPADCALL |s|
                                                  (QREFELT $ 27)) . #3#)
                                                (QREFELT $ 44))
                                               (QREFELT $ 46)) . #3#)
                                             (EXIT
                                              (COND
                                                ((QEQCAR |r| 0)
                                                 (PROGN
                                                   (LETT #1#
                                                    (CONS 0
                                                     (|PMKERNEL;patternMatchArg|
                                                      (LIST
                                                       (|SPADfirst|
                                                        |arg|)
                                                       (QCDR |r|))
                                                      (LIST (QCAR |vr|)
                                                       (QCDR |vr|))
                                                      |l| $)) . #3#)
                                                   (GO #1#))))))))
                                         (EXIT
                                          (COND
                                            ((SPADCALL (QCDR |vr|)
                                              (QREFELT $ 47))
                                             (COND
                                               ((SPADCALL
                                                 (LETT |l|
                                                  (SPADCALL (QCDR |vr|)
                                                   (|spadConstant| $
                                                    48)
                                                   |l| (QREFELT $ 13)) . #3#)
                                                 (QREFELT $ 14))
                                                (CONS 0
                                                 (SPADCALL
                                                  (QREFELT $ 9))))
                                               ('T
                                                (CONS 0
                                                 (SPADCALL
                                                  (SPADCALL |s|
                                                   (QREFELT $ 18))
                                                  (QCAR |vr|) |l|
                                                  (QREFELT $ 16))))))
                                            ('T
                                             (CONS 0
                                              (SPADCALL (QREFELT $ 9))))))))
                                       #1# (EXIT #1#)))))))
                   ((QEQCAR (LETT |w|
                                  (SPADCALL |p| (QREFELT $ 49)) . #3#)
                            0)
                    (CONS 0
                          (|PMKERNEL;patternMatchOpt|
                              (SPADCALL |s| (QREFELT $ 18))
                              (PROG2 (LETT #2# |w| . #3#) (QCDR #2#)
                                (|check-union| (QEQCAR #2# 0)
                                    (|List| (|Pattern| (QREFELT $ 6)))
                                    #2#))
                              |l| (|spadConstant| $ 48) $)))
                   ('T (CONS 1 "failed")))))))) 

(DEFUN |PMKERNEL;patternMatch;KP2Pmr;5| (|s| |p| |l| $)
  (PROG (|u| |w| #0=#:G1914)
    (RETURN
      (SEQ (LETT |u| (|PMKERNEL;patternMatchMonoid| |s| |p| |l| $)
                 . #1=(|PMKERNEL;patternMatch;KP2Pmr;5|))
           (EXIT (COND
                   ((QEQCAR |u| 0) (QCDR |u|))
                   ((QEQCAR (LETT |w|
                                  (SPADCALL |p| (QREFELT $ 50)) . #1#)
                            0)
                    (|PMKERNEL;patternMatchOpt|
                        (SPADCALL |s| (QREFELT $ 18))
                        (PROG2 (LETT #0# |w| . #1#) (QCDR #0#)
                          (|check-union| (QEQCAR #0# 0)
                              (|List| (|Pattern| (QREFELT $ 6))) #0#))
                        |l| (|spadConstant| $ 51) $))
                   ('T (SPADCALL (QREFELT $ 9))))))))) 

(DEFUN |PMKERNEL;patternMatch;KP2Pmr;6| (|s| |p| |l| $)
  (PROG (|u|)
    (RETURN
      (SEQ (LETT |u| (|PMKERNEL;patternMatchMonoid| |s| |p| |l| $)
                 |PMKERNEL;patternMatch;KP2Pmr;6|)
           (EXIT (COND
                   ((QEQCAR |u| 0) (QCDR |u|))
                   ('T (SPADCALL (QREFELT $ 9))))))))) 

(DEFUN |PMKERNEL;patternMatch;KP2Pmr;7| (|s| |p| |l| $)
  (PROG (|u|)
    (RETURN
      (SEQ (LETT |u| (|PMKERNEL;patternMatchInner| |s| |p| |l| $)
                 |PMKERNEL;patternMatch;KP2Pmr;7|)
           (EXIT (COND
                   ((QEQCAR |u| 0) (QCDR |u|))
                   ('T (SPADCALL (QREFELT $ 9))))))))) 

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

(DEFUN |PatternMatchKernel;| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|PatternMatchKernel|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT |dv$| (LIST '|PatternMatchKernel| DV$1 DV$2) . #0#)
        (LETT $ (GETREFV 53) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|PatternMatchKernel|
            (LIST DV$1 DV$2) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (COND
          ((|HasCategory| |#2| '(|Monoid|))
           (PROGN
             (COND
               ((|HasCategory| |#2| '(|AbelianMonoid|))
                (QSETREFV $ 52
                    (CONS (|dispatchFunction|
                              |PMKERNEL;patternMatch;KP2Pmr;5|)
                          $)))
               ('T
                (QSETREFV $ 52
                    (CONS (|dispatchFunction|
                              |PMKERNEL;patternMatch;KP2Pmr;6|)
                          $))))))
          ('T
           (QSETREFV $ 52
               (CONS (|dispatchFunction|
                         |PMKERNEL;patternMatch;KP2Pmr;7|)
                     $))))
        $)))) 

(MAKEPROP '|PatternMatchKernel| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|PatternMatchResult| 6 7) (0 . |failed|) (|Boolean|)
             (|Pattern| 6) (4 . |generic?|) (9 . |addMatch|)
             (16 . |failed?|) (|PatternMatchResult| 6 $)
             (21 . |patternMatch|) (|Kernel| $) (28 . |coerce|)
             (|Record| (|:| |op| 22) (|:| |arg| 33))
             (|Union| 19 '"failed") (33 . |isOp|) (|BasicOperator|)
             (|Kernel| 7) (38 . |operator|) (43 . =) (|List| 7)
             (49 . |argument|) (54 . |constant?|)
             (|Union| 41 '"failed") (59 . |retractIfCan|)
             (64 . |symbolIfCan|) (|Union| 33 '"failed") (|List| $)
             (69 . |optpair|) (|List| 11) (74 . |second|)
             (|Record| (|:| |val| $) (|:| |exponent| $))
             (|Union| 37 '"failed") (79 . |isPower|) (|String|)
             (|Symbol|) (84 . |coerce|) (89 . |is?|) (95 . |second|)
             (|Union| $ '"failed") (100 . |recip|) (105 . |optional?|)
             (110 . |One|) (114 . |isTimes|) (119 . |isPlus|)
             (124 . |Zero|) (128 . |patternMatch|))
          '#(|patternMatch| 135) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 52
                                '(0 8 0 9 1 11 10 0 12 3 8 0 11 7 0 13
                                  1 8 10 0 14 3 7 15 0 11 15 16 1 7 0
                                  17 18 1 11 20 0 21 1 23 22 0 24 2 22
                                  10 0 0 25 1 23 26 0 27 1 11 10 0 28 1
                                  11 29 0 30 1 23 29 0 31 1 11 32 33 34
                                  1 35 11 0 36 1 11 38 0 39 1 41 0 40
                                  42 2 22 10 0 41 43 1 26 7 0 44 1 7 45
                                  0 46 1 11 10 0 47 0 7 0 48 1 11 32 0
                                  49 1 11 32 0 50 0 7 0 51 3 0 8 23 11
                                  8 52 3 0 8 23 11 8 52)))))
          '|lookupComplete|)) 
