
(/VERSIONCHECK 2) 

(DEFUN |SORTPAK;bubbleSort!;AMA;1| (|m| |f| $)
  (PROG (|n| |i| #0=#:G1826 |j| #1=#:G1827)
    (RETURN
      (SEQ (LETT |n| (SPADCALL |m| (QREFELT $ 9))
                 . #2=(|SORTPAK;bubbleSort!;AMA;1|))
           (SEQ (LETT |i| 1 . #2#) (LETT #0# (- |n| 1) . #2#) G190
                (COND ((QSGREATERP |i| #0#) #3=(GO G191)))
                (SEQ (EXIT (SEQ (LETT |j| |n| . #2#)
                                (LETT #1# (+ |i| 1) . #2#) G190
                                (COND ((< |j| #1#) #3#))
                                (SEQ (EXIT
                                      (COND
                                        ((SPADCALL
                                          (SPADCALL |m| |j|
                                           (QREFELT $ 11))
                                          (SPADCALL |m| (- |j| 1)
                                           (QREFELT $ 11))
                                          |f|)
                                         (SPADCALL |m| |j| (- |j| 1)
                                          (QREFELT $ 13))))))
                                (LETT |j| (+ |j| -1) . #2#)
                                #4=(GO G190) G191 (EXIT NIL))))
                (LETT |i| (QSADD1 |i|) . #2#) #4# G191 (EXIT NIL))
           (EXIT |m|))))) 

(DEFUN |SORTPAK;insertionSort!;AMA;2| (|m| |f| $)
  (PROG (|i| #0=#:G1834 |j|)
    (RETURN
      (SEQ (SEQ (LETT |i| 2 . #1=(|SORTPAK;insertionSort!;AMA;2|))
                (LETT #0# (SPADCALL |m| (QREFELT $ 9)) . #1#) G190
                (COND ((QSGREATERP |i| #0#) #2=(GO G191)))
                (SEQ (LETT |j| |i| . #1#)
                     (EXIT (SEQ G190
                                (COND
                                  ((NULL
                                    (COND
                                      ((< 1 |j|)
                                       (SPADCALL
                                        (SPADCALL |m| |j|
                                         (QREFELT $ 11))
                                        (SPADCALL |m| (- |j| 1)
                                         (QREFELT $ 11))
                                        |f|))
                                      ('T 'NIL)))
                                   #2#))
                                (SEQ (SPADCALL |m| |j| (- |j| 1)
                                      (QREFELT $ 13))
                                     (EXIT (LETT |j| (- |j| 1) . #1#)))
                                NIL #3=(GO G190) G191 (EXIT NIL))))
                (LETT |i| (QSADD1 |i|) . #1#) #3# G191 (EXIT NIL))
           (EXIT |m|))))) 

(DEFUN |SORTPAK;bubbleSort!;2A;3| (|m| $)
  (SPADCALL |m| (ELT $ 18) (QREFELT $ 15))) 

(DEFUN |SORTPAK;insertionSort!;2A;4| (|m| $)
  (SPADCALL |m| (ELT $ 18) (QREFELT $ 16))) 

(DEFUN |SORTPAK;bubbleSort!;AMA;5| (|m| |fn| $)
  (PROG (|r| |x| |l|)
    (RETURN
      (SEQ (COND
             ((SPADCALL |m| (QREFELT $ 21)) |m|)
             ('T
              (SEQ (LETT |l| |m| . #0=(|SORTPAK;bubbleSort!;AMA;5|))
                   (SEQ G190
                        (COND
                          ((NULL (COND
                                   ((SPADCALL
                                     (LETT |r|
                                      (SPADCALL |l| '|rest|
                                       (QREFELT $ 23)) . #0#)
                                     (QREFELT $ 21))
                                    'NIL)
                                   ('T 'T)))
                           (GO G191)))
                        (SEQ (LETT |r|
                                   (SPADCALL |r| |fn| (QREFELT $ 15)) . #0#)
                             (LETT |x|
                                   (SPADCALL |l| '|first|
                                    (QREFELT $ 25)) . #0#)
                             (COND
                               ((SPADCALL
                                    (SPADCALL |r| '|first|
                                     (QREFELT $ 25))
                                    |x| |fn|)
                                (SEQ (SPADCALL |l| '|first|
                                      (SPADCALL |r| '|first|
                                       (QREFELT $ 25))
                                      (QREFELT $ 26))
                                     (EXIT
                                      (SPADCALL |r| '|first| |x|
                                       (QREFELT $ 26))))))
                             (SPADCALL |l| '|rest| |r| (QREFELT $ 27))
                             (EXIT (LETT |l|
                                    (SPADCALL |l| '|rest|
                                     (QREFELT $ 23)) . #0#)))
                        NIL (GO G190) G191 (EXIT NIL))
                   (EXIT |m|)))))))) 

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

(DEFUN |SortPackage;| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|SortPackage|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT |dv$| (LIST '|SortPackage| DV$1 DV$2) . #0#)
        (LETT $ (GETREFV 28) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (|HasCategory| |#1| '(|OrderedSet|)))) . #0#))
        (|haddProp| |$ConstructorCache| '|SortPackage| (LIST DV$1 DV$2)
            (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (COND
          ((|testBitVector| |pv$| 1)
           (PROGN
             (QSETREFV $ 19
                 (CONS (|dispatchFunction| |SORTPAK;bubbleSort!;2A;3|)
                       $))
             (QSETREFV $ 20
                 (CONS (|dispatchFunction|
                           |SORTPAK;insertionSort!;2A;4|)
                       $)))))
        (COND
          ((|HasCategory| |#2|
               (LIST '|UnaryRecursiveAggregate| (|devaluate| |#1|)))
           (QSETREFV $ 15
               (CONS (|dispatchFunction| |SORTPAK;bubbleSort!;AMA;5|)
                     $))))
        $)))) 

(MAKEPROP '|SortPackage| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|NonNegativeInteger|) (0 . |#|) (|Integer|) (5 . |elt|)
             (|Void|) (11 . |swap!|) (|Mapping| 17 6 6)
             |SORTPAK;bubbleSort!;AMA;1| |SORTPAK;insertionSort!;AMA;2|
             (|Boolean|) (18 . <) (24 . |bubbleSort!|)
             (29 . |insertionSort!|) (34 . |empty?|) '"rest"
             (39 . |elt|) '"first" (45 . |elt|) (51 . |setelt|)
             (58 . |setelt|))
          '#(|insertionSort!| 65 |bubbleSort!| 76) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 27
                                '(1 7 8 0 9 2 7 6 0 10 11 3 7 12 0 10
                                  10 13 2 6 17 0 0 18 1 0 7 7 19 1 0 7
                                  7 20 1 7 17 0 21 2 7 0 0 22 23 2 7 6
                                  0 24 25 3 7 6 0 24 6 26 3 7 0 0 22 0
                                  27 1 1 7 7 20 2 0 7 7 14 16 1 1 7 7
                                  19 2 0 7 7 14 15)))))
          '|lookupComplete|)) 
