
(/VERSIONCHECK 2) 

(DEFUN |BRILL;squaredPolynomial| (|p| $)
  (PROG (|d|)
    (RETURN
      (SEQ (LETT |d| (SPADCALL |p| (QREFELT $ 8))
                 |BRILL;squaredPolynomial|)
           (EXIT (COND
                   ((EQL |d| 0) 'T)
                   ((ODDP |d|) 'NIL)
                   ('T
                    (|BRILL;squaredPolynomial|
                        (SPADCALL |p| (QREFELT $ 10)) $)))))))) 

(DEFUN |BRILL;primeEnough?| (|n| |b| $)
  (PROG (|i| |d| #0=#:G1834 |bb| #1=#:G1840)
    (RETURN
      (SEQ (EXIT (SEQ (LETT |bb| (SPADCALL |b| (QREFELT $ 13))
                            . #2=(|BRILL;primeEnough?|))
                      (SEQ (LETT |i| 2 . #2#) G190
                           (COND ((QSGREATERP |i| |b|) #3=(GO G191)))
                           (SEQ (EXIT (SEQ G190
                                       (COND
                                         ((NULL
                                           (QEQCAR
                                            (LETT |d|
                                             (SPADCALL |n| |i|
                                              (QREFELT $ 15)) . #2#)
                                            0))
                                          #3#))
                                       (SEQ
                                        (LETT |n|
                                         (PROG2 (LETT #0# |d| . #2#)
                                          (QCDR #0#)
                                           (|check-union|
                                            (QEQCAR #0# 0) (|Integer|)
                                            #0#)) . #2#)
                                        (LETT |bb|
                                         (SPADCALL |bb|
                                          (SPADCALL |i| (QREFELT $ 13))
                                          (QREFELT $ 16)) . #2#)
                                        (EXIT
                                         (COND
                                           ((SPADCALL |bb|
                                             (|spadConstant| $ 17)
                                             (QREFELT $ 19))
                                            (PROGN
                                              (LETT #1# 'NIL . #2#)
                                              (GO #1#))))))
                                       NIL #4=(GO G190) G191
                                       (EXIT NIL))))
                           (LETT |i| (QSADD1 |i|) . #2#) #4# G191
                           (EXIT NIL))
                      (EXIT (SPADCALL |n| (QREFELT $ 20)))))
           #1# (EXIT #1#))))) 

(DEFUN |BRILL;brillhartTrials;Nni;3| ($) (QREFELT $ 21)) 

(DEFUN |BRILL;brillhartTrials;2Nni;4| (|n| $)
  (PROG (|#G8| |#G9|)
    (RETURN
      (SEQ (PROGN
             (LETT |#G8| |n| . #0=(|BRILL;brillhartTrials;2Nni;4|))
             (LETT |#G9| (QREFELT $ 21) . #0#)
             (SETELT $ 21 |#G8|)
             (LETT |n| |#G9| . #0#))
           (EXIT |n|))))) 

(DEFUN |BRILL;brillhartIrreducible?;UPB;5| (|p| $)
  (SPADCALL |p| (SPADCALL |p| (QREFELT $ 24)) (QREFELT $ 25))) 

(DEFUN |BRILL;brillhartIrreducible?;UP2B;6| (|p| |noLinears| $)
  (PROG (|origBound| |even0| |even1| |polyx2| |largeEnough| |count| |i|
            |small| #0=#:G1856 #1=#:G1848)
    (RETURN
      (SEQ (EXIT (COND
                   ((ZEROP (QREFELT $ 21)) 'NIL)
                   ('T
                    (SEQ (LETT |origBound|
                               (LETT |largeEnough|
                                     (+ (SPADCALL |p| (QREFELT $ 28))
                                      1)
                                     . #2=(|BRILL;brillhartIrreducible?;UP2B;6|)) . #2#)
                         (LETT |even0|
                               (SPADCALL
                                   (SPADCALL |p| 0 (QREFELT $ 29))
                                   (QREFELT $ 30)) . #2#)
                         (LETT |even1|
                               (SPADCALL
                                   (SPADCALL |p| 1 (QREFELT $ 32))
                                   (QREFELT $ 30)) . #2#)
                         (LETT |polyx2|
                               (|BRILL;squaredPolynomial| |p| $) . #2#)
                         (EXIT (COND
                                 ((SPADCALL
                                      (SPADCALL |p| |largeEnough|
                                       (QREFELT $ 32))
                                      (QREFELT $ 20))
                                  'T)
                                 ('T
                                  (SEQ (COND
                                         ((NULL |polyx2|)
                                          (COND
                                            ((SPADCALL
                                              (SPADCALL |p|
                                               (- |largeEnough|)
                                               (QREFELT $ 32))
                                              (QREFELT $ 20))
                                             (EXIT 'T)))))
                                       (EXIT
                                        (COND
                                          ((EQL (QREFELT $ 21) 1) 'NIL)
                                          ('T
                                           (SEQ
                                            (LETT |largeEnough|
                                             (+ |largeEnough| 1) . #2#)
                                            (EXIT
                                             (COND
                                               ((|BRILL;primeEnough?|
                                                 (SPADCALL |p|
                                                  |largeEnough|
                                                  (QREFELT $ 32))
                                                 (COND
                                                   (|noLinears| 4)
                                                   ('T 2))
                                                 $)
                                                'T)
                                               ('T
                                                (SEQ
                                                 (COND
                                                   ((NULL |polyx2|)
                                                    (COND
                                                      ((|BRILL;primeEnough?|
                                                        (SPADCALL |p|
                                                         (-
                                                          |largeEnough|)
                                                         (QREFELT $ 32))
                                                        (COND
                                                          (|noLinears|
                                                           4)
                                                          ('T 2))
                                                        $)
                                                       (EXIT 'T)))))
                                                 (COND
                                                   ((ODDP
                                                     |largeEnough|)
                                                    (COND
                                                      ((OR |even0|
                                                        |even1|)
                                                       (LETT
                                                        |largeEnough|
                                                        (+
                                                         |largeEnough|
                                                         1) . #2#)))))
                                                 (LETT |count|
                                                  (+
                                                   (*
                                                    (COND
                                                      (|polyx2| 2)
                                                      ('T 1))
                                                    (- (QREFELT $ 21)
                                                     2))
                                                   |largeEnough|) . #2#)
                                                 (SEQ
                                                  (LETT |i|
                                                   (+ |largeEnough| 1) . #2#)
                                                  G190
                                                  (COND
                                                    ((> |i| |count|)
                                                     (GO G191)))
                                                  (SEQ
                                                   (LETT |small|
                                                    (COND
                                                      (|noLinears|
                                                       (EXPT
                                                        (- |i|
                                                         |origBound|)
                                                        2))
                                                      ('T
                                                       (- |i|
                                                        |origBound|))) . #2#)
                                                   (EXIT
                                                    (COND
                                                      ((|BRILL;primeEnough?|
                                                        (SPADCALL |p|
                                                         |i|
                                                         (QREFELT $ 32))
                                                        |small| $)
                                                       (PROGN
                                                         (LETT #0#
                                                          'T . #2#)
                                                         (GO #0#)))
                                                      ((NULL |polyx2|)
                                                       (SEQ
                                                        (EXIT
                                                         (COND
                                                           ((|BRILL;primeEnough?|
                                                             (SPADCALL
                                                              |p|
                                                              (- |i|)
                                                              (QREFELT
                                                               $ 32))
                                                             |small| $)
                                                            (PROGN
                                                              (LETT #1#
                                                               (PROGN
                                                                 (LETT
                                                                  #0#
                                                                  'T . #2#)
                                                                 (GO
                                                                  #0#)) . #2#)
                                                              (GO #1#)))))
                                                        #1# (EXIT #1#))))))
                                                  (LETT |i|
                                                   (+ |i| 1) . #2#)
                                                  (GO G190) G191
                                                  (EXIT NIL))
                                                 (EXIT 'NIL)))))))))))))))))
           #0# (EXIT #0#))))) 

(DEFUN |BRILL;noLinearFactor?;UPB;7| (|p| $)
  (COND
    ((ODDP (SPADCALL |p| (QREFELT $ 33)))
     (COND
       ((ODDP (SPADCALL |p| 0 (QREFELT $ 29)))
        (ODDP (SPADCALL |p| 1 (QREFELT $ 32))))
       ('T 'NIL)))
    ('T 'NIL))) 

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

(DEFUN |BrillhartTests;| (|#1|)
  (PROG (DV$1 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|BrillhartTests|))
        (LETT |dv$| (LIST '|BrillhartTests| DV$1) . #0#)
        (LETT $ (GETREFV 34) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|BrillhartTests| (LIST DV$1)
            (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 21 6)
        $)))) 

(MAKEPROP '|BrillhartTests| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|)
             (|NonNegativeInteger|) (0 . |degree|) (5 . |Zero|)
             (9 . |reductum|) (|Integer|) (|Float|) (14 . |coerce|)
             (|Union| $ '"failed") (19 . |exquo|) (25 . /) (31 . |One|)
             (|Boolean|) (35 . <) (41 . |prime?|) '|brillharttrials|
             |BRILL;brillhartTrials;Nni;3|
             |BRILL;brillhartTrials;2Nni;4|
             |BRILL;noLinearFactor?;UPB;7|
             |BRILL;brillhartIrreducible?;UP2B;6|
             |BRILL;brillhartIrreducible?;UPB;5|
             (|GaloisGroupFactorizationUtilities| 11 6 12)
             (46 . |rootBound|) (51 . |coefficient|) (57 . |even?|)
             (62 . |One|) (66 . |elt|) (72 . |leadingCoefficient|))
          '#(|noLinearFactor?| 77 |brillhartTrials| 82
             |brillhartIrreducible?| 91)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 33
                                '(1 6 7 0 8 0 6 0 9 1 6 0 0 10 1 12 0
                                  11 13 2 11 14 0 0 15 2 12 0 0 0 16 0
                                  12 0 17 2 12 18 0 0 19 1 11 18 0 20 1
                                  27 11 6 28 2 6 11 0 7 29 1 11 18 0 30
                                  0 6 0 31 2 6 11 0 11 32 1 6 11 0 33 1
                                  0 18 6 24 0 0 7 22 1 0 7 7 23 2 0 18
                                  6 18 25 1 0 18 6 26)))))
          '|lookupComplete|)) 
