
(/VERSIONCHECK 2) 

(DEFUN |CLIP;Fnan?| (|x| $) (SPADCALL |x| |x| (QREFELT $ 8))) 

(DEFUN |CLIP;Pnan?| (|p| $)
  (SPADCALL (CONS (|function| |CLIP;Fnan?|) $) |p| (QREFELT $ 11))) 

(DEFUN |CLIP;iClipParametric| (|pointLists| |fraction| |scale| $)
  (PROG (|sortedList| |n| |num| |den| |clipNum| |lastN| |firstPt| |pt|
            #0=#:G1863 |k| |xDiff| |yDiff| |numm| |denn| |newclip| |xs|
            |ys| |xMin| |yMin| |xMax| |yMax| |xseg| |yseg|)
    (RETURN
      (SEQ (COND
             ((OR (SPADCALL |fraction| (|spadConstant| $ 13)
                      (QREFELT $ 14))
                  (SPADCALL (|spadConstant| $ 15) |fraction|
                      (QREFELT $ 14)))
              (|error| "clipDraw: fraction should be between 0 and 1"))
             ('T
              (COND
                ((NULL |pointLists|)
                 (VECTOR NIL (SPADCALL 0.0 0.0 (QREFELT $ 17))
                         (SPADCALL 0.0 0.0 (QREFELT $ 17))))
                ('T
                 (SEQ (LETT |sortedList|
                            (SPADCALL
                                (CONS #'|CLIP;iClipParametric!0| $)
                                (SPADCALL
                                    (CONS #'|CLIP;iClipParametric!1| $)
                                    (SPADCALL |pointLists|
                                     (QREFELT $ 24))
                                    (QREFELT $ 26))
                                (QREFELT $ 28))
                            . #1=(|CLIP;iClipParametric|))
                      (EXIT (COND
                              ((NULL |sortedList|)
                               (VECTOR NIL
                                       (SPADCALL 0.0 0.0
                                        (QREFELT $ 17))
                                       (SPADCALL 0.0 0.0
                                        (QREFELT $ 17))))
                              ('T
                               (SEQ (LETT |n|
                                     (LENGTH |sortedList|) . #1#)
                                    (LETT |num|
                                     (SPADCALL |fraction|
                                      (QREFELT $ 30)) . #1#)
                                    (LETT |den|
                                     (SPADCALL |fraction|
                                      (QREFELT $ 31)) . #1#)
                                    (LETT |clipNum|
                                     (QUOTIENT2
                                      (SPADCALL |n| |num|
                                       (QREFELT $ 33))
                                      |den|) . #1#)
                                    (LETT |lastN|
                                     (- (- |n| 1) |clipNum|) . #1#)
                                    (LETT |firstPt|
                                     (|SPADfirst| |sortedList|) . #1#)
                                    (LETT |xMin|
                                     (SPADCALL |firstPt|
                                      (QREFELT $ 35)) . #1#)
                                    (LETT |xMax|
                                     (SPADCALL |firstPt|
                                      (QREFELT $ 35)) . #1#)
                                    (LETT |yMin|
                                     (SPADCALL |firstPt|
                                      (QREFELT $ 36)) . #1#)
                                    (LETT |yMax|
                                     (SPADCALL |firstPt|
                                      (QREFELT $ 36)) . #1#)
                                    (SEQ (LETT |pt| NIL . #1#)
                                     (LETT #0#
                                      (CDR |sortedList|) . #1#)
                                     (LETT |k| 0 . #1#) G190
                                     (COND
                                       ((OR (QSGREATERP |k| |lastN|)
                                         (ATOM #0#)
                                         (PROGN
                                           (LETT |pt| (CAR #0#) . #1#)
                                           NIL))
                                        (GO G191)))
                                     (SEQ
                                      (LETT |xMin|
                                       (MIN |xMin|
                                        (SPADCALL |pt| (QREFELT $ 35))) . #1#)
                                      (LETT |xMax|
                                       (MAX |xMax|
                                        (SPADCALL |pt| (QREFELT $ 35))) . #1#)
                                      (LETT |yMin|
                                       (MIN |yMin|
                                        (SPADCALL |pt| (QREFELT $ 36))) . #1#)
                                      (EXIT
                                       (LETT |yMax|
                                        (MAX |yMax|
                                         (SPADCALL |pt| (QREFELT $ 36))) . #1#)))
                                     (LETT |k|
                                      (PROG1 (QSADD1 |k|)
                                        (LETT #0# (CDR #0#) . #1#)) . #1#)
                                     (GO G190) G191 (EXIT NIL))
                                    (LETT |xDiff|
                                     (- |xMax| |xMin|) . #1#)
                                    (LETT |yDiff|
                                     (- |yMax| |yMin|) . #1#)
                                    (EXIT
                                     (COND
                                       ((= |xDiff| 0.0)
                                        (COND
                                          ((= |yDiff| 0.0)
                                           (VECTOR |pointLists|
                                            (SPADCALL (- |xMin| 1.0)
                                             (+ |xMax| 1.0)
                                             (QREFELT $ 17))
                                            (SPADCALL (- |yMin| 1.0)
                                             (+ |yMax| 1.0)
                                             (QREFELT $ 17))))
                                          ('T
                                           (VECTOR |pointLists|
                                            (SPADCALL (- |xMin| 1.0)
                                             (+ |xMax| 1.0)
                                             (QREFELT $ 17))
                                            (SPADCALL |yMin| |yMax|
                                             (QREFELT $ 17))))))
                                       ((= |yDiff| 0.0)
                                        (VECTOR |pointLists|
                                         (SPADCALL |xMin| |xMax|
                                          (QREFELT $ 17))
                                         (SPADCALL (- |yMin| 1.0)
                                          (+ |yMax| 1.0)
                                          (QREFELT $ 17))))
                                       ('T
                                        (SEQ
                                         (LETT |numm|
                                          (SPADCALL |scale|
                                           (QREFELT $ 30)) . #1#)
                                         (LETT |denn|
                                          (SPADCALL |scale|
                                           (QREFELT $ 31)) . #1#)
                                         (LETT |xMin|
                                          (- |xMin|
                                           (/
                                            (*
                                             (FLOAT |numm|
                                              MOST-POSITIVE-DOUBLE-FLOAT)
                                             |xDiff|)
                                            (FLOAT |denn|
                                             MOST-POSITIVE-DOUBLE-FLOAT))) . #1#)
                                         (LETT |xMax|
                                          (+ |xMax|
                                           (/
                                            (*
                                             (FLOAT |numm|
                                              MOST-POSITIVE-DOUBLE-FLOAT)
                                             |xDiff|)
                                            (FLOAT |denn|
                                             MOST-POSITIVE-DOUBLE-FLOAT))) . #1#)
                                         (LETT |yMin|
                                          (- |yMin|
                                           (/
                                            (*
                                             (FLOAT |numm|
                                              MOST-POSITIVE-DOUBLE-FLOAT)
                                             |yDiff|)
                                            (FLOAT |denn|
                                             MOST-POSITIVE-DOUBLE-FLOAT))) . #1#)
                                         (LETT |yMax|
                                          (+ |yMax|
                                           (/
                                            (*
                                             (FLOAT |numm|
                                              MOST-POSITIVE-DOUBLE-FLOAT)
                                             |yDiff|)
                                            (FLOAT |denn|
                                             MOST-POSITIVE-DOUBLE-FLOAT))) . #1#)
                                         (LETT |newclip|
                                          (SPADCALL |pointLists| |xMin|
                                           |xMax| |yMin| |yMax|
                                           (QREFELT $ 39)) . #1#)
                                         (EXIT
                                          (COND
                                            ((< (LENGTH |pointLists|)
                                              (LENGTH
                                               (QVELT |newclip| 0)))
                                             |newclip|)
                                            ('T
                                             (SEQ
                                              (LETT |xs|
                                               (SPADCALL (ELT $ 35)
                                                |sortedList|
                                                (QREFELT $ 43)) . #1#)
                                              (LETT |ys|
                                               (SPADCALL (ELT $ 36)
                                                |sortedList|
                                                (QREFELT $ 43)) . #1#)
                                              (LETT |xMin|
                                               (SPADCALL (ELT $ 44)
                                                |xs| (QREFELT $ 46)) . #1#)
                                              (LETT |yMin|
                                               (SPADCALL (ELT $ 44)
                                                |ys| (QREFELT $ 46)) . #1#)
                                              (LETT |xMax|
                                               (SPADCALL (ELT $ 47)
                                                |xs| (QREFELT $ 46)) . #1#)
                                              (LETT |yMax|
                                               (SPADCALL (ELT $ 47)
                                                |ys| (QREFELT $ 46)) . #1#)
                                              (LETT |xseg|
                                               (SPADCALL |xMin| |xMax|
                                                (QREFELT $ 48)) . #1#)
                                              (LETT |yseg|
                                               (SPADCALL |yMin| |yMax|
                                                (QREFELT $ 48)) . #1#)
                                              (EXIT
                                               (VECTOR |pointLists|
                                                |xseg| |yseg|))))))))))))))))))))))) 

(DEFUN |CLIP;iClipParametric!1| (|#1| $)
  (COND
    ((|CLIP;Pnan?| |#1| $) (|spadConstant| $ 20))
    ('T (|spadConstant| $ 21)))) 

(DEFUN |CLIP;iClipParametric!0| (|#1| |#2| $)
  (SPADCALL (|CLIP;norm| |#1| $) (|CLIP;norm| |#2| $) (QREFELT $ 19))) 

(DEFUN |CLIP;point| (|xx| |yy| $)
  (PROG (|l|)
    (RETURN
      (SPADCALL (LETT |l| (LIST |xx| |yy|) |CLIP;point|)
          (QREFELT $ 49))))) 

(DEFUN |CLIP;intersectWithHorizLine| (|x1| |y1| |x2| |y2| |yy| $)
  (COND
    ((= |x1| |x2|) (|CLIP;point| |x1| |yy| $))
    ('T
     (|CLIP;point|
         (+ |x1| (/ (* (- |x2| |x1|) (- |yy| |y1|)) (- |y2| |y1|)))
         |yy| $)))) 

(DEFUN |CLIP;intersectWithVertLine| (|x1| |y1| |x2| |y2| |xx| $)
  (COND
    ((= |y1| |y2|) (|CLIP;point| |xx| |y1| $))
    ('T
     (|CLIP;point| |xx|
         (+ |y1| (/ (* (- |y2| |y1|) (- |xx| |x1|)) (- |x2| |x1|))) $)))) 

(DEFUN |CLIP;intersectWithBdry|
       (|xMin| |xMax| |yMin| |yMax| |pt1| |pt2| $)
  (PROG (|x1| |y1| |x2| |y2|)
    (RETURN
      (SEQ (LETT |x1| (SPADCALL |pt1| (QREFELT $ 35))
                 . #0=(|CLIP;intersectWithBdry|))
           (LETT |y1| (SPADCALL |pt1| (QREFELT $ 36)) . #0#)
           (LETT |x2| (SPADCALL |pt2| (QREFELT $ 35)) . #0#)
           (LETT |y2| (SPADCALL |pt2| (QREFELT $ 36)) . #0#)
           (COND
             ((< |yMax| |y2|)
              (SEQ (LETT |pt2|
                         (|CLIP;intersectWithHorizLine| |x1| |y1| |x2|
                             |y2| |yMax| $) . #0#)
                   (LETT |x2| (SPADCALL |pt2| (QREFELT $ 35)) . #0#)
                   (EXIT (LETT |y2|
                               (SPADCALL |pt2| (QREFELT $ 36)) . #0#)))))
           (COND
             ((< |y2| |yMin|)
              (SEQ (LETT |pt2|
                         (|CLIP;intersectWithHorizLine| |x1| |y1| |x2|
                             |y2| |yMin| $) . #0#)
                   (LETT |x2| (SPADCALL |pt2| (QREFELT $ 35)) . #0#)
                   (EXIT (LETT |y2|
                               (SPADCALL |pt2| (QREFELT $ 36)) . #0#)))))
           (COND
             ((< |xMax| |x2|)
              (SEQ (LETT |pt2|
                         (|CLIP;intersectWithVertLine| |x1| |y1| |x2|
                             |y2| |xMax| $) . #0#)
                   (LETT |x2| (SPADCALL |pt2| (QREFELT $ 35)) . #0#)
                   (EXIT (LETT |y2|
                               (SPADCALL |pt2| (QREFELT $ 36)) . #0#)))))
           (COND
             ((< |x2| |xMin|)
              (LETT |pt2|
                    (|CLIP;intersectWithVertLine| |x1| |y1| |x2| |y2|
                        |xMin| $) . #0#)))
           (EXIT |pt2|))))) 

(DEFUN |CLIP;discardAndSplit|
       (|pointList| |pred| |xMin| |xMax| |yMin| |yMax| $)
  (PROG (|pt| |bdryPt| |ans| |lastPt| |lastPt?| |list|)
    (RETURN
      (SEQ (LETT |ans| NIL . #0=(|CLIP;discardAndSplit|))
           (LETT |list| NIL . #0#) (LETT |lastPt?| 'NIL . #0#)
           (LETT |lastPt| (|CLIP;point| 0.0 0.0 $) . #0#)
           (SEQ G190
                (COND
                  ((NULL (COND ((NULL |pointList|) 'NIL) ('T 'T)))
                   (GO G191)))
                (SEQ (LETT |pt| (|SPADfirst| |pointList|) . #0#)
                     (LETT |pointList| (CDR |pointList|) . #0#)
                     (EXIT (COND
                             ((SPADCALL |pt| |pred|)
                              (SEQ (COND
                                     ((NULL |list|)
                                      (COND
                                        (|lastPt?|
                                         (LETT |bdryPt|
                                          (|CLIP;intersectWithBdry|
                                           |xMin| |xMax| |yMin| |yMax|
                                           |pt| |lastPt| $) . #0#)))))
                                   (EXIT
                                    (LETT |list|
                                     (CONS |pt| |list|) . #0#))))
                             ('T
                              (SEQ (COND
                                     ((NULL (NULL |list|))
                                      (SEQ
                                       (LETT |bdryPt|
                                        (|CLIP;intersectWithBdry|
                                         |xMin| |xMax| |yMin| |yMax|
                                         (|SPADfirst| |list|) |pt| $) . #0#)
                                       (EXIT
                                        (LETT |ans|
                                         (CONS |list| |ans|) . #0#)))))
                                   (LETT |lastPt| |pt| . #0#)
                                   (LETT |lastPt?| 'T . #0#)
                                   (EXIT (LETT |list| NIL . #0#)))))))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT (COND
                   ((NULL |list|) |ans|)
                   ('T (NREVERSE (CONS (NREVERSE |list|) |ans|))))))))) 

(DEFUN |CLIP;clip;P2FR;9| (|plot| |fraction| |scale| $)
  (PROG (|xVals| |pointLists| |pointList| |sortedList| |n| |num| |den|
                 |clipNum| |yDiff| |numm| |denn| |xMin| |xMax| |lists|
                 |list| #0=#:G1899 |pt| #1=#:G1900 |yMin| |yMax|)
    (RETURN
      (SEQ (COND
             ((OR (SPADCALL |fraction| (|spadConstant| $ 13)
                      (QREFELT $ 14))
                  (SPADCALL (SPADCALL 1 2 (QREFELT $ 50)) |fraction|
                      (QREFELT $ 14)))
              (|error| "clipDraw: fraction should be between 0 and 1/2"))
             ('T
              (SEQ (LETT |xVals| (SPADCALL |plot| (QREFELT $ 52))
                         . #2=(|CLIP;clip;P2FR;9|))
                   (EXIT (COND
                           ((NULL (LETT |pointLists|
                                        (SPADCALL |plot|
                                         (QREFELT $ 53)) . #2#))
                            (VECTOR NIL |xVals|
                                    (SPADCALL 0.0 0.0 (QREFELT $ 17))))
                           ((SPADCALL
                                (LETT |pointLists|
                                      (SPADCALL |plot| (QREFELT $ 53)) . #2#)
                                1 (QREFELT $ 54))
                            (|error| "clipDraw: plot has more than one branch"))
                           ((NULL (LETT |pointList|
                                        (|SPADfirst| |pointLists|) . #2#))
                            (VECTOR NIL |xVals|
                                    (SPADCALL 0.0 0.0 (QREFELT $ 17))))
                           ('T
                            (SEQ (LETT |sortedList|
                                       (SPADCALL
                                        (CONS #'|CLIP;clip;P2FR;9!0| $)
                                        |pointList| (QREFELT $ 28)) . #2#)
                                 (LETT |n| (LENGTH |sortedList|) . #2#)
                                 (LETT |num|
                                       (SPADCALL |fraction|
                                        (QREFELT $ 30)) . #2#)
                                 (LETT |den|
                                       (SPADCALL |fraction|
                                        (QREFELT $ 31)) . #2#)
                                 (LETT |clipNum|
                                       (QUOTIENT2
                                        (SPADCALL |n| |num|
                                         (QREFELT $ 33))
                                        |den|) . #2#)
                                 (LETT |yMin|
                                       (SPADCALL
                                        (SPADCALL |sortedList|
                                         |clipNum| (QREFELT $ 55))
                                        (QREFELT $ 36)) . #2#)
                                 (LETT |yMax|
                                       (SPADCALL
                                        (SPADCALL |sortedList|
                                         (- (- |n| 1) |clipNum|)
                                         (QREFELT $ 55))
                                        (QREFELT $ 36)) . #2#)
                                 (COND
                                   ((|CLIP;Fnan?| |yMin| $)
                                    (LETT |yMin| 0.0 . #2#)))
                                 (COND
                                   ((|CLIP;Fnan?| |yMax| $)
                                    (LETT |yMax| 0.0 . #2#)))
                                 (LETT |yDiff| (- |yMax| |yMin|) . #2#)
                                 (EXIT (COND
                                         ((= |yDiff| 0.0)
                                          (VECTOR |pointLists|
                                           (SPADCALL |plot|
                                            (QREFELT $ 52))
                                           (SPADCALL (- |yMin| 1.0)
                                            (+ |yMax| 1.0)
                                            (QREFELT $ 17))))
                                         ('T
                                          (SEQ
                                           (LETT |numm|
                                            (SPADCALL |scale|
                                             (QREFELT $ 30)) . #2#)
                                           (LETT |denn|
                                            (SPADCALL |scale|
                                             (QREFELT $ 31)) . #2#)
                                           (LETT |xMin|
                                            (SPADCALL |xVals|
                                             (QREFELT $ 56)) . #2#)
                                           (LETT |xMax|
                                            (SPADCALL |xVals|
                                             (QREFELT $ 57)) . #2#)
                                           (LETT |yMin|
                                            (- |yMin|
                                             (/
                                              (*
                                               (FLOAT |numm|
                                                MOST-POSITIVE-DOUBLE-FLOAT)
                                               |yDiff|)
                                              (FLOAT |denn|
                                               MOST-POSITIVE-DOUBLE-FLOAT))) . #2#)
                                           (LETT |yMax|
                                            (+ |yMax|
                                             (/
                                              (*
                                               (FLOAT |numm|
                                                MOST-POSITIVE-DOUBLE-FLOAT)
                                               |yDiff|)
                                              (FLOAT |denn|
                                               MOST-POSITIVE-DOUBLE-FLOAT))) . #2#)
                                           (LETT |lists|
                                            (|CLIP;discardAndSplit|
                                             |pointList|
                                             (CONS
                                              #'|CLIP;clip;P2FR;9!1|
                                              (VECTOR |yMin| |yMax| $))
                                             |xMin| |xMax| |yMin|
                                             |yMax| $) . #2#)
                                           (LETT |yMin|
                                            (SPADCALL
                                             (SPADCALL |sortedList|
                                              |clipNum| (QREFELT $ 55))
                                             (QREFELT $ 36)) . #2#)
                                           (LETT |yMax|
                                            (SPADCALL
                                             (SPADCALL |sortedList|
                                              (- (- |n| 1) |clipNum|)
                                              (QREFELT $ 55))
                                             (QREFELT $ 36)) . #2#)
                                           (COND
                                             ((|CLIP;Fnan?| |yMin| $)
                                              (LETT |yMin| 0.0 . #2#)))
                                           (COND
                                             ((|CLIP;Fnan?| |yMax| $)
                                              (LETT |yMax| 0.0 . #2#)))
                                           (SEQ (LETT |list| NIL . #2#)
                                            (LETT #0# |lists| . #2#)
                                            G190
                                            (COND
                                              ((OR (ATOM #0#)
                                                (PROGN
                                                  (LETT |list|
                                                   (CAR #0#) . #2#)
                                                  NIL))
                                               #3=(GO G191)))
                                            (SEQ
                                             (EXIT
                                              (SEQ
                                               (LETT |pt| NIL . #2#)
                                               (LETT #1# |list| . #2#)
                                               G190
                                               (COND
                                                 ((OR (ATOM #1#)
                                                   (PROGN
                                                     (LETT |pt|
                                                      (CAR #1#) . #2#)
                                                     NIL))
                                                  #3#))
                                               (SEQ
                                                (EXIT
                                                 (COND
                                                   ((NULL
                                                     (|CLIP;Fnan?|
                                                      (SPADCALL |pt|
                                                       (QREFELT $ 36))
                                                      $))
                                                    (SEQ
                                                     (LETT |yMin|
                                                      (MIN |yMin|
                                                       (SPADCALL |pt|
                                                        (QREFELT $ 36))) . #2#)
                                                     (EXIT
                                                      (LETT |yMax|
                                                       (MAX |yMax|
                                                        (SPADCALL |pt|
                                                         (QREFELT $ 36))) . #2#)))))))
                                               (LETT #1#
                                                (CDR #1#) . #2#)
                                               #4=(GO G190) G191
                                               (EXIT NIL))))
                                            (LETT #0# (CDR #0#) . #2#)
                                            #4# G191 (EXIT NIL))
                                           (EXIT
                                            (VECTOR |lists| |xVals|
                                             (SPADCALL |yMin| |yMax|
                                              (QREFELT $ 17))))))))))))))))))) 

(DEFUN |CLIP;clip;P2FR;9!1| (|#1| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 2) |CLIP;clip;P2FR;9|)
    (RETURN
      (PROGN
        (COND
          ((SPADCALL (SPADCALL |#1| (QREFELT $ 36)) (QREFELT $$ 1)
               (QREFELT $ 19))
           (SPADCALL (QREFELT $$ 0) (SPADCALL |#1| (QREFELT $ 36))
               (QREFELT $ 19)))
          ('T (|spadConstant| $ 20))))))) 

(DEFUN |CLIP;clip;P2FR;9!0| (|#1| |#2| $)
  (SPADCALL (SPADCALL |#1| (QREFELT $ 36))
      (SPADCALL |#2| (QREFELT $ 36)) (QREFELT $ 19))) 

(DEFUN |CLIP;clip;PR;10| (|plot| $)
  (SPADCALL |plot| (SPADCALL 1 4 (QREFELT $ 50))
      (SPADCALL 5 1 (QREFELT $ 50)) (QREFELT $ 58))) 

(DEFUN |CLIP;norm| (|pt| $)
  (PROG (|x| |y| |r|)
    (RETURN
      (SEQ (LETT |x| (SPADCALL |pt| (QREFELT $ 35)) . #0=(|CLIP;norm|))
           (LETT |y| (SPADCALL |pt| (QREFELT $ 36)) . #0#)
           (COND
             ((|CLIP;Fnan?| |x| $)
              (COND
                ((|CLIP;Fnan?| |y| $) (LETT |r| 0.0 . #0#))
                ('T (LETT |r| (SPADCALL |y| 2 (QREFELT $ 61)) . #0#))))
             ((|CLIP;Fnan?| |y| $)
              (LETT |r| (SPADCALL |x| 2 (QREFELT $ 61)) . #0#))
             ('T
              (LETT |r|
                    (+ (SPADCALL |x| 2 (QREFELT $ 61))
                       (SPADCALL |y| 2 (QREFELT $ 61))) . #0#)))
           (EXIT |r|))))) 

(DEFUN |CLIP;findPt| (|lists| $)
  (PROG (|list| #0=#:G1917 |p| #1=#:G1918 #2=#:G1916 #3=#:G1912
                #4=#:G1914)
    (RETURN
      (SEQ (EXIT (SEQ (SEQ (EXIT (SEQ (LETT |list| NIL
                                       . #5=(|CLIP;findPt|))
                                      (LETT #0# |lists| . #5#) G190
                                      (COND
                                        ((OR (ATOM #0#)
                                          (PROGN
                                            (LETT |list|
                                             (CAR #0#) . #5#)
                                            NIL))
                                         #6=(GO G191)))
                                      (SEQ
                                       (EXIT
                                        (COND
                                          ((NULL (NULL |list|))
                                           (PROGN
                                             (LETT #4#
                                              (SEQ
                                               (EXIT
                                                (SEQ
                                                 (LETT |p| NIL . #5#)
                                                 (LETT #1#
                                                  |list| . #5#)
                                                 G190
                                                 (COND
                                                   ((OR (ATOM #1#)
                                                     (PROGN
                                                       (LETT |p|
                                                        (CAR #1#) . #5#)
                                                       NIL))
                                                    #6#))
                                                 (SEQ
                                                  (EXIT
                                                   (COND
                                                     ((NULL
                                                       (|CLIP;Pnan?|
                                                        |p| $))
                                                      (PROGN
                                                        (LETT #3#
                                                         (PROGN
                                                           (LETT #2#
                                                            (CONS 0
                                                             |p|) . #5#)
                                                           (GO #2#)) . #5#)
                                                        (GO #3#))))))
                                                 (LETT #1#
                                                  (CDR #1#) . #5#)
                                                 #7=(GO G190) G191
                                                 (EXIT NIL)))
                                               #3# (EXIT #3#)) . #5#)
                                             (GO #4#))))))
                                      (LETT #0# (CDR #0#) . #5#) #7#
                                      G191 (EXIT NIL)))
                           #4# (EXIT #4#))
                      (EXIT (CONS 1 "failed"))))
           #2# (EXIT #2#))))) 

(DEFUN |CLIP;clipWithRanges;L4DfR;13|
       (|pointLists| |xMin| |xMax| |yMin| |yMax| $)
  (PROG (|pointList| #0=#:G1943 |lists| |firstPt| |list| #1=#:G1944
            |pt| #2=#:G1945)
    (RETURN
      (SEQ (LETT |lists| NIL . #3=(|CLIP;clipWithRanges;L4DfR;13|))
           (SEQ (LETT |pointList| NIL . #3#)
                (LETT #0# |pointLists| . #3#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |pointList| (CAR #0#) . #3#) NIL))
                   #4=(GO G191)))
                (SEQ (EXIT (LETT |lists|
                                 (SPADCALL |lists|
                                     (|CLIP;discardAndSplit|
                                      |pointList|
                                      (CONS
                                       #'|CLIP;clipWithRanges;L4DfR;13!0|
                                       (VECTOR |yMin| |yMax| |xMin| $
                                        |xMax|))
                                      |xMin| |xMax| |yMin| |yMax| $)
                                     (QREFELT $ 62)) . #3#)))
                (LETT #0# (CDR #0#) . #3#) #5=(GO G190) G191
                (EXIT NIL))
           (LETT |pt| (|CLIP;findPt| |lists| $) . #3#)
           (EXIT (COND
                   ((QEQCAR |pt| 1)
                    (VECTOR NIL (SPADCALL 0.0 0.0 (QREFELT $ 17))
                            (SPADCALL 0.0 0.0 (QREFELT $ 17))))
                   ('T
                    (SEQ (LETT |firstPt| (QCDR |pt|) . #3#)
                         (LETT |xMin|
                               (SPADCALL |firstPt| (QREFELT $ 35)) . #3#)
                         (LETT |xMax|
                               (SPADCALL |firstPt| (QREFELT $ 35)) . #3#)
                         (LETT |yMin|
                               (SPADCALL |firstPt| (QREFELT $ 36)) . #3#)
                         (LETT |yMax|
                               (SPADCALL |firstPt| (QREFELT $ 36)) . #3#)
                         (SEQ (LETT |list| NIL . #3#)
                              (LETT #1# |lists| . #3#) G190
                              (COND
                                ((OR (ATOM #1#)
                                     (PROGN
                                       (LETT |list| (CAR #1#) . #3#)
                                       NIL))
                                 #4#))
                              (SEQ (EXIT
                                    (SEQ (LETT |pt| NIL . #3#)
                                     (LETT #2# |list| . #3#) G190
                                     (COND
                                       ((OR (ATOM #2#)
                                         (PROGN
                                           (LETT |pt| (CAR #2#) . #3#)
                                           NIL))
                                        #4#))
                                     (SEQ
                                      (EXIT
                                       (COND
                                         ((NULL (|CLIP;Pnan?| |pt| $))
                                          (SEQ
                                           (LETT |xMin|
                                            (MIN |xMin|
                                             (SPADCALL |pt|
                                              (QREFELT $ 35))) . #3#)
                                           (LETT |xMax|
                                            (MAX |xMax|
                                             (SPADCALL |pt|
                                              (QREFELT $ 35))) . #3#)
                                           (LETT |yMin|
                                            (MIN |yMin|
                                             (SPADCALL |pt|
                                              (QREFELT $ 36))) . #3#)
                                           (EXIT
                                            (LETT |yMax|
                                             (MAX |yMax|
                                              (SPADCALL |pt|
                                               (QREFELT $ 36))) . #3#)))))))
                                     (LETT #2# (CDR #2#) . #3#) #5#
                                     G191 (EXIT NIL))))
                              (LETT #1# (CDR #1#) . #3#) #5# G191
                              (EXIT NIL))
                         (EXIT (VECTOR |lists|
                                       (SPADCALL |xMin| |xMax|
                                        (QREFELT $ 17))
                                       (SPADCALL |yMin| |yMax|
                                        (QREFELT $ 17)))))))))))) 

(DEFUN |CLIP;clipWithRanges;L4DfR;13!0| (|#1| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 3) |CLIP;clipWithRanges;L4DfR;13|)
    (RETURN
      (PROGN
        (COND
          ((OR (SPADCALL (QREFELT $$ 4) (SPADCALL |#1| (QREFELT $ 35))
                   (QREFELT $ 19))
               (OR (SPADCALL (SPADCALL |#1| (QREFELT $ 35))
                       (QREFELT $$ 2) (QREFELT $ 19))
                   (OR (SPADCALL (QREFELT $$ 1)
                           (SPADCALL |#1| (QREFELT $ 36))
                           (QREFELT $ 19))
                       (SPADCALL (SPADCALL |#1| (QREFELT $ 36))
                           (QREFELT $$ 0) (QREFELT $ 19)))))
           (|spadConstant| $ 20))
          ('T (|spadConstant| $ 21))))))) 

(DEFUN |CLIP;clipParametric;P2FR;14| (|plot| |fraction| |scale| $)
  (|CLIP;iClipParametric| (SPADCALL |plot| (QREFELT $ 53)) |fraction|
      |scale| $)) 

(DEFUN |CLIP;clipParametric;PR;15| (|plot| $)
  (SPADCALL |plot| (SPADCALL 1 2 (QREFELT $ 50))
      (SPADCALL 5 1 (QREFELT $ 50)) (QREFELT $ 63))) 

(DEFUN |CLIP;clip;LR;16| (|l| $)
  (|CLIP;iClipParametric| (SPADCALL |l| (QREFELT $ 65))
      (SPADCALL 1 2 (QREFELT $ 50)) (SPADCALL 5 1 (QREFELT $ 50)) $)) 

(DEFUN |CLIP;clip;LR;17| (|l| $)
  (|CLIP;iClipParametric| |l| (SPADCALL 1 2 (QREFELT $ 50))
      (SPADCALL 5 1 (QREFELT $ 50)) $)) 

(DEFUN |TwoDimensionalPlotClipping| ()
  (PROG ()
    (RETURN
      (PROG (#0=#:G1955)
        (RETURN
          (COND
            ((LETT #0#
                   (HGET |$ConstructorCache|
                         '|TwoDimensionalPlotClipping|)
                   . #1=(|TwoDimensionalPlotClipping|))
             (|CDRwithIncrement| (CDAR #0#)))
            ('T
             (UNWIND-PROTECT
               (PROG1 (CDDAR (HPUT |$ConstructorCache|
                                   '|TwoDimensionalPlotClipping|
                                   (LIST
                                    (CONS NIL
                                     (CONS 1
                                      (|TwoDimensionalPlotClipping;|))))))
                 (LETT #0# T . #1#))
               (COND
                 ((NOT #0#)
                  (HREM |$ConstructorCache|
                        '|TwoDimensionalPlotClipping|))))))))))) 

(DEFUN |TwoDimensionalPlotClipping;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT |dv$| '(|TwoDimensionalPlotClipping|)
              . #0=(|TwoDimensionalPlotClipping|))
        (LETT $ (GETREFV 68) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|TwoDimensionalPlotClipping|
            NIL (CONS 1 $))
        (|stuffDomainSlots| $)
        $)))) 

(MAKEPROP '|TwoDimensionalPlotClipping| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|Boolean|) (|DoubleFloat|)
             (0 . ~=) (|Mapping| 6 7) (|Point| 7) (6 . |any?|)
             (|Fraction| 29) (12 . |Zero|) (16 . <) (22 . |One|)
             (|Segment| 7) (26 . |segment|) (32 . |norm|) (37 . <)
             (43 . |false|) (47 . |true|) (|List| $) (|List| 10)
             (51 . |concat|) (|Mapping| 6 10) (56 . |select|)
             (|Mapping| 6 10 10) (62 . |sort|) (|Integer|)
             (68 . |numer|) (73 . |denom|) (|NonNegativeInteger|)
             (78 . *) (|PointPackage| 7) (84 . |xCoord|)
             (89 . |yCoord|)
             (|Record| (|:| |brans| 38) (|:| |xValues| 16)
                 (|:| |yValues| 16))
             (|List| 23) |CLIP;clipWithRanges;L4DfR;13| (|List| 7)
             (|Mapping| 7 10) (|ListFunctions2| 10 7) (94 . |map|)
             (100 . |min|) (|Mapping| 7 7 7) (106 . |reduce|)
             (112 . |max|) (118 . SEGMENT) (124 . |point|) (129 . /)
             (|Plot|) (135 . |xRange|) (140 . |listBranches|)
             (145 . |more?|) (151 . |elt|) (157 . |lo|) (162 . |hi|)
             |CLIP;clip;P2FR;9| |CLIP;clip;PR;10| (|PositiveInteger|)
             (167 . **) (173 . |concat|) |CLIP;clipParametric;P2FR;14|
             |CLIP;clipParametric;PR;15| (179 . |list|)
             |CLIP;clip;LR;16| |CLIP;clip;LR;17|)
          '#(|clipWithRanges| 184 |clipParametric| 193 |clip| 205) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 67
                                '(2 7 6 0 0 8 2 10 6 9 0 11 0 12 0 13 2
                                  12 6 0 0 14 0 12 0 15 2 16 0 7 7 17 1
                                  7 0 0 18 2 7 6 0 0 19 0 6 0 20 0 6 0
                                  21 1 23 0 22 24 2 23 0 25 0 26 2 23 0
                                  27 0 28 1 12 29 0 30 1 12 29 0 31 2
                                  29 0 32 0 33 1 34 7 10 35 1 34 7 10
                                  36 2 42 40 41 23 43 2 7 0 0 0 44 2 40
                                  7 45 0 46 2 7 0 0 0 47 2 16 0 7 7 48
                                  1 10 0 40 49 2 12 0 29 29 50 1 51 16
                                  0 52 1 51 38 0 53 2 38 6 0 32 54 2 23
                                  10 0 29 55 1 16 7 0 56 1 16 7 0 57 2
                                  7 0 0 60 61 2 38 0 0 0 62 1 38 0 23
                                  65 5 0 37 38 7 7 7 7 39 1 0 37 51 64
                                  3 0 37 51 12 12 63 1 0 37 51 59 3 0
                                  37 51 12 12 58 1 0 37 38 67 1 0 37 23
                                  66)))))
          '|lookupComplete|)) 

(MAKEPROP '|TwoDimensionalPlotClipping| 'NILADIC T) 
