
(/VERSIONCHECK 2) 

(DEFUN |UDPO;userOrdered?;B;1| ($)
  (COND
    ((NULL (SPADCALL (QREFELT $ 10) (QREFELT $ 12)))
     (COND
       ((NULL (SPADCALL (QREFELT $ 11) (QREFELT $ 12))) 'NIL)
       ('T 'T)))
    ('T 'T))) 

(DEFUN |UDPO;getOrder;R;2| ($)
  (CONS (SPADCALL (QREFELT $ 10) (QREFELT $ 12))
        (SPADCALL (QREFELT $ 11) (QREFELT $ 12)))) 

(DEFUN |UDPO;setOrder;LV;3| (|l| $) (SPADCALL NIL |l| (QREFELT $ 18))) 

(DEFUN |UDPO;setOrder;2LV;4| (|l| |h| $)
  (SEQ (SPADCALL (QREFELT $ 10) (SPADCALL |l| (QREFELT $ 20))
           (QREFELT $ 21))
       (SPADCALL (QREFELT $ 11) (SPADCALL |h| (QREFELT $ 20))
           (QREFELT $ 21))
       (EXIT (SPADCALL (QREFELT $ 22))))) 

(DEFUN |UDPO;less?;2SMB;5| (|a| |b| |f| $)
  (PROG (|u|)
    (RETURN
      (SEQ (LETT |u| (SPADCALL |a| |b| (QREFELT $ 24))
                 |UDPO;less?;2SMB;5|)
           (EXIT (COND
                   ((QEQCAR |u| 1) (SPADCALL |a| |b| |f|))
                   ('T (QCDR |u|)))))))) 

(DEFUN |UDPO;largest;LMS;6| (|x| |f| $)
  (PROG (|a|)
    (RETURN
      (SEQ (COND
             ((NULL |x|) (|error| "largest: empty list"))
             ((NULL (CDR |x|)) (|SPADfirst| |x|))
             ('T
              (SEQ (LETT |a| (SPADCALL (CDR |x|) |f| (QREFELT $ 27))
                         |UDPO;largest;LMS;6|)
                   (EXIT (COND
                           ((SPADCALL (|SPADfirst| |x|) |a| |f|
                                (QREFELT $ 26))
                            |a|)
                           ('T (|SPADfirst| |x|))))))))))) 

(DEFUN |UDPO;less?;2SU;7| (|a| |b| $)
  (PROG (#0=#:G1851 |x| #1=#:G1852 |aa| #2=#:G1850 |bb|)
    (RETURN
      (SEQ (EXIT (SEQ (SEQ (LETT |x| NIL . #3=(|UDPO;less?;2SU;7|))
                           (LETT #0#
                                 (SPADCALL (QREFELT $ 10)
                                     (QREFELT $ 12)) . #3#)
                           G190
                           (COND
                             ((OR (ATOM #0#)
                                  (PROGN
                                    (LETT |x| (CAR #0#) . #3#)
                                    NIL))
                              #4=(GO G191)))
                           (SEQ (EXIT (COND
                                        ((SPADCALL |x| |a|
                                          (QREFELT $ 28))
                                         (PROGN
                                           (LETT #2#
                                            (COND
                                              ((SPADCALL |a| |b|
                                                (QREFELT $ 28))
                                               (CONS 0 'NIL))
                                              ('T (CONS 0 'T))) . #3#)
                                           (GO #2#)))
                                        ((SPADCALL |x| |b|
                                          (QREFELT $ 28))
                                         (PROGN
                                           (LETT #2#
                                            (CONS 0 'NIL) . #3#)
                                           (GO #2#))))))
                           (LETT #0# (CDR #0#) . #3#) #5=(GO G190) G191
                           (EXIT NIL))
                      (LETT |aa| (LETT |bb| 'NIL . #3#) . #3#)
                      (SEQ (LETT |x| NIL . #3#)
                           (LETT #1#
                                 (SPADCALL (QREFELT $ 11)
                                     (QREFELT $ 12)) . #3#)
                           G190
                           (COND
                             ((OR (ATOM #1#)
                                  (PROGN
                                    (LETT |x| (CAR #1#) . #3#)
                                    NIL))
                              #4#))
                           (SEQ (COND
                                  ((SPADCALL |x| |a| (QREFELT $ 28))
                                   (COND
                                     (|bb|
                                      (PROGN
                                        (LETT #2# (CONS 0 'NIL) . #3#)
                                        (GO #2#)))
                                     ('T (LETT |aa| 'T . #3#)))))
                                (EXIT (COND
                                        ((SPADCALL |x| |b|
                                          (QREFELT $ 28))
                                         (COND
                                           (|aa|
                                            (PROGN
                                              (LETT #2#
                                               (COND
                                                 ((SPADCALL |a| |b|
                                                   (QREFELT $ 28))
                                                  (CONS 0 'NIL))
                                                 ('T (CONS 0 'T))) . #3#)
                                              (GO #2#)))
                                           ('T (LETT |bb| 'T . #3#)))))))
                           (LETT #1# (CDR #1#) . #3#) #5# G191
                           (EXIT NIL))
                      (EXIT (COND
                              (|aa| (CONS 0 'NIL))
                              (|bb| (CONS 0 'T))
                              ('T (CONS 1 "failed"))))))
           #2# (EXIT #2#))))) 

(DEFUN |UDPO;more?;2SB;8| (|a| |b| $)
  (COND
    ((SPADCALL |a| |b| (CONS #'|UDPO;more?;2SB;8!0| $) (QREFELT $ 26))
     'NIL)
    ('T 'T))) 

(DEFUN |UDPO;more?;2SB;8!0| (|#1| |#2| $)
  (SPADCALL |#1| |#2| (QREFELT $ 29))) 

(DEFUN |UDPO;largest;LS;9| (|x| $)
  (SPADCALL |x| (CONS #'|UDPO;largest;LS;9!0| $) (QREFELT $ 27))) 

(DEFUN |UDPO;largest;LS;9!0| (|#1| |#2| $)
  (SPADCALL |#1| |#2| (QREFELT $ 29))) 

(DEFUN |UserDefinedPartialOrdering| (#0=#:G1856)
  (PROG ()
    (RETURN
      (PROG (#1=#:G1857)
        (RETURN
          (COND
            ((LETT #1#
                   (|lassocShiftWithFunction| (LIST (|devaluate| #0#))
                       (HGET |$ConstructorCache|
                             '|UserDefinedPartialOrdering|)
                       '|domainEqualList|)
                   . #2=(|UserDefinedPartialOrdering|))
             (|CDRwithIncrement| #1#))
            ('T
             (UNWIND-PROTECT
               (PROG1 (|UserDefinedPartialOrdering;| #0#)
                 (LETT #1# T . #2#))
               (COND
                 ((NOT #1#)
                  (HREM |$ConstructorCache|
                        '|UserDefinedPartialOrdering|))))))))))) 

(DEFUN |UserDefinedPartialOrdering;| (|#1|)
  (PROG (DV$1 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|)
              . #0=(|UserDefinedPartialOrdering|))
        (LETT |dv$| (LIST '|UserDefinedPartialOrdering| DV$1) . #0#)
        (LETT $ (GETREFV 32) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (|HasCategory| |#1| '(|OrderedSet|)))) . #0#))
        (|haddProp| |$ConstructorCache| '|UserDefinedPartialOrdering|
            (LIST DV$1) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 10 (SPADCALL NIL (QREFELT $ 9)))
        (QSETREFV $ 11 (SPADCALL NIL (QREFELT $ 9)))
        (COND
          ((|testBitVector| |pv$| 1)
           (PROGN
             (QSETREFV $ 30
                 (CONS (|dispatchFunction| |UDPO;more?;2SB;8|) $))
             (QSETREFV $ 31
                 (CONS (|dispatchFunction| |UDPO;largest;LS;9|) $)))))
        $)))) 

(MAKEPROP '|UserDefinedPartialOrdering| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|List| 6)
             (|Reference| 7) (0 . |ref|) '|llow| '|lhigh| (5 . |deref|)
             (|Boolean|) |UDPO;userOrdered?;B;1|
             (|Record| (|:| |low| 7) (|:| |high| 7))
             |UDPO;getOrder;R;2| (|Void|) |UDPO;setOrder;2LV;4|
             |UDPO;setOrder;LV;3| (10 . |removeDuplicates|)
             (15 . |setref|) (21 . |void|) (|Union| 13 '"failed")
             |UDPO;less?;2SU;7| (|Mapping| 13 6 6) |UDPO;less?;2SMB;5|
             |UDPO;largest;LMS;6| (25 . =) (31 . <) (37 . |more?|)
             (43 . |largest|))
          '#(|userOrdered?| 48 |setOrder| 52 |more?| 63 |less?| 69
             |largest| 82 |getOrder| 93)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 31
                                '(1 8 0 7 9 1 8 7 0 12 1 7 0 0 20 2 8 7
                                  0 7 21 0 17 0 22 2 6 13 0 0 28 2 6 13
                                  0 0 29 2 0 13 6 6 30 1 0 6 7 31 0 0
                                  13 14 2 0 17 7 7 18 1 0 17 7 19 2 1
                                  13 6 6 30 2 0 23 6 6 24 3 0 13 6 6 25
                                  26 1 1 6 7 31 2 0 6 7 25 27 0 0 15
                                  16)))))
          '|lookupComplete|)) 
