(declare (block) (standard-bindings) (extended-bindings))
(begin
  (declare (fixnum) (not safe))
  (define std/misc/deque#node::t
    (make-struct-type
     'std/misc/deque#node::t
     '#f
     '3
     'node
     '((final: . #t))
     ':init!
     '(e prev next)))
  (define std/misc/deque#node? (make-struct-predicate std/misc/deque#node::t))
  (define std/misc/deque#make-node
    (lambda _$args176274_
      (apply make-struct-instance std/misc/deque#node::t _$args176274_)))
  (define std/misc/deque#node-e
    (make-struct-field-accessor std/misc/deque#node::t '0))
  (define std/misc/deque#node-prev
    (make-struct-field-accessor std/misc/deque#node::t '1))
  (define std/misc/deque#node-next
    (make-struct-field-accessor std/misc/deque#node::t '2))
  (define std/misc/deque#node-e-set!
    (make-struct-field-mutator std/misc/deque#node::t '0))
  (define std/misc/deque#node-prev-set!
    (make-struct-field-mutator std/misc/deque#node::t '1))
  (define std/misc/deque#node-next-set!
    (make-struct-field-mutator std/misc/deque#node::t '2))
  (define std/misc/deque#&node-e
    (make-struct-field-unchecked-accessor std/misc/deque#node::t '0))
  (define std/misc/deque#&node-prev
    (make-struct-field-unchecked-accessor std/misc/deque#node::t '1))
  (define std/misc/deque#&node-next
    (make-struct-field-unchecked-accessor std/misc/deque#node::t '2))
  (define std/misc/deque#&node-e-set!
    (make-struct-field-unchecked-mutator std/misc/deque#node::t '0))
  (define std/misc/deque#&node-prev-set!
    (make-struct-field-unchecked-mutator std/misc/deque#node::t '1))
  (define std/misc/deque#&node-next-set!
    (make-struct-field-unchecked-mutator std/misc/deque#node::t '2))
  (define std/misc/deque#node:::init!
    (lambda (_self176271_ _e176272_)
      (if (##fx< '1 (##vector-length _self176271_))
          (##vector-set! _self176271_ '1 _e176272_)
          (error '"struct-instance-init!: too many arguments for struct"
                 _self176271_))))
  (bind-method! std/misc/deque#node::t ':init! std/misc/deque#node:::init! '#f)
  (define std/misc/deque#make-node/prev
    (lambda (_e176144_ _prev176145_)
      (let ((_new176147_
             (let ((__obj176276 (make-object std/misc/deque#node::t '3)))
               (if (##fx< '1 (##vector-length __obj176276))
                   (##vector-set! __obj176276 '1 _e176144_)
                   (error '"struct-instance-init!: too many arguments for struct"
                          __obj176276))
               __obj176276)))
        (##unchecked-structure-set!
         _new176147_
         _prev176145_
         '2
         std/misc/deque#node::t
         '#f)
        (##unchecked-structure-set!
         _prev176145_
         _new176147_
         '3
         std/misc/deque#node::t
         '#f)
        _new176147_)))
  (define std/misc/deque#make-node/next
    (lambda (_e176139_ _next176140_)
      (let ((_new176142_
             (let ((__obj176277 (make-object std/misc/deque#node::t '3)))
               (if (##fx< '1 (##vector-length __obj176277))
                   (##vector-set! __obj176277 '1 _e176139_)
                   (error '"struct-instance-init!: too many arguments for struct"
                          __obj176277))
               __obj176277)))
        (##unchecked-structure-set!
         _new176142_
         _next176140_
         '3
         std/misc/deque#node::t
         '#f)
        (##unchecked-structure-set!
         _next176140_
         _new176142_
         '2
         std/misc/deque#node::t
         '#f)
        _new176142_)))
  (define std/misc/deque#deque::t
    (make-struct-type
     'std/misc/deque#deque::t
     '#f
     '3
     'deque
     '((final: . #t))
     ':init!
     '(front back length)))
  (define std/misc/deque#deque?
    (make-struct-predicate std/misc/deque#deque::t))
  (define std/misc/deque#make-deque
    (lambda _$args176136_
      (apply make-struct-instance std/misc/deque#deque::t _$args176136_)))
  (define std/misc/deque#deque-front
    (make-struct-field-accessor std/misc/deque#deque::t '0))
  (define std/misc/deque#deque-back
    (make-struct-field-accessor std/misc/deque#deque::t '1))
  (define std/misc/deque#deque-length
    (make-struct-field-accessor std/misc/deque#deque::t '2))
  (define std/misc/deque#deque-front-set!
    (make-struct-field-mutator std/misc/deque#deque::t '0))
  (define std/misc/deque#deque-back-set!
    (make-struct-field-mutator std/misc/deque#deque::t '1))
  (define std/misc/deque#deque-length-set!
    (make-struct-field-mutator std/misc/deque#deque::t '2))
  (define std/misc/deque#&deque-front
    (make-struct-field-unchecked-accessor std/misc/deque#deque::t '0))
  (define std/misc/deque#&deque-back
    (make-struct-field-unchecked-accessor std/misc/deque#deque::t '1))
  (define std/misc/deque#&deque-length
    (make-struct-field-unchecked-accessor std/misc/deque#deque::t '2))
  (define std/misc/deque#&deque-front-set!
    (make-struct-field-unchecked-mutator std/misc/deque#deque::t '0))
  (define std/misc/deque#&deque-back-set!
    (make-struct-field-unchecked-mutator std/misc/deque#deque::t '1))
  (define std/misc/deque#&deque-length-set!
    (make-struct-field-unchecked-mutator std/misc/deque#deque::t '2))
  (define std/misc/deque#deque:::init!
    (lambda (_self176134_)
      (if (##fx< '3 (##vector-length _self176134_))
          (begin
            (##vector-set! _self176134_ '1 '#f)
            (##vector-set! _self176134_ '2 '#f)
            (##vector-set! _self176134_ '3 '0))
          (error '"struct-instance-init!: too many arguments for struct"
                 _self176134_))))
  (bind-method!
   std/misc/deque#deque::t
   ':init!
   std/misc/deque#deque:::init!
   '#f)
  (define std/misc/deque#deque-empty?
    (lambda (_dq176009_)
      (zero? (##unchecked-structure-ref
              _dq176009_
              '3
              std/misc/deque#deque::t
              '#f))))
  (define std/misc/deque#push-front!
    (lambda (_dq175968_ _v175969_)
      (let* ((_dq175970175978_ _dq175968_)
             (_E175972175982_
              (lambda () (error '"No clause matching" _dq175970175978_)))
             (_K175973175991_
              (lambda (_len175985_ _back175986_ _front175987_)
                (let ((_new175989_
                       (if _front175987_
                           (std/misc/deque#make-node/next
                            _v175969_
                            _front175987_)
                           (let ((__obj176278
                                  (make-object std/misc/deque#node::t '3)))
                             (if (##fx< '1 (##vector-length __obj176278))
                                 (##vector-set! __obj176278 '1 _v175969_)
                                 (error '"struct-instance-init!: too many arguments for struct"
                                        __obj176278))
                             __obj176278))))
                  (##unchecked-structure-set!
                   _dq175968_
                   _new175989_
                   '1
                   std/misc/deque#deque::t
                   '#f)
                  (if _back175986_
                      '#!void
                      (##unchecked-structure-set!
                       _dq175968_
                       _new175989_
                       '2
                       std/misc/deque#deque::t
                       '#f))
                  (##unchecked-structure-set!
                   _dq175968_
                   (+ _len175985_ '1)
                   '3
                   std/misc/deque#deque::t
                   '#f)))))
        (if (##structure-direct-instance-of?
             _dq175970175978_
             'std/misc/deque#deque::t)
            (let* ((_e175974175994_ (##vector-ref _dq175970175978_ '1))
                   (_front175997_ _e175974175994_)
                   (_e175975175999_ (##vector-ref _dq175970175978_ '2))
                   (_back176002_ _e175975175999_)
                   (_e175976176004_ (##vector-ref _dq175970175978_ '3))
                   (_len176007_ _e175976176004_))
              (_K175973175991_ _len176007_ _back176002_ _front175997_))
            (_E175972175982_)))))
  (define std/misc/deque#push-back!
    (lambda (_dq175927_ _v175928_)
      (let* ((_dq175929175937_ _dq175927_)
             (_E175931175941_
              (lambda () (error '"No clause matching" _dq175929175937_)))
             (_K175932175950_
              (lambda (_len175944_ _back175945_ _front175946_)
                (let ((_new175948_
                       (if _back175945_
                           (std/misc/deque#make-node/prev
                            _v175928_
                            _back175945_)
                           (let ((__obj176279
                                  (make-object std/misc/deque#node::t '3)))
                             (if (##fx< '1 (##vector-length __obj176279))
                                 (##vector-set! __obj176279 '1 _v175928_)
                                 (error '"struct-instance-init!: too many arguments for struct"
                                        __obj176279))
                             __obj176279))))
                  (##unchecked-structure-set!
                   _dq175927_
                   _new175948_
                   '2
                   std/misc/deque#deque::t
                   '#f)
                  (if _front175946_
                      '#!void
                      (##unchecked-structure-set!
                       _dq175927_
                       _new175948_
                       '1
                       std/misc/deque#deque::t
                       '#f))
                  (##unchecked-structure-set!
                   _dq175927_
                   (+ _len175944_ '1)
                   '3
                   std/misc/deque#deque::t
                   '#f)))))
        (if (##structure-direct-instance-of?
             _dq175929175937_
             'std/misc/deque#deque::t)
            (let* ((_e175933175953_ (##vector-ref _dq175929175937_ '1))
                   (_front175956_ _e175933175953_)
                   (_e175934175958_ (##vector-ref _dq175929175937_ '2))
                   (_back175961_ _e175934175958_)
                   (_e175935175963_ (##vector-ref _dq175929175937_ '3))
                   (_len175966_ _e175935175963_))
              (_K175932175950_ _len175966_ _back175961_ _front175956_))
            (_E175931175941_)))))
  (define std/misc/deque#pop-front!__%
    (lambda (_dq175876_ _default175877_)
      (let* ((_dq175878175886_ _dq175876_)
             (_E175880175890_
              (lambda () (error '"No clause matching" _dq175878175886_)))
             (_K175881175899_
              (lambda (_len175893_ _back175894_ _front175895_)
                (if _front175895_
                    (let ((_next175897_
                           (##unchecked-structure-ref
                            _front175895_
                            '3
                            std/misc/deque#node::t
                            '#f)))
                      (##unchecked-structure-set!
                       _dq175876_
                       _next175897_
                       '1
                       std/misc/deque#deque::t
                       '#f)
                      (if _next175897_
                          (##unchecked-structure-set!
                           _next175897_
                           '#f
                           '2
                           std/misc/deque#node::t
                           '#f)
                          (##unchecked-structure-set!
                           _dq175876_
                           '#f
                           '2
                           std/misc/deque#deque::t
                           '#f))
                      (##unchecked-structure-set!
                       _dq175876_
                       (- _len175893_ '1)
                       '3
                       std/misc/deque#deque::t
                       '#f)
                      (##unchecked-structure-ref
                       _front175895_
                       '1
                       std/misc/deque#node::t
                       '#f))
                    (if (eq? _default175877_ absent-obj)
                        (error '"Cannot pop; empty deque" _dq175876_)
                        _default175877_)))))
        (if (##structure-direct-instance-of?
             _dq175878175886_
             'std/misc/deque#deque::t)
            (let* ((_e175882175902_ (##vector-ref _dq175878175886_ '1))
                   (_front175905_ _e175882175902_)
                   (_e175883175907_ (##vector-ref _dq175878175886_ '2))
                   (_back175910_ _e175883175907_)
                   (_e175884175912_ (##vector-ref _dq175878175886_ '3))
                   (_len175915_ _e175884175912_))
              (_K175881175899_ _len175915_ _back175910_ _front175905_))
            (_E175880175890_)))))
  (define std/misc/deque#pop-front!__0
    (lambda (_dq175920_)
      (let ((_default175922_ absent-obj))
        (std/misc/deque#pop-front!__% _dq175920_ _default175922_))))
  (define std/misc/deque#pop-front!
    (lambda _g176281_
      (let ((_g176280_ (length _g176281_)))
        (cond ((##fx= _g176280_ 1)
               (apply std/misc/deque#pop-front!__0 _g176281_))
              ((##fx= _g176280_ 2)
               (apply std/misc/deque#pop-front!__% _g176281_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/misc/deque#pop-front!
                _g176281_))))))
  (define std/misc/deque#pop-back!__%
    (lambda (_dq175824_ _default175825_)
      (let* ((_dq175826175834_ _dq175824_)
             (_E175828175838_
              (lambda () (error '"No clause matching" _dq175826175834_)))
             (_K175829175847_
              (lambda (_len175841_ _back175842_ _front175843_)
                (if _back175842_
                    (let ((_prev175845_
                           (##unchecked-structure-ref
                            _back175842_
                            '2
                            std/misc/deque#node::t
                            '#f)))
                      (##unchecked-structure-set!
                       _dq175824_
                       _prev175845_
                       '2
                       std/misc/deque#deque::t
                       '#f)
                      (if _prev175845_
                          (##unchecked-structure-set!
                           _prev175845_
                           '#f
                           '3
                           std/misc/deque#node::t
                           '#f)
                          (##unchecked-structure-set!
                           _dq175824_
                           '#f
                           '1
                           std/misc/deque#deque::t
                           '#f))
                      (##unchecked-structure-set!
                       _dq175824_
                       (- _len175841_ '1)
                       '3
                       std/misc/deque#deque::t
                       '#f)
                      (##unchecked-structure-ref
                       _back175842_
                       '1
                       std/misc/deque#node::t
                       '#f))
                    (if (eq? _default175825_ absent-obj)
                        (error '"Cannot pop; empty deque" _dq175824_)
                        _default175825_)))))
        (if (##structure-direct-instance-of?
             _dq175826175834_
             'std/misc/deque#deque::t)
            (let* ((_e175830175850_ (##vector-ref _dq175826175834_ '1))
                   (_front175853_ _e175830175850_)
                   (_e175831175855_ (##vector-ref _dq175826175834_ '2))
                   (_back175858_ _e175831175855_)
                   (_e175832175860_ (##vector-ref _dq175826175834_ '3))
                   (_len175863_ _e175832175860_))
              (_K175829175847_ _len175863_ _back175858_ _front175853_))
            (_E175828175838_)))))
  (define std/misc/deque#pop-back!__0
    (lambda (_dq175868_)
      (let ((_default175870_ absent-obj))
        (std/misc/deque#pop-back!__% _dq175868_ _default175870_))))
  (define std/misc/deque#pop-back!
    (lambda _g176283_
      (let ((_g176282_ (length _g176283_)))
        (cond ((##fx= _g176282_ 1)
               (apply std/misc/deque#pop-back!__0 _g176283_))
              ((##fx= _g176282_ 2)
               (apply std/misc/deque#pop-back!__% _g176283_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/misc/deque#pop-back!
                _g176283_))))))
  (define std/misc/deque#peek-front__%
    (lambda (_dq175788_ _default175789_)
      (let* ((_dq175790175796_ _dq175788_)
             (_E175792175800_
              (lambda () (error '"No clause matching" _dq175790175796_)))
             (_K175793175805_
              (lambda (_front175803_)
                (if _front175803_
                    (##unchecked-structure-ref
                     _front175803_
                     '1
                     std/misc/deque#node::t
                     '#f)
                    (if (eq? _default175789_ absent-obj)
                        (error '"Cannot peek; empty deque")
                        _default175789_)))))
        (if (##structure-direct-instance-of?
             _dq175790175796_
             'std/misc/deque#deque::t)
            (let* ((_e175794175808_ (##vector-ref _dq175790175796_ '1))
                   (_front175811_ _e175794175808_))
              (_K175793175805_ _front175811_))
            (_E175792175800_)))))
  (define std/misc/deque#peek-front__0
    (lambda (_dq175816_)
      (let ((_default175818_ absent-obj))
        (std/misc/deque#peek-front__% _dq175816_ _default175818_))))
  (define std/misc/deque#peek-front
    (lambda _g176285_
      (let ((_g176284_ (length _g176285_)))
        (cond ((##fx= _g176284_ 1)
               (apply std/misc/deque#peek-front__0 _g176285_))
              ((##fx= _g176284_ 2)
               (apply std/misc/deque#peek-front__% _g176285_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/misc/deque#peek-front
                _g176285_))))))
  (define std/misc/deque#peek-back__%
    (lambda (_dq175748_ _default175749_)
      (let* ((_dq175750175757_ _dq175748_)
             (_E175752175761_
              (lambda () (error '"No clause matching" _dq175750175757_)))
             (_K175753175766_
              (lambda (_back175764_)
                (if _back175764_
                    (##unchecked-structure-ref
                     _back175764_
                     '1
                     std/misc/deque#node::t
                     '#f)
                    (if (eq? _default175749_ absent-obj)
                        (error '"Cannot peek; empty deque")
                        _default175749_)))))
        (if (##structure-direct-instance-of?
             _dq175750175757_
             'std/misc/deque#deque::t)
            (let* ((_e175754175769_ (##vector-ref _dq175750175757_ '1))
                   (_e175755175772_ (##vector-ref _dq175750175757_ '2))
                   (_back175775_ _e175755175772_))
              (_K175753175766_ _back175775_))
            (_E175752175761_)))))
  (define std/misc/deque#peek-back__0
    (lambda (_dq175780_)
      (let ((_default175782_ absent-obj))
        (std/misc/deque#peek-back__% _dq175780_ _default175782_))))
  (define std/misc/deque#peek-back
    (lambda _g176287_
      (let ((_g176286_ (length _g176287_)))
        (cond ((##fx= _g176286_ 1)
               (apply std/misc/deque#peek-back__0 _g176287_))
              ((##fx= _g176286_ 2)
               (apply std/misc/deque#peek-back__% _g176287_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/misc/deque#peek-back
                _g176287_))))))
  (define std/misc/deque#deque->list
    (lambda (_dq175714_)
      (let* ((_dq175715175722_ _dq175714_)
             (_E175717175726_
              (lambda () (error '"No clause matching" _dq175715175722_)))
             (_K175718175736_
              (lambda (_back175729_)
                (let _lp175731_ ((_n175733_ _back175729_) (_r175734_ '()))
                  (if _n175733_
                      (_lp175731_
                       (##unchecked-structure-ref
                        _n175733_
                        '2
                        std/misc/deque#node::t
                        '#f)
                       (cons (##unchecked-structure-ref
                              _n175733_
                              '1
                              std/misc/deque#node::t
                              '#f)
                             _r175734_))
                      _r175734_)))))
        (if (##structure-direct-instance-of?
             _dq175715175722_
             'std/misc/deque#deque::t)
            (let* ((_e175719175739_ (##vector-ref _dq175715175722_ '1))
                   (_e175720175742_ (##vector-ref _dq175715175722_ '2))
                   (_back175745_ _e175720175742_))
              (_K175718175736_ _back175745_))
            (_E175717175726_))))))
