(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 _$args950_
      (apply make-struct-instance std/misc/deque#node::t _$args950_)))
  (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 (_self947_ _e948_)
      (if (##fx< '1 (##vector-length _self947_))
          (##vector-set! _self947_ '1 _e948_)
          (error '"struct-instance-init!: too many arguments for struct"
                 _self947_))))
  (bind-method! std/misc/deque#node::t ':init! std/misc/deque#node:::init! '#f)
  (define std/misc/deque#make-node/prev
    (lambda (_e820_ _prev821_)
      (let ((_new823_
             (let ((__obj4550 (make-object std/misc/deque#node::t '3)))
               (if (##fx< '1 (##vector-length __obj4550))
                   (##vector-set! __obj4550 '1 _e820_)
                   (error '"struct-instance-init!: too many arguments for struct"
                          __obj4550))
               __obj4550)))
        (##unchecked-structure-set!
         _new823_
         _prev821_
         '2
         std/misc/deque#node::t
         '#f)
        (##unchecked-structure-set!
         _prev821_
         _new823_
         '3
         std/misc/deque#node::t
         '#f)
        _new823_)))
  (define std/misc/deque#make-node/next
    (lambda (_e815_ _next816_)
      (let ((_new818_
             (let ((__obj4551 (make-object std/misc/deque#node::t '3)))
               (if (##fx< '1 (##vector-length __obj4551))
                   (##vector-set! __obj4551 '1 _e815_)
                   (error '"struct-instance-init!: too many arguments for struct"
                          __obj4551))
               __obj4551)))
        (##unchecked-structure-set!
         _new818_
         _next816_
         '3
         std/misc/deque#node::t
         '#f)
        (##unchecked-structure-set!
         _next816_
         _new818_
         '2
         std/misc/deque#node::t
         '#f)
        _new818_)))
  (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 _$args812_
      (apply make-struct-instance std/misc/deque#deque::t _$args812_)))
  (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 (_self810_)
      (if (##fx< '3 (##vector-length _self810_))
          (begin
            (##vector-set! _self810_ '1 '#f)
            (##vector-set! _self810_ '2 '#f)
            (##vector-set! _self810_ '3 '0))
          (error '"struct-instance-init!: too many arguments for struct"
                 _self810_))))
  (bind-method!
   std/misc/deque#deque::t
   ':init!
   std/misc/deque#deque:::init!
   '#f)
  (define std/misc/deque#deque-empty?
    (lambda (_dq684_)
      (zero? (##unchecked-structure-ref
              _dq684_
              '3
              std/misc/deque#deque::t
              '#f))))
  (define std/misc/deque#push-front!
    (lambda (_dq643_ _v644_)
      (let* ((_dq645653_ _dq643_)
             (_E647657_ (lambda () (error '"No clause matching" _dq645653_)))
             (_K648666_
              (lambda (_len660_ _back661_ _front662_)
                (let ((_new664_
                       (if _front662_
                           (std/misc/deque#make-node/next _v644_ _front662_)
                           (let ((__obj4552
                                  (make-object std/misc/deque#node::t '3)))
                             (if (##fx< '1 (##vector-length __obj4552))
                                 (##vector-set! __obj4552 '1 _v644_)
                                 (error '"struct-instance-init!: too many arguments for struct"
                                        __obj4552))
                             __obj4552))))
                  (##unchecked-structure-set!
                   _dq643_
                   _new664_
                   '1
                   std/misc/deque#deque::t
                   '#f)
                  (if _back661_
                      '#!void
                      (##unchecked-structure-set!
                       _dq643_
                       _new664_
                       '2
                       std/misc/deque#deque::t
                       '#f))
                  (##unchecked-structure-set!
                   _dq643_
                   (+ _len660_ '1)
                   '3
                   std/misc/deque#deque::t
                   '#f)))))
        (if (##structure-direct-instance-of?
             _dq645653_
             'std/misc/deque#deque::t)
            (let* ((_e649669_ (##vector-ref _dq645653_ '1))
                   (_front672_ _e649669_)
                   (_e650674_ (##vector-ref _dq645653_ '2))
                   (_back677_ _e650674_)
                   (_e651679_ (##vector-ref _dq645653_ '3))
                   (_len682_ _e651679_))
              (_K648666_ _len682_ _back677_ _front672_))
            (_E647657_)))))
  (define std/misc/deque#push-back!
    (lambda (_dq602_ _v603_)
      (let* ((_dq604612_ _dq602_)
             (_E606616_ (lambda () (error '"No clause matching" _dq604612_)))
             (_K607625_
              (lambda (_len619_ _back620_ _front621_)
                (let ((_new623_
                       (if _back620_
                           (std/misc/deque#make-node/prev _v603_ _back620_)
                           (let ((__obj4553
                                  (make-object std/misc/deque#node::t '3)))
                             (if (##fx< '1 (##vector-length __obj4553))
                                 (##vector-set! __obj4553 '1 _v603_)
                                 (error '"struct-instance-init!: too many arguments for struct"
                                        __obj4553))
                             __obj4553))))
                  (##unchecked-structure-set!
                   _dq602_
                   _new623_
                   '2
                   std/misc/deque#deque::t
                   '#f)
                  (if _front621_
                      '#!void
                      (##unchecked-structure-set!
                       _dq602_
                       _new623_
                       '1
                       std/misc/deque#deque::t
                       '#f))
                  (##unchecked-structure-set!
                   _dq602_
                   (+ _len619_ '1)
                   '3
                   std/misc/deque#deque::t
                   '#f)))))
        (if (##structure-direct-instance-of?
             _dq604612_
             'std/misc/deque#deque::t)
            (let* ((_e608628_ (##vector-ref _dq604612_ '1))
                   (_front631_ _e608628_)
                   (_e609633_ (##vector-ref _dq604612_ '2))
                   (_back636_ _e609633_)
                   (_e610638_ (##vector-ref _dq604612_ '3))
                   (_len641_ _e610638_))
              (_K607625_ _len641_ _back636_ _front631_))
            (_E606616_)))))
  (define std/misc/deque#pop-front!__%
    (lambda (_dq551_ _default552_)
      (let* ((_dq553561_ _dq551_)
             (_E555565_ (lambda () (error '"No clause matching" _dq553561_)))
             (_K556574_
              (lambda (_len568_ _back569_ _front570_)
                (if _front570_
                    (let ((_next572_
                           (##unchecked-structure-ref
                            _front570_
                            '3
                            std/misc/deque#node::t
                            '#f)))
                      (##unchecked-structure-set!
                       _dq551_
                       _next572_
                       '1
                       std/misc/deque#deque::t
                       '#f)
                      (if _next572_
                          (##unchecked-structure-set!
                           _next572_
                           '#f
                           '2
                           std/misc/deque#node::t
                           '#f)
                          (##unchecked-structure-set!
                           _dq551_
                           '#f
                           '2
                           std/misc/deque#deque::t
                           '#f))
                      (##unchecked-structure-set!
                       _dq551_
                       (- _len568_ '1)
                       '3
                       std/misc/deque#deque::t
                       '#f)
                      (##unchecked-structure-ref
                       _front570_
                       '1
                       std/misc/deque#node::t
                       '#f))
                    (if (eq? _default552_ absent-obj)
                        (error '"Cannot pop; empty deque" _dq551_)
                        _default552_)))))
        (if (##structure-direct-instance-of?
             _dq553561_
             'std/misc/deque#deque::t)
            (let* ((_e557577_ (##vector-ref _dq553561_ '1))
                   (_front580_ _e557577_)
                   (_e558582_ (##vector-ref _dq553561_ '2))
                   (_back585_ _e558582_)
                   (_e559587_ (##vector-ref _dq553561_ '3))
                   (_len590_ _e559587_))
              (_K556574_ _len590_ _back585_ _front580_))
            (_E555565_)))))
  (define std/misc/deque#pop-front!__0
    (lambda (_dq595_)
      (let ((_default597_ absent-obj))
        (std/misc/deque#pop-front!__% _dq595_ _default597_))))
  (define std/misc/deque#pop-front!
    (lambda _g4555_
      (let ((_g4554_ (##length _g4555_)))
        (cond ((##fx= _g4554_ 1) (apply std/misc/deque#pop-front!__0 _g4555_))
              ((##fx= _g4554_ 2) (apply std/misc/deque#pop-front!__% _g4555_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/misc/deque#pop-front!
                _g4555_))))))
  (define std/misc/deque#pop-back!__%
    (lambda (_dq499_ _default500_)
      (let* ((_dq501509_ _dq499_)
             (_E503513_ (lambda () (error '"No clause matching" _dq501509_)))
             (_K504522_
              (lambda (_len516_ _back517_ _front518_)
                (if _back517_
                    (let ((_prev520_
                           (##unchecked-structure-ref
                            _back517_
                            '2
                            std/misc/deque#node::t
                            '#f)))
                      (##unchecked-structure-set!
                       _dq499_
                       _prev520_
                       '2
                       std/misc/deque#deque::t
                       '#f)
                      (if _prev520_
                          (##unchecked-structure-set!
                           _prev520_
                           '#f
                           '3
                           std/misc/deque#node::t
                           '#f)
                          (##unchecked-structure-set!
                           _dq499_
                           '#f
                           '1
                           std/misc/deque#deque::t
                           '#f))
                      (##unchecked-structure-set!
                       _dq499_
                       (- _len516_ '1)
                       '3
                       std/misc/deque#deque::t
                       '#f)
                      (##unchecked-structure-ref
                       _back517_
                       '1
                       std/misc/deque#node::t
                       '#f))
                    (if (eq? _default500_ absent-obj)
                        (error '"Cannot pop; empty deque" _dq499_)
                        _default500_)))))
        (if (##structure-direct-instance-of?
             _dq501509_
             'std/misc/deque#deque::t)
            (let* ((_e505525_ (##vector-ref _dq501509_ '1))
                   (_front528_ _e505525_)
                   (_e506530_ (##vector-ref _dq501509_ '2))
                   (_back533_ _e506530_)
                   (_e507535_ (##vector-ref _dq501509_ '3))
                   (_len538_ _e507535_))
              (_K504522_ _len538_ _back533_ _front528_))
            (_E503513_)))))
  (define std/misc/deque#pop-back!__0
    (lambda (_dq543_)
      (let ((_default545_ absent-obj))
        (std/misc/deque#pop-back!__% _dq543_ _default545_))))
  (define std/misc/deque#pop-back!
    (lambda _g4557_
      (let ((_g4556_ (##length _g4557_)))
        (cond ((##fx= _g4556_ 1) (apply std/misc/deque#pop-back!__0 _g4557_))
              ((##fx= _g4556_ 2) (apply std/misc/deque#pop-back!__% _g4557_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/misc/deque#pop-back!
                _g4557_))))))
  (define std/misc/deque#peek-front__%
    (lambda (_dq463_ _default464_)
      (let* ((_dq465471_ _dq463_)
             (_E467475_ (lambda () (error '"No clause matching" _dq465471_)))
             (_K468480_
              (lambda (_front478_)
                (if _front478_
                    (##unchecked-structure-ref
                     _front478_
                     '1
                     std/misc/deque#node::t
                     '#f)
                    (if (eq? _default464_ absent-obj)
                        (error '"Cannot peek; empty deque")
                        _default464_)))))
        (if (##structure-direct-instance-of?
             _dq465471_
             'std/misc/deque#deque::t)
            (let* ((_e469483_ (##vector-ref _dq465471_ '1))
                   (_front486_ _e469483_))
              (_K468480_ _front486_))
            (_E467475_)))))
  (define std/misc/deque#peek-front__0
    (lambda (_dq491_)
      (let ((_default493_ absent-obj))
        (std/misc/deque#peek-front__% _dq491_ _default493_))))
  (define std/misc/deque#peek-front
    (lambda _g4559_
      (let ((_g4558_ (##length _g4559_)))
        (cond ((##fx= _g4558_ 1) (apply std/misc/deque#peek-front__0 _g4559_))
              ((##fx= _g4558_ 2) (apply std/misc/deque#peek-front__% _g4559_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/misc/deque#peek-front
                _g4559_))))))
  (define std/misc/deque#peek-back__%
    (lambda (_dq423_ _default424_)
      (let* ((_dq425432_ _dq423_)
             (_E427436_ (lambda () (error '"No clause matching" _dq425432_)))
             (_K428441_
              (lambda (_back439_)
                (if _back439_
                    (##unchecked-structure-ref
                     _back439_
                     '1
                     std/misc/deque#node::t
                     '#f)
                    (if (eq? _default424_ absent-obj)
                        (error '"Cannot peek; empty deque")
                        _default424_)))))
        (if (##structure-direct-instance-of?
             _dq425432_
             'std/misc/deque#deque::t)
            (let* ((_e429444_ (##vector-ref _dq425432_ '1))
                   (_e430447_ (##vector-ref _dq425432_ '2))
                   (_back450_ _e430447_))
              (_K428441_ _back450_))
            (_E427436_)))))
  (define std/misc/deque#peek-back__0
    (lambda (_dq455_)
      (let ((_default457_ absent-obj))
        (std/misc/deque#peek-back__% _dq455_ _default457_))))
  (define std/misc/deque#peek-back
    (lambda _g4561_
      (let ((_g4560_ (##length _g4561_)))
        (cond ((##fx= _g4560_ 1) (apply std/misc/deque#peek-back__0 _g4561_))
              ((##fx= _g4560_ 2) (apply std/misc/deque#peek-back__% _g4561_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/misc/deque#peek-back
                _g4561_))))))
  (define std/misc/deque#deque->list
    (lambda (_dq389_)
      (let* ((_dq390397_ _dq389_)
             (_E392401_ (lambda () (error '"No clause matching" _dq390397_)))
             (_K393411_
              (lambda (_back404_)
                (let _lp406_ ((_n408_ _back404_) (_r409_ '()))
                  (if _n408_
                      (_lp406_ (##unchecked-structure-ref
                                _n408_
                                '2
                                std/misc/deque#node::t
                                '#f)
                               (cons (##unchecked-structure-ref
                                      _n408_
                                      '1
                                      std/misc/deque#node::t
                                      '#f)
                                     _r409_))
                      _r409_)))))
        (if (##structure-direct-instance-of?
             _dq390397_
             'std/misc/deque#deque::t)
            (let* ((_e394414_ (##vector-ref _dq390397_ '1))
                   (_e395417_ (##vector-ref _dq390397_ '2))
                   (_back420_ _e395417_))
              (_K393411_ _back420_))
            (_E392401_))))))
