(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/srfi/134#<ideque>
    (make-struct-type
     'std/srfi/134#<ideque>
     '#f
     '4
     '<ideque>
     '((fields: lenf f lenr r))
     '#f))
  (define std/srfi/134#ideque? (make-struct-predicate std/srfi/134#<ideque>))
  (define std/srfi/134#dq-lenf
    (make-struct-field-accessor std/srfi/134#<ideque> '0))
  (define std/srfi/134#dq-f
    (make-struct-field-accessor std/srfi/134#<ideque> '1))
  (define std/srfi/134#dq-lenr
    (make-struct-field-accessor std/srfi/134#<ideque> '2))
  (define std/srfi/134#dq-r
    (make-struct-field-accessor std/srfi/134#<ideque> '3))
  (define std/srfi/134#%make-dq
    (lambda (_lenf694_ _f695_ _lenr696_ _r697_)
      (make-struct-instance
       std/srfi/134#<ideque>
       _lenf694_
       _f695_
       _lenr696_
       _r697_)))
  (define std/srfi/134#*empty*
    (let ()
      (declare (not safe))
      (##structure std/srfi/134#<ideque> '0 '() '0 '())))
  (define std/srfi/134#%check-ideque
    (lambda (_x692_)
      (if (let ()
            (declare (not safe))
            (##structure-instance-of? _x692_ 'std/srfi/134#<ideque>))
          '#!void
          (error '"ideque expected, but got:" _x692_))))
  (define std/srfi/134#ideque
    (lambda _args690_ (std/srfi/134#list->ideque _args690_)))
  (define std/srfi/134#ideque-tabulate
    (lambda (_size678_ _init679_)
      (let ((_lenf681_ (quotient _size678_ '2))
            (_lenr682_ (quotient (+ _size678_ '1) '2)))
        (let ((__tmp4298 (std/srfi/1#list-tabulate _lenf681_ _init679_))
              (__tmp4297
               (std/srfi/1#unfold
                (lambda (_n684_) (= _n684_ _lenr682_))
                (lambda (_n686_) (_init679_ (- _size678_ _n686_ '1)))
                (lambda (_n688_) (+ _n688_ '1))
                '0)))
          (declare (not safe))
          (##structure
           std/srfi/134#<ideque>
           _lenf681_
           __tmp4298
           _lenr682_
           __tmp4297)))))
  (define std/srfi/134#ideque-unfold
    (lambda (_p673_ _f674_ _g675_ _seed676_)
      (std/srfi/134#list->ideque
       (std/srfi/1#unfold _p673_ _f674_ _g675_ _seed676_))))
  (define std/srfi/134#ideque-unfold-right
    (lambda (_p668_ _f669_ _g670_ _seed671_)
      (std/srfi/134#list->ideque
       (std/srfi/1#unfold-right _p668_ _f669_ _g670_ _seed671_))))
  (define std/srfi/134#C '3)
  (define std/srfi/134#check
    (lambda (_lenf645_ _f646_ _lenr647_ _r648_)
      (if (> _lenf645_ (+ (* _lenr647_ std/srfi/134#C) '1))
          (let* ((_i650_ (quotient (+ _lenf645_ _lenr647_) '2))
                 (_j652_ (- (+ _lenf645_ _lenr647_) _i650_))
                 (_f.654_ (std/srfi/1#take _f646_ _i650_))
                 (_r.656_ (append _r648_
                                  (reverse (std/srfi/1#drop _f646_ _i650_)))))
            (let ()
              (declare (not safe))
              (##structure
               std/srfi/134#<ideque>
               _i650_
               _f.654_
               _j652_
               _r.656_)))
          (if (> _lenr647_ (+ (* _lenf645_ std/srfi/134#C) '1))
              (let* ((_j659_ (quotient (+ _lenf645_ _lenr647_) '2))
                     (_i661_ (- (+ _lenf645_ _lenr647_) _j659_))
                     (_r.663_ (std/srfi/1#take _r648_ _j659_))
                     (_f.665_ (append _f646_
                                      (reverse (std/srfi/1#drop
                                                _r648_
                                                _j659_)))))
                (let ()
                  (declare (not safe))
                  (##structure
                   std/srfi/134#<ideque>
                   _i661_
                   _f.665_
                   _j659_
                   _r.663_)))
              (let ()
                (declare (not safe))
                (##structure
                 std/srfi/134#<ideque>
                 _lenf645_
                 _f646_
                 _lenr647_
                 _r648_))))))
  (define std/srfi/134#ideque-empty?
    (lambda (_dq643_)
      (std/srfi/134#%check-ideque _dq643_)
      (if (zero? (##structure-ref _dq643_ '1 std/srfi/134#<ideque> '#f))
          (zero? (##structure-ref _dq643_ '3 std/srfi/134#<ideque> '#f))
          '#f)))
  (define std/srfi/134#ideque-add-front
    (lambda (_dq640_ _x641_)
      (std/srfi/134#%check-ideque _dq640_)
      (std/srfi/134#check
       (+ (##structure-ref _dq640_ '1 std/srfi/134#<ideque> '#f) '1)
       (cons _x641_ (##structure-ref _dq640_ '2 std/srfi/134#<ideque> '#f))
       (##structure-ref _dq640_ '3 std/srfi/134#<ideque> '#f)
       (##structure-ref _dq640_ '4 std/srfi/134#<ideque> '#f))))
  (define std/srfi/134#ideque-front
    (lambda (_dq638_)
      (std/srfi/134#%check-ideque _dq638_)
      (if (zero? (##structure-ref _dq638_ '1 std/srfi/134#<ideque> '#f))
          (if (zero? (##structure-ref _dq638_ '3 std/srfi/134#<ideque> '#f))
              (error '"Empty deque:" _dq638_)
              (car (##structure-ref _dq638_ '4 std/srfi/134#<ideque> '#f)))
          (car (##structure-ref _dq638_ '2 std/srfi/134#<ideque> '#f)))))
  (define std/srfi/134#ideque-remove-front
    (lambda (_dq636_)
      (std/srfi/134#%check-ideque _dq636_)
      (if (zero? (##structure-ref _dq636_ '1 std/srfi/134#<ideque> '#f))
          (if (zero? (##structure-ref _dq636_ '3 std/srfi/134#<ideque> '#f))
              (error '"Empty deque:" _dq636_)
              std/srfi/134#*empty*)
          (std/srfi/134#check
           (- (##structure-ref _dq636_ '1 std/srfi/134#<ideque> '#f) '1)
           (cdr (##structure-ref _dq636_ '2 std/srfi/134#<ideque> '#f))
           (##structure-ref _dq636_ '3 std/srfi/134#<ideque> '#f)
           (##structure-ref _dq636_ '4 std/srfi/134#<ideque> '#f)))))
  (define std/srfi/134#ideque-add-back
    (lambda (_dq633_ _x634_)
      (std/srfi/134#%check-ideque _dq633_)
      (std/srfi/134#check
       (##structure-ref _dq633_ '1 std/srfi/134#<ideque> '#f)
       (##structure-ref _dq633_ '2 std/srfi/134#<ideque> '#f)
       (+ (##structure-ref _dq633_ '3 std/srfi/134#<ideque> '#f) '1)
       (cons _x634_ (##structure-ref _dq633_ '4 std/srfi/134#<ideque> '#f)))))
  (define std/srfi/134#ideque-back
    (lambda (_dq631_)
      (std/srfi/134#%check-ideque _dq631_)
      (if (zero? (##structure-ref _dq631_ '3 std/srfi/134#<ideque> '#f))
          (if (zero? (##structure-ref _dq631_ '1 std/srfi/134#<ideque> '#f))
              (error '"Empty deque:" _dq631_)
              (car (##structure-ref _dq631_ '2 std/srfi/134#<ideque> '#f)))
          (car (##structure-ref _dq631_ '4 std/srfi/134#<ideque> '#f)))))
  (define std/srfi/134#ideque-remove-back
    (lambda (_dq629_)
      (std/srfi/134#%check-ideque _dq629_)
      (if (zero? (##structure-ref _dq629_ '3 std/srfi/134#<ideque> '#f))
          (if (zero? (##structure-ref _dq629_ '1 std/srfi/134#<ideque> '#f))
              (error '"Empty deque:" _dq629_)
              std/srfi/134#*empty*)
          (std/srfi/134#check
           (##structure-ref _dq629_ '1 std/srfi/134#<ideque> '#f)
           (##structure-ref _dq629_ '2 std/srfi/134#<ideque> '#f)
           (- (##structure-ref _dq629_ '3 std/srfi/134#<ideque> '#f) '1)
           (cdr (##structure-ref _dq629_ '4 std/srfi/134#<ideque> '#f))))))
  (define std/srfi/134#ideque-reverse
    (lambda (_dq627_)
      (std/srfi/134#%check-ideque _dq627_)
      (if (std/srfi/134#ideque-empty? _dq627_)
          std/srfi/134#*empty*
          (let ((__tmp4302
                 (##structure-ref _dq627_ '3 std/srfi/134#<ideque> '#f))
                (__tmp4301
                 (##structure-ref _dq627_ '4 std/srfi/134#<ideque> '#f))
                (__tmp4300
                 (##structure-ref _dq627_ '1 std/srfi/134#<ideque> '#f))
                (__tmp4299
                 (##structure-ref _dq627_ '2 std/srfi/134#<ideque> '#f)))
            (declare (not safe))
            (##structure
             std/srfi/134#<ideque>
             __tmp4302
             __tmp4301
             __tmp4300
             __tmp4299)))))
  (define std/srfi/134#ideque=__0 (lambda (_elt=601_) '#t))
  (define std/srfi/134#ideque=__1
    (lambda (_elt=603_ _ideque604_)
      (std/srfi/134#%check-ideque _ideque604_)
      '#t))
  (define std/srfi/134#ideque=__2
    (lambda (_elt=606_ _dq1607_ _dq2608_)
      (std/srfi/134#%check-ideque _dq1607_)
      (std/srfi/134#%check-ideque _dq2608_)
      (let ((_$e610_ (eq? _dq1607_ _dq2608_)))
        (if _$e610_
            _$e610_
            (let ((_len1613_
                   (+ (##structure-ref _dq1607_ '1 std/srfi/134#<ideque> '#f)
                      (##structure-ref _dq1607_ '3 std/srfi/134#<ideque> '#f)))
                  (_len2614_
                   (+ (##structure-ref _dq2608_ '1 std/srfi/134#<ideque> '#f)
                      (##structure-ref
                       _dq2608_
                       '3
                       std/srfi/134#<ideque>
                       '#f))))
              (if (= _len1613_ _len2614_)
                  (let ((_g4303_ (std/srfi/134#list-prefix=
                                  _elt=606_
                                  (##structure-ref
                                   _dq1607_
                                   '2
                                   std/srfi/134#<ideque>
                                   '#f)
                                  (##structure-ref
                                   _dq2608_
                                   '2
                                   std/srfi/134#<ideque>
                                   '#f))))
                    (begin
                      (let ((_g4304_ (let ()
                                       (declare (not safe))
                                       (if (##values? _g4303_)
                                           (##vector-length _g4303_)
                                           1))))
                        (if (not (let ()
                                   (declare (not safe))
                                   (##fx= _g4304_ 3)))
                            (error "Context expects 3 values" _g4304_)))
                      (let ((_x616_ (let ()
                                      (declare (not safe))
                                      (##vector-ref _g4303_ 0)))
                            (_t1617_ (let ()
                                       (declare (not safe))
                                       (##vector-ref _g4303_ 1)))
                            (_t2618_ (let ()
                                       (declare (not safe))
                                       (##vector-ref _g4303_ 2))))
                        (if _x616_
                            (let ((_g4305_ (std/srfi/134#list-prefix=
                                            _elt=606_
                                            (##structure-ref
                                             _dq1607_
                                             '4
                                             std/srfi/134#<ideque>
                                             '#f)
                                            (##structure-ref
                                             _dq2608_
                                             '4
                                             std/srfi/134#<ideque>
                                             '#f))))
                              (begin
                                (let ((_g4306_ (let ()
                                                 (declare (not safe))
                                                 (if (##values? _g4305_)
                                                     (##vector-length _g4305_)
                                                     1))))
                                  (if (not (let ()
                                             (declare (not safe))
                                             (##fx= _g4306_ 3)))
                                      (error "Context expects 3 values"
                                             _g4306_)))
                                (let ((_y620_ (let ()
                                                (declare (not safe))
                                                (##vector-ref _g4305_ 0)))
                                      (_r1621_ (let ()
                                                 (declare (not safe))
                                                 (##vector-ref _g4305_ 1)))
                                      (_r2622_ (let ()
                                                 (declare (not safe))
                                                 (##vector-ref _g4305_ 2))))
                                  (if _y620_
                                      (if (null? _t1617_)
                                          (std/srfi/1#list=
                                           _elt=606_
                                           _t2618_
                                           (reverse _r1621_))
                                          (std/srfi/1#list=
                                           _elt=606_
                                           _t1617_
                                           (reverse _r2622_)))
                                      '#f))))
                            '#f))))
                  '#f))))))
  (define std/srfi/134#ideque=__3
    (lambda (_elt=624_ . _dqs625_)
      (apply std/srfi/1#list=
             _elt=624_
             (map std/srfi/134#ideque->list _dqs625_))))
  (define std/srfi/134#ideque=
    (lambda _g4308_
      (let ((_g4307_ (let () (declare (not safe)) (##length _g4308_))))
        (cond ((let () (declare (not safe)) (##fx= _g4307_ 1))
               (apply std/srfi/134#ideque=__0 _g4308_))
              ((let () (declare (not safe)) (##fx= _g4307_ 2))
               (apply std/srfi/134#ideque=__1 _g4308_))
              ((let () (declare (not safe)) (##fx= _g4307_ 3))
               (apply std/srfi/134#ideque=__2 _g4308_))
              ((let () (declare (not safe)) (##fx>= _g4307_ 1))
               (apply std/srfi/134#ideque=__3 _g4308_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/srfi/134#ideque=
                _g4308_))))))
  (define std/srfi/134#list-prefix=
    (lambda (_elt=589_ _a590_ _b591_)
      (let _loop593_ ((_a595_ _a590_) (_b596_ _b591_))
        (if (or (null? _a595_) (null? _b596_))
            (values '#t _a595_ _b596_)
            (if (_elt=589_ (car _a595_) (car _b596_))
                (_loop593_ (cdr _a595_) (cdr _b596_))
                (values '#f _a595_ _b596_))))))
  (define std/srfi/134#ideque-ref
    (lambda (_dq581_ _n582_)
      (std/srfi/134#%check-ideque _dq581_)
      (let ((_len584_
             (+ (##structure-ref _dq581_ '1 std/srfi/134#<ideque> '#f)
                (##structure-ref _dq581_ '3 std/srfi/134#<ideque> '#f))))
        (if (or (< _n582_ '0) (>= _n582_ _len584_))
            (error '"Index out of range:" _n582_)
            (if (< _n582_
                   (##structure-ref _dq581_ '1 std/srfi/134#<ideque> '#f))
                (list-ref
                 (##structure-ref _dq581_ '2 std/srfi/134#<ideque> '#f)
                 _n582_)
                (list-ref
                 (##structure-ref _dq581_ '4 std/srfi/134#<ideque> '#f)
                 (- _len584_ _n582_ '1)))))))
  (define std/srfi/134#%ideque-take
    (lambda (_dq573_ _n574_)
      (let ((_lenf576_ (##structure-ref _dq573_ '1 std/srfi/134#<ideque> '#f))
            (_f577_ (##structure-ref _dq573_ '2 std/srfi/134#<ideque> '#f)))
        (if (<= _n574_ _lenf576_)
            (std/srfi/134#check _n574_ (std/srfi/1#take _f577_ _n574_) '0 '())
            (let ((_lenr.579_ (- _n574_ _lenf576_)))
              (std/srfi/134#check
               _lenf576_
               _f577_
               _lenr.579_
               (std/srfi/1#take-right
                (##structure-ref _dq573_ '4 std/srfi/134#<ideque> '#f)
                _lenr.579_)))))))
  (define std/srfi/134#%ideque-drop
    (lambda (_dq563_ _n564_)
      (let ((_lenf566_ (##structure-ref _dq563_ '1 std/srfi/134#<ideque> '#f))
            (_f567_ (##structure-ref _dq563_ '2 std/srfi/134#<ideque> '#f))
            (_lenr568_ (##structure-ref _dq563_ '3 std/srfi/134#<ideque> '#f))
            (_r569_ (##structure-ref _dq563_ '4 std/srfi/134#<ideque> '#f)))
        (if (<= _n564_ _lenf566_)
            (std/srfi/134#check
             _n564_
             (std/srfi/1#drop _f567_ _n564_)
             _lenr568_
             _r569_)
            (let ((_lenr.571_ (- _lenr568_ (- _n564_ _lenf566_))))
              (std/srfi/134#check
               '0
               '()
               _lenr.571_
               (std/srfi/1#take _r569_ _lenr.571_)))))))
  (define std/srfi/134#%check-length
    (lambda (_dq560_ _n561_)
      (if (<= '0 _n561_ (- (std/srfi/134#ideque-length _dq560_) '1))
          '#!void
          (error '"argument is out of range:" _n561_))))
  (define std/srfi/134#ideque-take
    (lambda (_dq557_ _n558_)
      (std/srfi/134#%check-ideque _dq557_)
      (std/srfi/134#%check-length _dq557_ _n558_)
      (std/srfi/134#%ideque-take _dq557_ _n558_)))
  (define std/srfi/134#ideque-take-right
    (lambda (_dq554_ _n555_)
      (std/srfi/134#%check-ideque _dq554_)
      (std/srfi/134#%check-length _dq554_ _n555_)
      (std/srfi/134#%ideque-drop
       _dq554_
       (- (std/srfi/134#ideque-length _dq554_) _n555_))))
  (define std/srfi/134#ideque-drop
    (lambda (_dq551_ _n552_)
      (std/srfi/134#%check-ideque _dq551_)
      (std/srfi/134#%check-length _dq551_ _n552_)
      (std/srfi/134#%ideque-drop _dq551_ _n552_)))
  (define std/srfi/134#ideque-drop-right
    (lambda (_dq548_ _n549_)
      (std/srfi/134#%check-ideque _dq548_)
      (std/srfi/134#%check-length _dq548_ _n549_)
      (std/srfi/134#%ideque-take
       _dq548_
       (- (std/srfi/134#ideque-length _dq548_) _n549_))))
  (define std/srfi/134#ideque-split-at
    (lambda (_dq545_ _n546_)
      (std/srfi/134#%check-ideque _dq545_)
      (std/srfi/134#%check-length _dq545_ _n546_)
      (values (std/srfi/134#%ideque-take _dq545_ _n546_)
              (std/srfi/134#%ideque-drop _dq545_ _n546_))))
  (define std/srfi/134#ideque-length
    (lambda (_dq543_)
      (std/srfi/134#%check-ideque _dq543_)
      (+ (##structure-ref _dq543_ '1 std/srfi/134#<ideque> '#f)
         (##structure-ref _dq543_ '3 std/srfi/134#<ideque> '#f))))
  (define std/srfi/134#ideque-append
    (lambda _dqs541_
      (std/srfi/134#list->ideque
       (std/srfi/1#concatenate (map std/srfi/134#ideque->list _dqs541_)))))
  (define std/srfi/134#ideque-count
    (lambda (_pred538_ _dq539_)
      (std/srfi/134#%check-ideque _dq539_)
      (+ (std/srfi/1#count
          _pred538_
          (##structure-ref _dq539_ '2 std/srfi/134#<ideque> '#f))
         (std/srfi/1#count
          _pred538_
          (##structure-ref _dq539_ '4 std/srfi/134#<ideque> '#f)))))
  (define std/srfi/134#ideque-zip
    (lambda (_dq533_ . _dqs534_)
      (let ((_elts536_
             (apply std/srfi/1#zip
                    (std/srfi/134#ideque->list _dq533_)
                    (map std/srfi/134#ideque->list _dqs534_))))
        (std/srfi/134#check (length _elts536_) _elts536_ '0 '()))))
  (define std/srfi/134#ideque-map
    (lambda (_proc530_ _dq531_)
      (std/srfi/134#%check-ideque _dq531_)
      (let ((__tmp4312 (##structure-ref _dq531_ '1 std/srfi/134#<ideque> '#f))
            (__tmp4311
             (map _proc530_
                  (##structure-ref _dq531_ '2 std/srfi/134#<ideque> '#f)))
            (__tmp4310 (##structure-ref _dq531_ '3 std/srfi/134#<ideque> '#f))
            (__tmp4309
             (map _proc530_
                  (##structure-ref _dq531_ '4 std/srfi/134#<ideque> '#f))))
        (declare (not safe))
        (##structure
         std/srfi/134#<ideque>
         __tmp4312
         __tmp4311
         __tmp4310
         __tmp4309))))
  (define std/srfi/134#ideque-filter-map
    (lambda (_proc524_ _dq525_)
      (std/srfi/134#%check-ideque _dq525_)
      (let ((_f527_ (filter-map1
                     _proc524_
                     (##structure-ref _dq525_ '2 std/srfi/134#<ideque> '#f)))
            (_r528_ (filter-map1
                     _proc524_
                     (##structure-ref _dq525_ '4 std/srfi/134#<ideque> '#f))))
        (std/srfi/134#check (length _f527_) _f527_ (length _r528_) _r528_))))
  (define std/srfi/134#ideque-for-each
    (lambda (_proc521_ _dq522_)
      (std/srfi/134#%check-ideque _dq522_)
      (for-each
       _proc521_
       (##structure-ref _dq522_ '2 std/srfi/134#<ideque> '#f))
      (for-each
       _proc521_
       (reverse (##structure-ref _dq522_ '4 std/srfi/134#<ideque> '#f)))))
  (define std/srfi/134#ideque-for-each-right
    (lambda (_proc518_ _dq519_)
      (std/srfi/134#%check-ideque _dq519_)
      (for-each
       _proc518_
       (##structure-ref _dq519_ '4 std/srfi/134#<ideque> '#f))
      (for-each
       _proc518_
       (reverse (##structure-ref _dq519_ '2 std/srfi/134#<ideque> '#f)))))
  (define std/srfi/134#ideque-fold
    (lambda (_proc514_ _knil515_ _dq516_)
      (std/srfi/134#%check-ideque _dq516_)
      (foldl1 _proc514_
              (foldl1 _proc514_
                      _knil515_
                      (##structure-ref _dq516_ '2 std/srfi/134#<ideque> '#f))
              (reverse (##structure-ref
                        _dq516_
                        '4
                        std/srfi/134#<ideque>
                        '#f)))))
  (define std/srfi/134#ideque-fold-right
    (lambda (_proc510_ _knil511_ _dq512_)
      (std/srfi/134#%check-ideque _dq512_)
      (foldr1 _proc510_
              (foldr1 _proc510_
                      _knil511_
                      (reverse (##structure-ref
                                _dq512_
                                '4
                                std/srfi/134#<ideque>
                                '#f)))
              (##structure-ref _dq512_ '2 std/srfi/134#<ideque> '#f))))
  (define std/srfi/134#ideque-append-map
    (lambda (_proc507_ _dq508_)
      (std/srfi/134#list->ideque
       (std/srfi/1#append-map _proc507_ (std/srfi/134#ideque->list _dq508_)))))
  (define std/srfi/134#%ideque-filter-remove
    (lambda (_op500_ _pred501_ _dq502_)
      (std/srfi/134#%check-ideque _dq502_)
      (let ((_f504_ (_op500_ _pred501_
                             (##structure-ref
                              _dq502_
                              '2
                              std/srfi/134#<ideque>
                              '#f)))
            (_r505_ (_op500_ _pred501_
                             (##structure-ref
                              _dq502_
                              '4
                              std/srfi/134#<ideque>
                              '#f))))
        (std/srfi/134#check (length _f504_) _f504_ (length _r505_) _r505_))))
  (define std/srfi/134#ideque-filter
    (lambda (_pred497_ _dq498_)
      (std/srfi/134#%ideque-filter-remove filter _pred497_ _dq498_)))
  (define std/srfi/134#ideque-remove
    (lambda (_pred494_ _dq495_)
      (std/srfi/134#%ideque-filter-remove
       std/srfi/1#remove
       _pred494_
       _dq495_)))
  (define std/srfi/134#ideque-partition
    (lambda (_pred485_ _dq486_)
      (std/srfi/134#%check-ideque _dq486_)
      (let ((_g4313_ (std/srfi/1#partition
                      _pred485_
                      (##structure-ref _dq486_ '2 std/srfi/134#<ideque> '#f))))
        (begin
          (let ((_g4314_ (let ()
                           (declare (not safe))
                           (if (##values? _g4313_)
                               (##vector-length _g4313_)
                               1))))
            (if (not (let () (declare (not safe)) (##fx= _g4314_ 2)))
                (error "Context expects 2 values" _g4314_)))
          (let ((_f1488_ (let ()
                           (declare (not safe))
                           (##vector-ref _g4313_ 0)))
                (_f2489_ (let ()
                           (declare (not safe))
                           (##vector-ref _g4313_ 1))))
            (let ((_g4315_ (std/srfi/1#partition
                            _pred485_
                            (##structure-ref
                             _dq486_
                             '4
                             std/srfi/134#<ideque>
                             '#f))))
              (begin
                (let ((_g4316_ (let ()
                                 (declare (not safe))
                                 (if (##values? _g4315_)
                                     (##vector-length _g4315_)
                                     1))))
                  (if (not (let () (declare (not safe)) (##fx= _g4316_ 2)))
                      (error "Context expects 2 values" _g4316_)))
                (let ((_r1491_ (let ()
                                 (declare (not safe))
                                 (##vector-ref _g4315_ 0)))
                      (_r2492_ (let ()
                                 (declare (not safe))
                                 (##vector-ref _g4315_ 1))))
                  (values (std/srfi/134#check
                           (length _f1488_)
                           _f1488_
                           (length _r1491_)
                           _r1491_)
                          (std/srfi/134#check
                           (length _f2489_)
                           _f2489_
                           (length _r2492_)
                           _r2492_))))))))))
  (define std/srfi/134#*not-found* (cons '#f '#f))
  (define std/srfi/134#%search
    (lambda (_pred471_ _seq1472_ _seq2473_ _failure474_)
      (letrec ((_seek476_
                (lambda (_pred482_ _s483_)
                  (if (null? _s483_)
                      std/srfi/134#*not-found*
                      (if (_pred482_ (car _s483_))
                          (car _s483_)
                          (_seek476_ _pred482_ (cdr _s483_)))))))
        (let ((_r478_ (_seek476_ _pred471_ _seq1472_)))
          (if (not (eq? _r478_ std/srfi/134#*not-found*))
              _r478_
              (let ((_r480_ (_seek476_ _pred471_ (reverse _seq2473_))))
                (if (not (eq? _r480_ std/srfi/134#*not-found*))
                    _r480_
                    (_failure474_))))))))
  (define std/srfi/134#ideque-find
    (lambda (_pred464_ _dq465_ . _opts466_)
      (std/srfi/134#%check-ideque _dq465_)
      (let ((_failure469_
             (if (pair? _opts466_) (car _opts466_) (lambda () '#f))))
        (std/srfi/134#%search
         _pred464_
         (##structure-ref _dq465_ '2 std/srfi/134#<ideque> '#f)
         (##structure-ref _dq465_ '4 std/srfi/134#<ideque> '#f)
         _failure469_))))
  (define std/srfi/134#ideque-find-right
    (lambda (_pred457_ _dq458_ . _opts459_)
      (std/srfi/134#%check-ideque _dq458_)
      (let ((_failure462_
             (if (pair? _opts459_) (car _opts459_) (lambda () '#f))))
        (std/srfi/134#%search
         _pred457_
         (##structure-ref _dq458_ '4 std/srfi/134#<ideque> '#f)
         (##structure-ref _dq458_ '2 std/srfi/134#<ideque> '#f)
         _failure462_))))
  (define std/srfi/134#ideque-take-while
    (lambda (_pred448_ _dq449_)
      (std/srfi/134#%check-ideque _dq449_)
      (let ((_g4317_ (std/srfi/1#span
                      _pred448_
                      (##structure-ref _dq449_ '2 std/srfi/134#<ideque> '#f))))
        (begin
          (let ((_g4318_ (let ()
                           (declare (not safe))
                           (if (##values? _g4317_)
                               (##vector-length _g4317_)
                               1))))
            (if (not (let () (declare (not safe)) (##fx= _g4318_ 2)))
                (error "Context expects 2 values" _g4318_)))
          (let ((_hd451_ (let ()
                           (declare (not safe))
                           (##vector-ref _g4317_ 0)))
                (_tl452_ (let ()
                           (declare (not safe))
                           (##vector-ref _g4317_ 1))))
            (if (null? _tl452_)
                (let ((_g4319_ (std/srfi/1#span
                                _pred448_
                                (reverse (##structure-ref
                                          _dq449_
                                          '4
                                          std/srfi/134#<ideque>
                                          '#f)))))
                  (begin
                    (let ((_g4320_ (let ()
                                     (declare (not safe))
                                     (if (##values? _g4319_)
                                         (##vector-length _g4319_)
                                         1))))
                      (if (not (let () (declare (not safe)) (##fx= _g4320_ 2)))
                          (error "Context expects 2 values" _g4320_)))
                    (let ((_hd.454_
                           (let ()
                             (declare (not safe))
                             (##vector-ref _g4319_ 0)))
                          (_tl.455_
                           (let ()
                             (declare (not safe))
                             (##vector-ref _g4319_ 1))))
                      (std/srfi/134#check
                       (##structure-ref _dq449_ '1 std/srfi/134#<ideque> '#f)
                       (##structure-ref _dq449_ '2 std/srfi/134#<ideque> '#f)
                       (length _hd.454_)
                       (reverse _hd.454_)))))
                (std/srfi/134#check (length _hd451_) _hd451_ '0 '())))))))
  (define std/srfi/134#ideque-take-while-right
    (lambda (_pred445_ _dq446_)
      (std/srfi/134#%check-ideque _dq446_)
      (std/srfi/134#ideque-reverse
       (std/srfi/134#ideque-take-while
        _pred445_
        (std/srfi/134#ideque-reverse _dq446_)))))
  (define std/srfi/134#ideque-drop-while
    (lambda (_pred436_ _dq437_)
      (std/srfi/134#%check-ideque _dq437_)
      (let ((_g4321_ (std/srfi/1#span
                      _pred436_
                      (##structure-ref _dq437_ '2 std/srfi/134#<ideque> '#f))))
        (begin
          (let ((_g4322_ (let ()
                           (declare (not safe))
                           (if (##values? _g4321_)
                               (##vector-length _g4321_)
                               1))))
            (if (not (let () (declare (not safe)) (##fx= _g4322_ 2)))
                (error "Context expects 2 values" _g4322_)))
          (let ((_hd439_ (let ()
                           (declare (not safe))
                           (##vector-ref _g4321_ 0)))
                (_tl440_ (let ()
                           (declare (not safe))
                           (##vector-ref _g4321_ 1))))
            (if (null? _tl440_)
                (let ((_g4323_ (std/srfi/1#span
                                _pred436_
                                (reverse (##structure-ref
                                          _dq437_
                                          '4
                                          std/srfi/134#<ideque>
                                          '#f)))))
                  (begin
                    (let ((_g4324_ (let ()
                                     (declare (not safe))
                                     (if (##values? _g4323_)
                                         (##vector-length _g4323_)
                                         1))))
                      (if (not (let () (declare (not safe)) (##fx= _g4324_ 2)))
                          (error "Context expects 2 values" _g4324_)))
                    (let ((_hd.442_
                           (let ()
                             (declare (not safe))
                             (##vector-ref _g4323_ 0)))
                          (_tl.443_
                           (let ()
                             (declare (not safe))
                             (##vector-ref _g4323_ 1))))
                      (std/srfi/134#check (length _tl.443_) _tl.443_ '0 '()))))
                (std/srfi/134#check
                 (length _tl440_)
                 _tl440_
                 (##structure-ref _dq437_ '3 std/srfi/134#<ideque> '#f)
                 (##structure-ref _dq437_ '4 std/srfi/134#<ideque> '#f))))))))
  (define std/srfi/134#ideque-drop-while-right
    (lambda (_pred433_ _dq434_)
      (std/srfi/134#%check-ideque _dq434_)
      (std/srfi/134#ideque-reverse
       (std/srfi/134#ideque-drop-while
        _pred433_
        (std/srfi/134#ideque-reverse _dq434_)))))
  (define std/srfi/134#%idq-span-break
    (lambda (_op423_ _pred424_ _dq425_)
      (std/srfi/134#%check-ideque _dq425_)
      (let ((_g4325_ (_op423_ _pred424_
                              (##structure-ref
                               _dq425_
                               '2
                               std/srfi/134#<ideque>
                               '#f))))
        (begin
          (let ((_g4326_ (let ()
                           (declare (not safe))
                           (if (##values? _g4325_)
                               (##vector-length _g4325_)
                               1))))
            (if (not (let () (declare (not safe)) (##fx= _g4326_ 2)))
                (error "Context expects 2 values" _g4326_)))
          (let ((_head427_
                 (let () (declare (not safe)) (##vector-ref _g4325_ 0)))
                (_tail428_
                 (let () (declare (not safe)) (##vector-ref _g4325_ 1))))
            (if (null? _tail428_)
                (let ((_g4327_ (_op423_ _pred424_
                                        (reverse (##structure-ref
                                                  _dq425_
                                                  '4
                                                  std/srfi/134#<ideque>
                                                  '#f)))))
                  (begin
                    (let ((_g4328_ (let ()
                                     (declare (not safe))
                                     (if (##values? _g4327_)
                                         (##vector-length _g4327_)
                                         1))))
                      (if (not (let () (declare (not safe)) (##fx= _g4328_ 2)))
                          (error "Context expects 2 values" _g4328_)))
                    (let ((_head.430_
                           (let ()
                             (declare (not safe))
                             (##vector-ref _g4327_ 0)))
                          (_tail.431_
                           (let ()
                             (declare (not safe))
                             (##vector-ref _g4327_ 1))))
                      (values (std/srfi/134#check
                               (length _head427_)
                               _head427_
                               (length _head.430_)
                               (reverse _head.430_))
                              (std/srfi/134#check
                               (length _tail.431_)
                               _tail.431_
                               '0
                               '())))))
                (values (std/srfi/134#check
                         (length _head427_)
                         _head427_
                         '0
                         '())
                        (std/srfi/134#check
                         (length _tail428_)
                         _tail428_
                         (##structure-ref _dq425_ '3 std/srfi/134#<ideque> '#f)
                         (##structure-ref
                          _dq425_
                          '4
                          std/srfi/134#<ideque>
                          '#f)))))))))
  (define std/srfi/134#ideque-span
    (lambda (_pred420_ _dq421_)
      (std/srfi/134#%idq-span-break std/srfi/1#span _pred420_ _dq421_)))
  (define std/srfi/134#ideque-break
    (lambda (_pred417_ _dq418_)
      (std/srfi/134#%idq-span-break std/srfi/1#break _pred417_ _dq418_)))
  (define std/srfi/134#ideque-any
    (lambda (_pred411_ _dq412_)
      (std/srfi/134#%check-ideque _dq412_)
      (if (null? (##structure-ref _dq412_ '4 std/srfi/134#<ideque> '#f))
          (std/srfi/1#any
           _pred411_
           (##structure-ref _dq412_ '2 std/srfi/134#<ideque> '#f))
          (let ((_$e414_ (std/srfi/1#any
                          _pred411_
                          (##structure-ref
                           _dq412_
                           '2
                           std/srfi/134#<ideque>
                           '#f))))
            (if _$e414_
                _$e414_
                (std/srfi/1#any
                 _pred411_
                 (reverse (##structure-ref
                           _dq412_
                           '4
                           std/srfi/134#<ideque>
                           '#f))))))))
  (define std/srfi/134#ideque-every
    (lambda (_pred408_ _dq409_)
      (std/srfi/134#%check-ideque _dq409_)
      (if (null? (##structure-ref _dq409_ '4 std/srfi/134#<ideque> '#f))
          (std/srfi/1#every
           _pred408_
           (##structure-ref _dq409_ '2 std/srfi/134#<ideque> '#f))
          (if (std/srfi/1#every
               _pred408_
               (##structure-ref _dq409_ '2 std/srfi/134#<ideque> '#f))
              (std/srfi/1#every
               _pred408_
               (reverse (##structure-ref
                         _dq409_
                         '4
                         std/srfi/134#<ideque>
                         '#f)))
              '#f))))
  (define std/srfi/134#ideque->list
    (lambda (_dq406_)
      (std/srfi/134#%check-ideque _dq406_)
      (append (##structure-ref _dq406_ '2 std/srfi/134#<ideque> '#f)
              (reverse (##structure-ref
                        _dq406_
                        '4
                        std/srfi/134#<ideque>
                        '#f)))))
  (define std/srfi/134#list->ideque
    (lambda (_lis404_) (std/srfi/134#check (length _lis404_) _lis404_ '0 '())))
  (define std/srfi/134#ideque->generator
    (lambda (_dq399_)
      (std/srfi/134#%check-ideque _dq399_)
      (lambda ()
        (if (std/srfi/134#ideque-empty? _dq399_)
            (eof-object)
            (let ((_v402_ (std/srfi/134#ideque-front _dq399_)))
              (set! _dq399_ (std/srfi/134#ideque-remove-front _dq399_))
              _v402_)))))
  (define std/srfi/134#generator->ideque
    (lambda (_gen397_)
      (std/srfi/134#list->ideque (std/srfi/121#generator->list__1 _gen397_)))))
