
(/VERSIONCHECK 2) 

(DEFUN |FFNBP;coerce;GF$;1| (|v| $)
  (SPADCALL (QREFELT $ 17) (SPADCALL |v| (QREFELT $ 49) (QREFELT $ 54))
      (QREFELT $ 55))) 

(PUT '|FFNBP;represents;V$;2| '|SPADreplace| '(XLAM (|v|) |v|)) 

(DEFUN |FFNBP;represents;V$;2| (|v| $) |v|) 

(DEFUN |FFNBP;degree;$Pi;3| (|a| $)
  (PROG (|b| |d|)
    (RETURN
      (SEQ (LETT |d| 1 . #0=(|FFNBP;degree;$Pi;3|))
           (LETT |b| (SPADCALL |a| 1 (QREFELT $ 58)) . #0#)
           (SEQ G190
                (COND
                  ((NULL (COND
                           ((SPADCALL |b| |a| (QREFELT $ 60)) 'NIL)
                           ('T 'T)))
                   (GO G191)))
                (SEQ (LETT |b| (SPADCALL |b| 1 (QREFELT $ 58)) . #0#)
                     (EXIT (LETT |d| (+ |d| 1) . #0#)))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT |d|))))) 

(DEFUN |FFNBP;linearAssociatedExp;$Sup$;4| (|x| |f| $)
  (PROG (|xm| |r|)
    (RETURN
      (SEQ (LETT |xm|
                 (SPADCALL
                     (SPADCALL (|spadConstant| $ 35) (QREFELT $ 17)
                         (QREFELT $ 63))
                     (|spadConstant| $ 21) (QREFELT $ 64))
                 . #0=(|FFNBP;linearAssociatedExp;$Sup$;4|))
           (LETT |r|
                 (SPADCALL
                     (SPADCALL |f| (SPADCALL |x| (QREFELT $ 65))
                         (QREFELT $ 66))
                     |xm| (QREFELT $ 67)) . #0#)
           (EXIT (SPADCALL |r| (QREFELT $ 17) (QREFELT $ 68))))))) 

(DEFUN |FFNBP;linearAssociatedLog;$Sup;5| (|x| $)
  (SPADCALL |x| (QREFELT $ 65))) 

(DEFUN |FFNBP;linearAssociatedOrder;$Sup;6| (|x| $)
  (PROG (|xm|)
    (RETURN
      (SEQ (LETT |xm|
                 (SPADCALL
                     (SPADCALL (|spadConstant| $ 35) (QREFELT $ 17)
                         (QREFELT $ 63))
                     (|spadConstant| $ 21) (QREFELT $ 64))
                 |FFNBP;linearAssociatedOrder;$Sup;6|)
           (EXIT (SPADCALL |xm|
                     (SPADCALL |xm| (SPADCALL |x| (QREFELT $ 65))
                         (QREFELT $ 71))
                     (QREFELT $ 72))))))) 

(DEFUN |FFNBP;linearAssociatedLog;2$U;7| (|b| |x| $)
  (PROG (|xm| |e| #0=#:G1858 |e1|)
    (RETURN
      (SEQ (COND
             ((SPADCALL |x| (QREFELT $ 74))
              (CONS 0 (|spadConstant| $ 19)))
             ('T
              (SEQ (LETT |xm|
                         (SPADCALL
                             (SPADCALL (|spadConstant| $ 35)
                                 (QREFELT $ 17) (QREFELT $ 63))
                             (|spadConstant| $ 21) (QREFELT $ 64))
                         . #1=(|FFNBP;linearAssociatedLog;2$U;7|))
                   (LETT |e|
                         (SPADCALL (SPADCALL |b| (QREFELT $ 65)) |xm|
                             (SPADCALL |x| (QREFELT $ 65))
                             (QREFELT $ 77)) . #1#)
                   (EXIT (COND
                           ((SPADCALL |e| (CONS 1 "failed")
                                (QREFELT $ 80))
                            (CONS 1 "failed"))
                           ('T
                            (SEQ (LETT |e1|
                                       (PROG2 (LETT #0# |e| . #1#)
                                        (QCDR #0#)
                                         (|check-union| (QEQCAR #0# 0)
                                          (|Record|
                                           (|:| |coef1|
                                            (|SparseUnivariatePolynomial|
                                             (QREFELT $ 6)))
                                           (|:| |coef2|
                                            (|SparseUnivariatePolynomial|
                                             (QREFELT $ 6))))
                                          #0#)) . #1#)
                                 (EXIT (CONS 0 (QCAR |e1|)))))))))))))) 

(DEFUN |FFNBP;getMultiplicationTable;V;8| ($)
  (SEQ (COND ((QREFELT $ 16) (|FFNBP;initializeMult| $)))
       (EXIT (QREFELT $ 28)))) 

(DEFUN |FFNBP;getMultiplicationMatrix;M;9| ($)
  (SEQ (COND ((QREFELT $ 16) (|FFNBP;initializeMult| $)))
       (EXIT (SPADCALL (QREFELT $ 28) (QREFELT $ 86))))) 

(DEFUN |FFNBP;sizeMultiplication;Nni;10| ($)
  (SEQ (COND ((QREFELT $ 16) (|FFNBP;initializeMult| $)))
       (EXIT (SPADCALL (QREFELT $ 28) (QREFELT $ 88))))) 

(DEFUN |FFNBP;trace;$GF;11| (|a| $)
  (SPADCALL (SPADCALL |a| 1 (QREFELT $ 90)) (QREFELT $ 91))) 

(DEFUN |FFNBP;norm;$GF;12| (|a| $)
  (SPADCALL (SPADCALL |a| 1 (QREFELT $ 93)) (QREFELT $ 91))) 

(DEFUN |FFNBP;generator;$;13| ($)
  (SPADCALL (QREFELT $ 17) (QREFELT $ 95))) 

(DEFUN |FFNBP;basis;PiV;14| (|n| $)
  (PROG (#0=#:G1884 |i| #1=#:G1885)
    (RETURN
      (SEQ (COND
             ((NULL (EQL (REMAINDER2 (QREFELT $ 17) |n|) 0))
              (|error| "argument must divide extension degree"))
             ('T
              (PRIMVEC2ARR
                  (PROGN
                    (LETT #0# (GETREFV |n|)
                          . #2=(|FFNBP;basis;PiV;14|))
                    (SEQ (LETT |i| 0 . #2#) (LETT #1# (- |n| 1) . #2#)
                         G190 (COND ((QSGREATERP |i| #1#) (GO G191)))
                         (SEQ (EXIT (SETELT #0# |i|
                                     (SPADCALL
                                      (SPADCALL
                                       (SPADCALL (QREFELT $ 97)) |n|
                                       (QREFELT $ 90))
                                      |i| (QREFELT $ 98)))))
                         (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191
                         (EXIT NIL))
                    #0#)))))))) 

(DEFUN |FFNBP;*;GF2$;15| (|a| |x| $)
  (SPADCALL |a| |x| (QREFELT $ 101))) 

(DEFUN |FFNBP;/;$GF$;16| (|x| |a| $)
  (SPADCALL |x| (SPADCALL |a| (QREFELT $ 56)) (QREFELT $ 103))) 

(PUT '|FFNBP;coordinates;$V;17| '|SPADreplace| '(XLAM (|x|) |x|)) 

(DEFUN |FFNBP;coordinates;$V;17| (|x| $) |x|) 

(DEFUN |FFNBP;Frobenius;2$;18| (|e| $)
  (SPADCALL |e| 1 (QREFELT $ 58))) 

(DEFUN |FFNBP;Frobenius;$Nni$;19| (|e| |n| $)
  (SPADCALL |e| |n| (QREFELT $ 58))) 

(DEFUN |FFNBP;retractIfCan;$U;20| (|x| $)
  (COND
    ((SPADCALL |x| (QREFELT $ 107))
     (CONS 0
           (SPADCALL (SPADCALL |x| 1 (QREFELT $ 108)) (QREFELT $ 49)
               (QREFELT $ 109))))
    ('T (CONS 1 "failed")))) 

(DEFUN |FFNBP;retract;$GF;21| (|x| $)
  (COND
    ((SPADCALL |x| (QREFELT $ 107))
     (SPADCALL (SPADCALL |x| 1 (QREFELT $ 108)) (QREFELT $ 49)
               (QREFELT $ 109)))
    ('T (|error| "element not in ground field")))) 

(DEFUN |FFNBP;coerce;$Of;22| (|x| $)
  (PROG (|n| |b| #0=#:G1910 |i| |mon| |l| |r|)
    (RETURN
      (SEQ (LETT |l| NIL . #1=(|FFNBP;coerce;$Of;22|))
           (LETT |n| (QREFELT $ 17) . #1#)
           (EXIT (COND
                   ((EQL |n| 1)
                    (SPADCALL (SPADCALL |x| 1 (QREFELT $ 108))
                        (QREFELT $ 112)))
                   (#2='T
                    (SEQ (SEQ (LETT |b| NIL . #1#)
                              (LETT #0# (QREFELT $ 45) . #1#)
                              (LETT |i| 1 . #1#) G190
                              (COND
                                ((OR (QSGREATERP |i| |n|) (ATOM #0#)
                                     (PROGN
                                       (LETT |b| (CAR #0#) . #1#)
                                       NIL))
                                 (GO G191)))
                              (SEQ (EXIT
                                    (COND
                                      ((NULL
                                        (SPADCALL
                                         (SPADCALL |x| |i|
                                          (QREFELT $ 108))
                                         (QREFELT $ 113)))
                                       (SEQ
                                        (LETT |mon|
                                         (COND
                                           ((SPADCALL
                                             (SPADCALL |x| |i|
                                              (QREFELT $ 108))
                                             (|spadConstant| $ 35)
                                             (QREFELT $ 114))
                                            |b|)
                                           ('T
                                            (SPADCALL
                                             (SPADCALL
                                              (SPADCALL |x| |i|
                                               (QREFELT $ 108))
                                              (QREFELT $ 112))
                                             |b| (QREFELT $ 115)))) . #1#)
                                        (EXIT
                                         (LETT |l|
                                          (CONS |mon| |l|) . #1#)))))))
                              (LETT |i|
                                    (PROG1 (QSADD1 |i|)
                                      (LETT #0# (CDR #0#) . #1#)) . #1#)
                              (GO G190) G191 (EXIT NIL))
                         (EXIT (COND
                                 ((NULL |l|)
                                  (SPADCALL (|spadConstant| $ 19)
                                      (QREFELT $ 118)))
                                 (#2#
                                  (SEQ (LETT |r|
                                        (SPADCALL (ELT $ 119) |l|
                                         (QREFELT $ 122)) . #1#)
                                       (EXIT |r|))))))))))))) 

(DEFUN |FFNBP;initializeElt| ($)
  (SEQ (SETELT $ 46
               (SPADCALL
                   (SPADCALL
                       (- (SPADCALL (SPADCALL (QREFELT $ 124))
                              (QREFELT $ 17) (QREFELT $ 125))
                          1)
                       (QREFELT $ 127))
                   (QREFELT $ 131)))
       (SETELT $ 50
               (SPADCALL (SPADCALL (QREFELT $ 132)) (QREFELT $ 133)))
       (SETELT $ 15 'NIL) (EXIT (SPADCALL (QREFELT $ 134))))) 

(DEFUN |FFNBP;initializeMult| ($)
  (SEQ (SETELT $ 28 (SPADCALL (QREFELT $ 20) (QREFELT $ 135)))
       (SPADCALL (QREFELT $ 28) (QREFELT $ 49) (QREFELT $ 40))
       (SETELT $ 16 'NIL) (EXIT (SPADCALL (QREFELT $ 134))))) 

(DEFUN |FFNBP;initializeLog| ($)
  (PROG (|limit| |f| #0=#:G1931 |fac| |base| |l| |d| |n| |tbl| |i|
                 #1=#:G1919 #2=#:G1932 |a| #3=#:G1925)
    (RETURN
      (SEQ (COND ((QREFELT $ 15) (|FFNBP;initializeElt| $)))
           (LETT |limit| 30 . #4=(|FFNBP;initializeLog|))
           (SEQ (LETT |f| NIL . #4#) (LETT #0# (QREFELT $ 46) . #4#)
                G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |f| (CAR #0#) . #4#) NIL))
                   #5=(GO G191)))
                (SEQ (LETT |fac| (QCAR |f|) . #4#)
                     (LETT |base|
                           (SPADCALL
                               (SPADCALL (QREFELT $ 50)
                                   (QREFELT $ 136))
                               (QUOTIENT2
                                   (-
                                    (SPADCALL
                                     (SPADCALL (QREFELT $ 124))
                                     (QREFELT $ 17) (QREFELT $ 125))
                                    1)
                                   |fac|)
                               (QREFELT $ 137)) . #4#)
                     (LETT |l| (INTEGER-LENGTH |fac|) . #4#)
                     (LETT |n| 0 . #4#)
                     (COND
                       ((ODDP |l|)
                        (LETT |n|
                              (ASH |fac| (- (QUOTIENT2 |l| 2))) . #4#))
                       ('T (LETT |n| (ASH 1 (QUOTIENT2 |l| 2)) . #4#)))
                     (COND
                       ((< |n| |limit|)
                        (SEQ (LETT |d|
                                   (+ (QUOTIENT2 (- |fac| 1) |limit|)
                                    1) . #4#)
                             (EXIT (LETT |n|
                                    (+ (QUOTIENT2 (- |fac| 1) |d|) 1) . #4#)))))
                     (LETT |tbl| (SPADCALL (QREFELT $ 139)) . #4#)
                     (LETT |a| (|spadConstant| $ 22) . #4#)
                     (SEQ (LETT |i| 0 . #4#)
                          (LETT #2#
                                (PROG1 (LETT #1# (- |n| 1) . #4#)
                                  (|check-subtype| (>= #1# 0)
                                      '(|NonNegativeInteger|) #1#)) . #4#)
                          G190 (COND ((QSGREATERP |i| #2#) #5#))
                          (SEQ (SPADCALL
                                   (CONS (SPADCALL |a| (QREFELT $ 133))
                                    |i|)
                                   |tbl| (QREFELT $ 141))
                               (EXIT (LETT |a|
                                      (SPADCALL |a| |base|
                                       (QREFELT $ 142)) . #4#)))
                          (LETT |i| (QSADD1 |i|) . #4#) #6=(GO G190)
                          G191 (EXIT NIL))
                     (EXIT (SPADCALL
                               (CONS (PROG1 (LETT #3# |fac| . #4#)
                                       (|check-subtype| (> #3# 0)
                                        '(|PositiveInteger|) #3#))
                                     (SPADCALL |tbl| (QREFELT $ 143)))
                               (QREFELT $ 53) (QREFELT $ 145))))
                (LETT #0# (CDR #0#) . #4#) #6# G191 (EXIT NIL))
           (SETELT $ 14 'NIL) (EXIT (SPADCALL (QREFELT $ 134))))))) 

(DEFUN |FFNBP;tableForDiscreteLogarithm;IT;26| (|fac| $)
  (PROG (#0=#:G1933 |tbl|)
    (RETURN
      (SEQ (COND ((QREFELT $ 14) (|FFNBP;initializeLog| $)))
           (LETT |tbl|
                 (SPADCALL
                     (PROG1 (LETT #0# |fac|
                                  . #1=(|FFNBP;tableForDiscreteLogarithm;IT;26|))
                       (|check-subtype| (> #0# 0) '(|PositiveInteger|)
                           #0#))
                     (QREFELT $ 53) (QREFELT $ 147)) . #1#)
           (EXIT (COND
                   ((QEQCAR |tbl| 1)
                    (|error| "tableForDiscreteLogarithm: argument must be prime divisor of the order of the multiplicative group"))
                   ('T (QCDR |tbl|)))))))) 

(DEFUN |FFNBP;primitiveElement;$;27| ($)
  (SEQ (COND ((QREFELT $ 15) (|FFNBP;initializeElt| $)))
       (EXIT (SPADCALL (QREFELT $ 50) (QREFELT $ 136))))) 

(DEFUN |FFNBP;factorsOfCyclicGroupSize;L;28| ($)
  (SEQ (COND ((NULL (QREFELT $ 46)) (|FFNBP;initializeElt| $)))
       (EXIT (QREFELT $ 46)))) 

(DEFUN |FFNBP;extensionDegree;Pi;29| ($) (QREFELT $ 17)) 

(DEFUN |FFNBP;definingPolynomial;Sup;30| ($) (QREFELT $ 20)) 

(DEFUN |FFNBP;trace;$Pi$;31| (|a| |d| $)
  (PROG (|v| |i| #0=#:G1952 |erg|)
    (RETURN
      (SEQ (LETT |v| (SPADCALL |a| |d| (QREFELT $ 153))
                 . #1=(|FFNBP;trace;$Pi$;31|))
           (LETT |erg| |v| . #1#)
           (SEQ (LETT |i| 2 . #1#)
                (LETT #0# (QUOTIENT2 (QREFELT $ 17) |d|) . #1#) G190
                (COND ((QSGREATERP |i| #0#) (GO G191)))
                (SEQ (EXIT (LETT |erg|
                                 (SPADCALL |erg| |v| (QREFELT $ 154)) . #1#)))
                (LETT |i| (QSADD1 |i|) . #1#) (GO G190) G191
                (EXIT NIL))
           (EXIT |erg|))))) 

(DEFUN |FFNBP;characteristic;Nni;32| ($) (SPADCALL (QREFELT $ 155))) 

(DEFUN |FFNBP;random;$;33| ($)
  (SPADCALL (QREFELT $ 17) (QREFELT $ 157))) 

(DEFUN |FFNBP;*;3$;34| (|x| |y| $)
  (SEQ (COND ((QREFELT $ 16) (|FFNBP;initializeMult| $)))
       (SPADCALL (QREFELT $ 28) (QREFELT $ 49) (QREFELT $ 40))
       (EXIT (SPADCALL |x| |y| (QREFELT $ 159))))) 

(DEFUN |FFNBP;One;$;35| ($)
  (SPADCALL (QREFELT $ 17) (SPADCALL (QREFELT $ 49) (QREFELT $ 160))
      (QREFELT $ 55))) 

(DEFUN |FFNBP;Zero;$;36| ($)
  (SPADCALL (QREFELT $ 17) (QREFELT $ 161))) 

(DEFUN |FFNBP;size;Nni;37| ($)
  (SPADCALL (SPADCALL (QREFELT $ 124)) (QREFELT $ 17) (QREFELT $ 125))) 

(DEFUN |FFNBP;index;Pi$;38| (|n| $)
  (SPADCALL (QREFELT $ 17) |n| (QREFELT $ 163))) 

(DEFUN |FFNBP;lookup;$Pi;39| (|x| $) (SPADCALL |x| (QREFELT $ 164))) 

(DEFUN |FFNBP;basis;V;40| ($)
  (PROG (|a| #0=#:G1965 |e| #1=#:G1966)
    (RETURN
      (SEQ (LETT |a| (SPADCALL (QREFELT $ 17) (QREFELT $ 166))
                 . #2=(|FFNBP;basis;V;40|))
           (EXIT (SPADCALL
                     (PROGN
                       (LETT #0# NIL . #2#)
                       (SEQ (LETT |e| NIL . #2#)
                            (LETT #1#
                                  (SPADCALL |a| (QREFELT $ 168)) . #2#)
                            G190
                            (COND
                              ((OR (ATOM #1#)
                                   (PROGN
                                     (LETT |e| (CAR #1#) . #2#)
                                     NIL))
                               (GO G191)))
                            (SEQ (EXIT (LETT #0# (CONS |e| #0#) . #2#)))
                            (LETT #1# (CDR #1#) . #2#) (GO G190) G191
                            (EXIT (NREVERSE0 #0#))))
                     (QREFELT $ 171))))))) 

(DEFUN |FFNBP;**;$I$;41| (|x| |e| $)
  (SEQ (COND ((QREFELT $ 16) (|FFNBP;initializeMult| $)))
       (SPADCALL (QREFELT $ 28) (QREFELT $ 49) (QREFELT $ 40))
       (EXIT (SPADCALL |x| |e| (QREFELT $ 173))))) 

(DEFUN |FFNBP;normal?;$B;42| (|x| $) (SPADCALL |x| (QREFELT $ 174))) 

(DEFUN |FFNBP;-;2$;43| (|x| $) (SPADCALL |x| (QREFELT $ 176))) 

(DEFUN |FFNBP;+;3$;44| (|x| |y| $) (SPADCALL |x| |y| (QREFELT $ 178))) 

(DEFUN |FFNBP;-;3$;45| (|x| |y| $) (SPADCALL |x| |y| (QREFELT $ 180))) 

(DEFUN |FFNBP;=;2$B;46| (|x| |y| $)
  (SPADCALL |x| |y| (QREFELT $ 182))) 

(DEFUN |FFNBP;*;I2$;47| (|n| |x| $)
  (SPADCALL |x| (SPADCALL |n| (QREFELT $ 183)) (QREFELT $ 184))) 

(PUT '|FFNBP;representationType;U;48| '|SPADreplace|
     '(XLAM NIL (CONS 2 "normal"))) 

(DEFUN |FFNBP;representationType;U;48| ($) (CONS 2 "normal")) 

(DEFUN |FFNBP;minimalPolynomial;$Sup;49| (|a| $)
  (SEQ (COND ((QREFELT $ 16) (|FFNBP;initializeMult| $)))
       (SPADCALL (QREFELT $ 28) (QREFELT $ 49) (QREFELT $ 40))
       (EXIT (SPADCALL |a| (QREFELT $ 41))))) 

(DEFUN |FFNBP;inGroundField?;$B;50| (|x| $)
  (PROG (|i| #0=#:G1992 |erg| #1=#:G1989)
    (RETURN
      (SEQ (LETT |erg| 'T . #2=(|FFNBP;inGroundField?;$B;50|))
           (SEQ (EXIT (SEQ (LETT |i| 2 . #2#)
                           (LETT #0# (QREFELT $ 17) . #2#) G190
                           (COND ((QSGREATERP |i| #0#) (GO G191)))
                           (SEQ (EXIT (COND
                                        ((NULL
                                          (SPADCALL
                                           (SPADCALL |x| |i|
                                            (QREFELT $ 108))
                                           (SPADCALL |x| 1
                                            (QREFELT $ 108))
                                           (QREFELT $ 114)))
                                         (PROGN
                                           (LETT #1#
                                            (LETT |erg| 'NIL . #2#) . #2#)
                                           (GO #1#))))))
                           (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191
                           (EXIT NIL)))
                #1# (EXIT #1#))
           (EXIT |erg|))))) 

(DEFUN |FFNBP;/;3$;51| (|x| |y| $)
  (SEQ (COND ((QREFELT $ 16) (|FFNBP;initializeMult| $)))
       (SPADCALL (QREFELT $ 28) (QREFELT $ 49) (QREFELT $ 40))
       (EXIT (SPADCALL |x| |y| (QREFELT $ 189))))) 

(DEFUN |FFNBP;inv;2$;52| (|a| $)
  (SEQ (COND ((QREFELT $ 16) (|FFNBP;initializeMult| $)))
       (SPADCALL (QREFELT $ 28) (QREFELT $ 49) (QREFELT $ 40))
       (EXIT (SPADCALL |a| (QREFELT $ 190))))) 

(DEFUN |FFNBP;norm;$Pi$;53| (|a| |d| $)
  (SEQ (COND ((QREFELT $ 16) (|FFNBP;initializeMult| $)))
       (SPADCALL (QREFELT $ 28) (QREFELT $ 49) (QREFELT $ 40))
       (EXIT (SPADCALL |a| |d| (QREFELT $ 192))))) 

(DEFUN |FFNBP;normalElement;$;54| ($)
  (SPADCALL (QREFELT $ 17) (QREFELT $ 95))) 

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

(DEFUN |FiniteFieldNormalBasisExtensionByPolynomial;| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ #0=#:G2016 |pv$| #1=#:G1828 #2=#:G1827 |qs|
              #3=#:G2017 |i| #4=#:G2018 #5=#:G1837)
    (RETURN
      (SEQ (PROGN
             (LETT DV$1 (|devaluate| |#1|)
                   . #6=(|FiniteFieldNormalBasisExtensionByPolynomial|))
             (LETT DV$2 (|devaluate| |#2|) . #6#)
             (LETT |dv$|
                   (LIST '|FiniteFieldNormalBasisExtensionByPolynomial|
                         DV$1 DV$2) . #6#)
             (LETT $ (GETREFV 209) . #6#)
             (QSETREFV $ 0 |dv$|)
             (QSETREFV $ 3
                 (LETT |pv$|
                       (|buildPredVector| 0 0
                           (LIST (|HasCategory| |#1|
                                     '(|CharacteristicZero|))
                                 (|HasCategory| |#1| '(|Finite|))
                                 (LETT #0#
                                       (|HasCategory| |#1|
                                        '(|CharacteristicNonZero|)) . #6#)
                                 (OR #0#
                                     (|HasCategory| |#1| '(|Finite|))))) . #6#))
             (|haddProp| |$ConstructorCache|
                 '|FiniteFieldNormalBasisExtensionByPolynomial|
                 (LIST DV$1 DV$2) (CONS 1 $))
             (|stuffDomainSlots| $)
             (QSETREFV $ 6 |#1|)
             (QSETREFV $ 7 |#2|)
             (QSETREFV $ 8 (|Vector| |#1|))
             (QSETREFV $ 13
                 (SPADCALL (SPADCALL (QREFELT $ 10)) (QREFELT $ 12)))
             (QSETREFV $ 14 'T)
             (QSETREFV $ 15 'T)
             (QSETREFV $ 16 'T)
             (QSETREFV $ 17 1)
             (QSETREFV $ 20 (|spadConstant| $ 19))
             (QSETREFV $ 28 (SPADCALL 1 NIL (QREFELT $ 27)))
             (QSETREFV $ 29 (QEQCAR |#2| 1))
             (COND
               ((QREFELT $ 29)
                (PROGN
                  (SETELT $ 28
                          (PROG2 (LETT #1# |#2| . #6#) (QCDR #1#)
                            (|check-union| (QEQCAR #1# 1)
                                (|Vector|
                                    (|List|
                                     (|Record| (|:| |value| |#2|)
                                      (|:| |index| (|SingleInteger|)))))
                                #1#)))
                  (SETELT $ 17 (QVSIZE (QREFELT $ 28)))
                  (QSETREFV $ 34
                      (SPADCALL (QREFELT $ 17) (|spadConstant| $ 31)
                          (QREFELT $ 33)))
                  (SPADCALL (QREFELT $ 34) 1 (|spadConstant| $ 35)
                      (QREFELT $ 37))
                  (SPADCALL (QREFELT $ 28) (|spadConstant| $ 35)
                      (QREFELT $ 40))
                  (SETELT $ 20
                          (SPADCALL (QREFELT $ 34) (QREFELT $ 41)))
                  (SETELT $ 16 'NIL)))
               ('T
                (PROGN
                  (SETELT $ 20
                          (PROG2 (LETT #2# |#2| . #6#) (QCDR #2#)
                            (|check-union| (QEQCAR #2# 0)
                                (|SparseUnivariatePolynomial| |#2|)
                                #2#)))
                  (SETELT $ 17
                          (SPADCALL (QREFELT $ 20) (QREFELT $ 42)))
                  (SETELT $ 28
                          (SPADCALL (QREFELT $ 17) NIL (QREFELT $ 27))))))
             (QSETREFV $ 45
                 (SEQ (LETT |qs| (SPADCALL '|q| (QREFELT $ 12)) . #6#)
                      (EXIT (APPEND (LIST (QREFELT $ 13)
                                     (SPADCALL (QREFELT $ 13) |qs|
                                      (QREFELT $ 43)))
                                    (PROGN
                                      (LETT #3# NIL . #6#)
                                      (SEQ (LETT |i| 2 . #6#)
                                       (LETT #4#
                                        (- (QREFELT $ 17) 1) . #6#)
                                       G190
                                       (COND
                                         ((QSGREATERP |i| #4#)
                                          (GO G191)))
                                       (SEQ
                                        (EXIT
                                         (LETT #3#
                                          (CONS
                                           (SPADCALL (QREFELT $ 13)
                                            (SPADCALL |qs|
                                             (SPADCALL |i|
                                              (QREFELT $ 44))
                                             (QREFELT $ 43))
                                            (QREFELT $ 43))
                                           #3#) . #6#)))
                                       (LETT |i| (QSADD1 |i|) . #6#)
                                       (GO G190) G191
                                       (EXIT (NREVERSE0 #3#))))))))
             (QSETREFV $ 46 NIL)
             (QSETREFV $ 49
                 (SPADCALL
                     (SPADCALL (QREFELT $ 20)
                         (PROG1 (LETT #5#
                                      (-
                                       (SPADCALL (QREFELT $ 20)
                                        (QREFELT $ 42))
                                       1) . #6#)
                           (|check-subtype| (>= #5# 0)
                               '(|NonNegativeInteger|) #5#))
                         (QREFELT $ 47))
                     (QREFELT $ 48)))
             (QSETREFV $ 50 1)
             (QSETREFV $ 53 (SPADCALL (QREFELT $ 52)))
             $))))) 

(MAKEPROP '|FiniteFieldNormalBasisExtensionByPolynomial| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             '|Rep| (|Symbol|) (0 . |new|) (|OutputForm|)
             (4 . |coerce|) '|alpha| '|initlog?| '|initelt?|
             '|initmult?| '|extdeg| (|SparseUnivariatePolynomial| 6)
             (9 . |Zero|) '|defpol| (13 . |One|)
             (CONS IDENTITY
                   (FUNCALL (|dispatchFunction| |FFNBP;One;$;35|) $))
             (|NonNegativeInteger|)
             (|Record| (|:| |value| 6) (|:| |index| 208)) (|List| 24)
             (|Vector| 25) (17 . |new|) '|multTable| '#:G1815
             (CONS IDENTITY
                   (FUNCALL (|dispatchFunction| |FFNBP;Zero;$;36|) $))
             (23 . |Zero|) (|Vector| 6) (27 . |new|) '|vv| (33 . |One|)
             (|Integer|) (37 . |setelt|) (|Void|)
             (|InnerNormalBasisFieldFunctions| 6) (44 . |setFieldInfo|)
             (50 . |minimalPolynomial|) (55 . |degree|) (60 . **)
             (66 . |coerce|) '|basisOutput| '|facOfGroupSize|
             (71 . |coefficient|) (77 . -) '|traceAlpha|
             '|primitiveElt| (|Table| 61 138) (82 . |table|)
             '|discLogTable| (86 . /) (92 . |new|) |FFNBP;coerce;GF$;1|
             |FFNBP;represents;V$;2| (98 . |qPot|) (|Boolean|)
             |FFNBP;=;2$B;46| (|PositiveInteger|) |FFNBP;degree;$Pi;3|
             (104 . |monomial|) (110 . -) (116 . |pol|) (121 . *)
             (127 . |rem|) (133 . |vectorise|)
             |FFNBP;linearAssociatedExp;$Sup$;4|
             |FFNBP;linearAssociatedLog;$Sup;5| (139 . |gcd|)
             (145 . |quo|) |FFNBP;linearAssociatedOrder;$Sup;6|
             (151 . |zero?|) (|Record| (|:| |coef1| $) (|:| |coef2| $))
             (|Union| 75 '"failed") (156 . |extendedEuclidean|)
             (|Record| (|:| |coef1| 18) (|:| |coef2| 18))
             (|Union| 78 '"failed") (163 . =) (|Union| 18 '"failed")
             |FFNBP;linearAssociatedLog;2$U;7|
             |FFNBP;getMultiplicationTable;V;8| (|Matrix| 6)
             (|FiniteFieldFunctions| 6)
             (169 . |createMultiplicationMatrix|)
             |FFNBP;getMultiplicationMatrix;M;9|
             (174 . |sizeMultiplication|)
             |FFNBP;sizeMultiplication;Nni;10| |FFNBP;trace;$Pi$;31|
             |FFNBP;retract;$GF;21| |FFNBP;trace;$GF;11|
             |FFNBP;norm;$Pi$;53| |FFNBP;norm;$GF;12|
             (179 . |normalElement|) |FFNBP;generator;$;13|
             |FFNBP;normalElement;$;54| |FFNBP;Frobenius;$Nni$;19|
             (|Vector| $) |FFNBP;basis;PiV;14| (184 . *)
             |FFNBP;*;GF2$;15| |FFNBP;/;3$;51| |FFNBP;/;$GF$;16|
             |FFNBP;coordinates;$V;17| |FFNBP;Frobenius;2$;18|
             |FFNBP;inGroundField?;$B;50| (190 . |elt|) (196 . *)
             (|Union| 6 '"failed") |FFNBP;retractIfCan;$U;20|
             (202 . |coerce|) (207 . |zero?|) (212 . =) (218 . *)
             (|Fraction| 18) (224 . |Zero|) (228 . |coerce|) (233 . +)
             (|Mapping| 11 11 11) (|List| 11) (239 . |reduce|)
             |FFNBP;coerce;$Of;22| (245 . |size|) (249 . **)
             (|Factored| $) (255 . |factor|)
             (|Record| (|:| |factor| 36) (|:| |exponent| 36))
             (|List| 128) (|Factored| 36) (260 . |factors|)
             (265 . |createPrimitiveElement|) |FFNBP;lookup;$Pi;39|
             (269 . |void|) (273 . |createMultiplicationTable|)
             |FFNBP;index;Pi$;38| |FFNBP;**;$I$;41| (|Table| 61 23)
             (278 . |table|) (|Record| (|:| |key| 61) (|:| |entry| 23))
             (282 . |insert!|) |FFNBP;*;3$;34| (288 . |copy|)
             (|Record| (|:| |key| 61) (|:| |entry| 138))
             (293 . |insert!|) (|Union| 138 '"failed") (299 . |search|)
             |FFNBP;tableForDiscreteLogarithm;IT;26|
             |FFNBP;primitiveElement;$;27|
             |FFNBP;factorsOfCyclicGroupSize;L;28|
             |FFNBP;extensionDegree;Pi;29|
             |FFNBP;definingPolynomial;Sup;30| (305 . |trace|)
             (311 . |concat|) (317 . |characteristic|)
             |FFNBP;characteristic;Nni;32| (321 . |random|)
             |FFNBP;random;$;33| (326 . *) (332 . |inv|) (337 . |zero|)
             |FFNBP;size;Nni;37| (342 . |index|) (348 . |lookup|)
             (|Vector| 32) (353 . |basis|) (|List| 32)
             (358 . |entries|) (|List| $$) (|Vector| $$)
             (363 . |vector|) |FFNBP;basis;V;40| (368 . **)
             (374 . |normal?|) |FFNBP;normal?;$B;42| (379 . -)
             |FFNBP;-;2$;43| (384 . +) |FFNBP;+;3$;44| (390 . -)
             |FFNBP;-;3$;45| (396 . =) (402 . |coerce|) (407 . *)
             |FFNBP;*;I2$;47|
             (|Union| '"prime" '"polynomial" '"normal" '"cyclic")
             |FFNBP;representationType;U;48|
             |FFNBP;minimalPolynomial;$Sup;49| (413 . /) (419 . |inv|)
             |FFNBP;inv;2$;52| (424 . |norm|) (|Union| $ '"failed")
             (|Union| 23 '"failed") (|OnePointCompletion| 61)
             (|List| $) (|Union| 99 '"failed") (|Matrix| $)
             (|SparseUnivariatePolynomial| $) (|CardinalNumber|)
             (|Fraction| 36) (|Union| 196 '"failed")
             (|Record| (|:| |coef1| $) (|:| |coef2| $)
                 (|:| |generator| $))
             (|Record| (|:| |quotient| $) (|:| |remainder| $))
             (|Record| (|:| |coef| 196) (|:| |generator| $))
             (|Record| (|:| |unit| $) (|:| |canonical| $)
                 (|:| |associate| $))
             (|String|) (|SingleInteger|))
          '#(~= 430 |zero?| 436 |unitNormal| 441 |unitCanonical| 446
             |unit?| 451 |transcendent?| 456 |transcendenceDegree| 461
             |trace| 465 |tableForDiscreteLogarithm| 476
             |subtractIfCan| 481 |squareFreePart| 487 |squareFree| 492
             |sizeMultiplication| 497 |sizeLess?| 501 |size| 507
             |sample| 511 |retractIfCan| 515 |retract| 520 |represents|
             525 |representationType| 530 |rem| 534 |recip| 540
             |random| 545 |quo| 549 |principalIdeal| 555
             |primitiveElement| 560 |primitive?| 564 |primeFrobenius|
             569 |prime?| 580 |order| 585 |one?| 595 |normalElement|
             600 |normal?| 604 |norm| 609 |nextItem| 620
             |multiEuclidean| 625 |minimalPolynomial| 631 |lookup| 642
             |linearAssociatedOrder| 647 |linearAssociatedLog| 652
             |linearAssociatedExp| 663 |lcm| 669 |latex| 680 |inv| 685
             |init| 690 |index| 694 |inGroundField?| 699 |hash| 704
             |getMultiplicationTable| 709 |getMultiplicationMatrix| 713
             |generator| 717 |gcdPolynomial| 721 |gcd| 727
             |factorsOfCyclicGroupSize| 738 |factor| 742
             |extensionDegree| 747 |extendedEuclidean| 755 |exquo| 768
             |expressIdealMember| 774 |euclideanSize| 780 |enumerate|
             785 |divide| 789 |discreteLog| 795 |dimension| 806
             |differentiate| 810 |degree| 821 |definingPolynomial| 831
             |createPrimitiveElement| 835 |createNormalElement| 839
             |coordinates| 843 |conditionP| 853 |coerce| 858
             |charthRoot| 883 |characteristic| 893 |basis| 897
             |associates?| 906 |algebraic?| 912 ^ 917 |Zero| 935 |One|
             939 |Frobenius| 943 D 954 = 965 / 971 - 983 + 994 ** 1000
             * 1018)
          'NIL
          (CONS (|makeByteWordVec2| 4
                    '(0 0 2 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 1 2 0 0 0
                      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 0 0 0 0 0 0 0
                      0 0))
                (CONS '#(|FiniteAlgebraicExtensionField&|
                         |ExtensionField&| |FiniteFieldCategory&|
                         |FieldOfPrimeCharacteristic&| |Field&|
                         |EuclideanDomain&| NIL
                         |UniqueFactorizationDomain&| |GcdDomain&|
                         |DivisionRing&| |IntegralDomain&|
                         |VectorSpace&| |Algebra&| |Algebra&| |Module&|
                         |Module&| NIL NIL |Module&| NIL NIL
                         |DifferentialRing&| NIL NIL NIL |Ring&| NIL
                         NIL NIL NIL NIL NIL NIL |AbelianGroup&| NIL
                         NIL |AbelianMonoid&| |Monoid&| NIL
                         |SemiGroup&| |AbelianSemiGroup&| |Finite&| NIL
                         |SetCategory&| |RetractableTo&| NIL NIL NIL
                         NIL NIL |BasicType&| NIL)
                      (CONS '#((|FiniteAlgebraicExtensionField| 6)
                               (|ExtensionField| 6)
                               (|FiniteFieldCategory|)
                               (|FieldOfPrimeCharacteristic|) (|Field|)
                               (|EuclideanDomain|)
                               (|PrincipalIdealDomain|)
                               (|UniqueFactorizationDomain|)
                               (|GcdDomain|) (|DivisionRing|)
                               (|IntegralDomain|) (|VectorSpace| 6)
                               (|Algebra| 201) (|Algebra| $$)
                               (|Module| 6) (|Module| 201)
                               (|EntireRing|) (|CommutativeRing|)
                               (|Module| $$) (|CharacteristicNonZero|)
                               (|CharacteristicZero|)
                               (|DifferentialRing|) (|BiModule| 6 6)
                               (|BiModule| 201 201) (|BiModule| $$ $$)
                               (|Ring|) (|RightModule| 6)
                               (|LeftModule| 6) (|RightModule| 201)
                               (|LeftModule| 201) (|LeftModule| $$)
                               (|Rng|) (|RightModule| $$)
                               (|AbelianGroup|)
                               (|CancellationAbelianMonoid|)
                               (|SemiRing|) (|AbelianMonoid|)
                               (|Monoid|) (|SemiRng|) (|SemiGroup|)
                               (|AbelianSemiGroup|) (|Finite|)
                               (|StepThrough|) (|SetCategory|)
                               (|RetractableTo| 6) (|canonicalsClosed|)
                               (|canonicalUnitNormal|)
                               (|noZeroDivisors|) (|CommutativeStar|)
                               (|unitsKnown|) (|BasicType|)
                               (|CoercibleTo| 11))
                            (|makeByteWordVec2| 208
                                '(0 9 0 10 1 9 11 0 12 0 18 0 19 0 18 0
                                  21 2 26 0 23 25 27 0 6 0 31 2 32 0 23
                                  6 33 0 6 0 35 3 8 6 0 36 6 37 2 39 38
                                  26 6 40 1 39 18 32 41 1 18 23 0 42 2
                                  11 0 0 0 43 1 23 11 0 44 2 18 6 0 23
                                  47 1 6 0 0 48 0 51 0 52 2 6 0 0 0 54
                                  2 8 0 23 6 55 2 39 32 32 36 58 2 18 0
                                  6 23 63 2 18 0 0 0 64 1 39 18 32 65 2
                                  18 0 0 0 66 2 18 0 0 0 67 2 18 32 0
                                  23 68 2 18 0 0 0 71 2 18 0 0 0 72 1 0
                                  59 0 74 3 18 76 0 0 0 77 2 79 59 0 0
                                  80 1 85 84 26 86 1 85 23 26 88 1 39
                                  32 61 95 2 8 0 6 0 101 2 8 6 0 36 108
                                  2 6 0 0 0 109 1 6 11 0 112 1 6 59 0
                                  113 2 6 59 0 0 114 2 11 0 0 0 115 0
                                  116 0 117 1 18 11 0 118 2 11 0 0 0
                                  119 2 121 11 120 0 122 0 6 23 124 2
                                  23 0 0 61 125 1 36 126 0 127 1 130
                                  129 0 131 0 0 0 132 0 38 0 134 1 85
                                  26 18 135 0 138 0 139 2 138 0 140 0
                                  141 1 138 0 0 143 2 51 0 144 0 145 2
                                  51 146 61 0 147 2 39 32 32 61 153 2 8
                                  0 0 0 154 0 6 23 155 1 39 32 61 157 2
                                  39 32 32 32 159 1 6 0 0 160 1 8 0 23
                                  161 2 39 32 61 61 163 1 39 61 32 164
                                  1 39 165 61 166 1 165 167 0 168 1 170
                                  0 169 171 2 39 32 32 36 173 1 39 59
                                  32 174 1 8 0 0 176 2 8 0 0 0 178 2 8
                                  0 0 0 180 2 8 59 0 0 182 1 6 0 36 183
                                  2 8 0 0 6 184 2 39 32 32 32 189 1 39
                                  32 32 190 2 39 32 32 61 192 2 0 59 0
                                  0 1 1 0 59 0 74 1 0 206 0 1 1 0 0 0 1
                                  1 0 59 0 1 1 0 59 0 1 0 0 23 1 2 2 0
                                  0 61 90 1 0 6 0 92 1 2 138 36 148 2 0
                                  193 0 0 1 1 0 0 0 1 1 0 126 0 1 0 0
                                  23 89 2 0 59 0 0 1 0 2 23 162 0 0 0 1
                                  1 0 110 0 111 1 0 6 0 91 1 0 0 32 57
                                  0 2 186 187 2 0 0 0 0 1 1 0 193 0 1 0
                                  2 0 158 2 0 0 0 0 1 1 0 205 196 1 0 2
                                  0 149 1 2 59 0 1 2 4 0 0 23 1 1 4 0 0
                                  1 1 0 59 0 1 1 4 195 0 1 1 2 61 0 1 1
                                  0 59 0 1 0 2 0 97 1 2 59 0 175 2 2 0
                                  0 61 93 1 0 6 0 94 1 2 193 0 1 2 0
                                  202 196 0 1 2 2 199 0 61 1 1 0 18 0
                                  188 1 2 61 0 133 1 2 18 0 73 2 2 81 0
                                  0 82 1 2 18 0 70 2 2 0 0 18 69 2 0 0
                                  0 0 1 1 0 0 196 1 1 0 207 0 1 1 0 0 0
                                  191 0 2 0 1 1 2 0 61 136 1 0 59 0 107
                                  1 0 208 0 1 0 0 26 83 0 0 84 87 0 2 0
                                  96 2 0 199 199 199 1 2 0 0 0 0 1 1 0
                                  0 196 1 0 2 129 150 1 0 126 0 1 0 0
                                  61 151 0 0 195 1 2 0 203 0 0 1 3 0 76
                                  0 0 0 1 2 0 193 0 0 1 2 0 202 196 0 1
                                  1 0 23 0 1 0 2 196 1 2 0 204 0 0 1 2
                                  4 194 0 0 1 1 2 23 0 1 0 0 200 1 2 2
                                  0 0 23 1 1 2 0 0 1 1 0 61 0 62 1 0
                                  195 0 1 0 0 18 152 0 2 0 132 0 2 0 1
                                  1 0 32 0 105 1 0 84 99 1 1 2 197 198
                                  1 1 0 0 6 56 1 0 0 201 1 1 0 0 36 1 1
                                  0 0 0 1 1 0 11 0 123 1 4 193 0 1 1 2
                                  0 0 1 0 0 23 156 0 0 99 172 1 0 99 61
                                  100 2 0 59 0 0 1 1 0 59 0 1 2 0 0 0
                                  36 1 2 0 0 0 23 1 2 0 0 0 61 1 0 0 0
                                  30 0 0 0 22 1 2 0 0 106 2 2 0 0 23 98
                                  2 2 0 0 23 1 1 2 0 0 1 2 0 59 0 0 60
                                  2 0 0 0 6 104 2 0 0 0 0 103 1 0 0 0
                                  177 2 0 0 0 0 181 2 0 0 0 0 179 2 0 0
                                  0 36 137 2 0 0 0 23 1 2 0 0 0 61 1 2
                                  0 0 0 6 1 2 0 0 6 0 102 2 0 0 0 201 1
                                  2 0 0 201 0 1 2 0 0 36 0 185 2 0 0 0
                                  0 142 2 0 0 23 0 1 2 0 0 61 0 1)))))
          '|lookupComplete|)) 
