(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/srfi/101#kons::t
    (make-struct-type
     'std/srfi/101#kons::t
     '#f
     '3
     'kons
     '()
     '#f
     '(size tree rest)))
  (define std/srfi/101#kons? (make-struct-predicate std/srfi/101#kons::t))
  (define std/srfi/101#make-kons
    (lambda _$args838_
      (apply make-struct-instance std/srfi/101#kons::t _$args838_)))
  (define std/srfi/101#kons-size
    (make-struct-field-accessor std/srfi/101#kons::t '0))
  (define std/srfi/101#kons-tree
    (make-struct-field-accessor std/srfi/101#kons::t '1))
  (define std/srfi/101#kons-rest
    (make-struct-field-accessor std/srfi/101#kons::t '2))
  (define std/srfi/101#kons-size-set!
    (make-struct-field-mutator std/srfi/101#kons::t '0))
  (define std/srfi/101#kons-tree-set!
    (make-struct-field-mutator std/srfi/101#kons::t '1))
  (define std/srfi/101#kons-rest-set!
    (make-struct-field-mutator std/srfi/101#kons::t '2))
  (define std/srfi/101#node::t
    (make-struct-type
     'std/srfi/101#node::t
     '#f
     '3
     'node
     '()
     '#f
     '(val left right)))
  (define std/srfi/101#node? (make-struct-predicate std/srfi/101#node::t))
  (define std/srfi/101#make-node
    (lambda _$args835_
      (apply make-struct-instance std/srfi/101#node::t _$args835_)))
  (define std/srfi/101#node-val
    (make-struct-field-accessor std/srfi/101#node::t '0))
  (define std/srfi/101#node-left
    (make-struct-field-accessor std/srfi/101#node::t '1))
  (define std/srfi/101#node-right
    (make-struct-field-accessor std/srfi/101#node::t '2))
  (define std/srfi/101#node-val-set!
    (make-struct-field-mutator std/srfi/101#node::t '0))
  (define std/srfi/101#node-left-set!
    (make-struct-field-mutator std/srfi/101#node::t '1))
  (define std/srfi/101#node-right-set!
    (make-struct-field-mutator std/srfi/101#node::t '2))
  (define std/srfi/101#sub1 (lambda (_n833_) (- _n833_ '1)))
  (define std/srfi/101#add1 (lambda (_n831_) (+ _n831_ '1)))
  (define std/srfi/101#tree-val
    (lambda (_t829_)
      (if (let ()
            (declare (not safe))
            (##structure-instance-of? _t829_ 'std/srfi/101#node::t))
          (##structure-ref _t829_ '1 std/srfi/101#node::t '#f)
          _t829_)))
  (define std/srfi/101#tree-map
    (lambda (_f826_ _t827_)
      (if (let ()
            (declare (not safe))
            (##structure-instance-of? _t827_ 'std/srfi/101#node::t))
          (let ((__tmp4440
                 (_f826_ (##structure-ref _t827_ '1 std/srfi/101#node::t '#f)))
                (__tmp4439
                 (std/srfi/101#tree-map
                  _f826_
                  (##structure-ref _t827_ '2 std/srfi/101#node::t '#f)))
                (__tmp4438
                 (std/srfi/101#tree-map
                  _f826_
                  (##structure-ref _t827_ '3 std/srfi/101#node::t '#f))))
            (declare (not safe))
            (##structure std/srfi/101#node::t __tmp4440 __tmp4439 __tmp4438))
          (_f826_ _t827_))))
  (define std/srfi/101#tree-for-each
    (lambda (_f823_ _t824_)
      (if (let ()
            (declare (not safe))
            (##structure-instance-of? _t824_ 'std/srfi/101#node::t))
          (begin
            (_f823_ (##structure-ref _t824_ '1 std/srfi/101#node::t '#f))
            (std/srfi/101#tree-for-each
             _f823_
             (##structure-ref _t824_ '2 std/srfi/101#node::t '#f))
            (std/srfi/101#tree-for-each
             _f823_
             (##structure-ref _t824_ '3 std/srfi/101#node::t '#f)))
          (_f823_ _t824_))))
  (define std/srfi/101#tree-map/n
    (lambda (_f816_ _ts817_)
      (let _recr819_ ((_ts821_ _ts817_))
        (if (and (pair? _ts821_)
                 (let ((__tmp4441 (car _ts821_)))
                   (declare (not safe))
                   (##structure-instance-of? __tmp4441 'std/srfi/101#node::t)))
            (let ((__tmp4444
                   (apply _f816_ (map std/srfi/101#node-val _ts821_)))
                  (__tmp4443 (_recr819_ (map std/srfi/101#node-left _ts821_)))
                  (__tmp4442
                   (_recr819_ (map std/srfi/101#node-right _ts821_))))
              (declare (not safe))
              (##structure std/srfi/101#node::t __tmp4444 __tmp4443 __tmp4442))
            (apply _f816_ _ts821_)))))
  (define std/srfi/101#tree-for-each/n
    (lambda (_f809_ _ts810_)
      (let _recr812_ ((_ts814_ _ts810_))
        (if (and (pair? _ts814_)
                 (let ((__tmp4445 (car _ts814_)))
                   (declare (not safe))
                   (##structure-instance-of? __tmp4445 'std/srfi/101#node::t)))
            (begin
              (apply _f809_ (map std/srfi/101#node-val _ts814_))
              (_recr812_ (map std/srfi/101#node-left _ts814_))
              (_recr812_ (map std/srfi/101#node-right _ts814_)))
            (apply _f809_ _ts814_)))))
  (define std/srfi/101#build-tree
    (lambda (_i799_ _f800_)
      (let _rec802_ ((_i804_ _i799_) (_o805_ '0))
        (if (= '1 _i804_)
            (_f800_ _o805_)
            (let ((_i/2807_ (std/srfi/101#half _i804_)))
              (let ((__tmp4448 (_f800_ _o805_))
                    (__tmp4447 (_rec802_ _i/2807_ (std/srfi/101#add1 _o805_)))
                    (__tmp4446 (_rec802_ _i/2807_ (+ '1 _o805_ _i/2807_))))
                (declare (not safe))
                (##structure
                 std/srfi/101#node::t
                 __tmp4448
                 __tmp4447
                 __tmp4446)))))))
  (define std/srfi/101#half (lambda (_n797_) (arithmetic-shift _n797_ '-1)))
  (define std/srfi/101#tr:make-tree
    (lambda (_i788_ _x789_)
      (let _recr791_ ((_i793_ _i788_))
        (if (= '1 _i793_)
            _x789_
            (let ((_n795_ (_recr791_ (std/srfi/101#half _i793_))))
              (declare (not safe))
              (##structure std/srfi/101#node::t _x789_ _n795_ _n795_))))))
  (define std/srfi/101#tree-ref/update
    (lambda (_mid777_ _t778_ _i779_ _f780_)
      (if (zero? _i779_)
          (if (let ()
                (declare (not safe))
                (##structure-instance-of? _t778_ 'std/srfi/101#node::t))
              (values (##structure-ref _t778_ '1 std/srfi/101#node::t '#f)
                      (let ((__tmp4451
                             (_f780_ (##structure-ref
                                      _t778_
                                      '1
                                      std/srfi/101#node::t
                                      '#f)))
                            (__tmp4450
                             (##structure-ref
                              _t778_
                              '2
                              std/srfi/101#node::t
                              '#f))
                            (__tmp4449
                             (##structure-ref
                              _t778_
                              '3
                              std/srfi/101#node::t
                              '#f)))
                        (declare (not safe))
                        (##structure
                         std/srfi/101#node::t
                         __tmp4451
                         __tmp4450
                         __tmp4449)))
              (values _t778_ (_f780_ _t778_)))
          (if (<= _i779_ _mid777_)
              (let ((_g4452_ (std/srfi/101#tree-ref/update
                              (std/srfi/101#half (std/srfi/101#sub1 _mid777_))
                              (##structure-ref
                               _t778_
                               '2
                               std/srfi/101#node::t
                               '#f)
                              (std/srfi/101#sub1 _i779_)
                              _f780_)))
                (begin
                  (let ((_g4453_ (let ()
                                   (declare (not safe))
                                   (if (##values? _g4452_)
                                       (##vector-length _g4452_)
                                       1))))
                    (if (not (let () (declare (not safe)) (##fx= _g4453_ 2)))
                        (error "Context expects 2 values" _g4453_)))
                  (let ((_v*782_ (let ()
                                   (declare (not safe))
                                   (##vector-ref _g4452_ 0)))
                        (_t*783_ (let ()
                                   (declare (not safe))
                                   (##vector-ref _g4452_ 1))))
                    (values _v*782_
                            (let ((__tmp4455
                                   (##structure-ref
                                    _t778_
                                    '1
                                    std/srfi/101#node::t
                                    '#f))
                                  (__tmp4454
                                   (##structure-ref
                                    _t778_
                                    '3
                                    std/srfi/101#node::t
                                    '#f)))
                              (declare (not safe))
                              (##structure
                               std/srfi/101#node::t
                               __tmp4455
                               _t*783_
                               __tmp4454))))))
              (let ((_g4456_ (std/srfi/101#tree-ref/update
                              (std/srfi/101#half (std/srfi/101#sub1 _mid777_))
                              (##structure-ref
                               _t778_
                               '3
                               std/srfi/101#node::t
                               '#f)
                              (std/srfi/101#sub1 (- _i779_ _mid777_))
                              _f780_)))
                (begin
                  (let ((_g4457_ (let ()
                                   (declare (not safe))
                                   (if (##values? _g4456_)
                                       (##vector-length _g4456_)
                                       1))))
                    (if (not (let () (declare (not safe)) (##fx= _g4457_ 2)))
                        (error "Context expects 2 values" _g4457_)))
                  (let ((_v*785_ (let ()
                                   (declare (not safe))
                                   (##vector-ref _g4456_ 0)))
                        (_t*786_ (let ()
                                   (declare (not safe))
                                   (##vector-ref _g4456_ 1))))
                    (values _v*785_
                            (let ((__tmp4459
                                   (##structure-ref
                                    _t778_
                                    '1
                                    std/srfi/101#node::t
                                    '#f))
                                  (__tmp4458
                                   (##structure-ref
                                    _t778_
                                    '2
                                    std/srfi/101#node::t
                                    '#f)))
                              (declare (not safe))
                              (##structure
                               std/srfi/101#node::t
                               __tmp4459
                               __tmp4458
                               _t*786_))))))))))
  (define std/srfi/101#tree-ref/a
    (lambda (_t773_ _i774_ _mid775_)
      (if (zero? _i774_)
          (std/srfi/101#tree-val _t773_)
          (if (<= _i774_ _mid775_)
              (std/srfi/101#tree-ref/a
               (##structure-ref _t773_ '2 std/srfi/101#node::t '#f)
               (std/srfi/101#sub1 _i774_)
               (std/srfi/101#half (std/srfi/101#sub1 _mid775_)))
              (std/srfi/101#tree-ref/a
               (##structure-ref _t773_ '3 std/srfi/101#node::t '#f)
               (std/srfi/101#sub1 (- _i774_ _mid775_))
               (std/srfi/101#half (std/srfi/101#sub1 _mid775_)))))))
  (define std/srfi/101#tree-ref
    (lambda (_size769_ _t770_ _i771_)
      (if (zero? _i771_)
          (std/srfi/101#tree-val _t770_)
          (std/srfi/101#tree-ref/a
           _t770_
           _i771_
           (std/srfi/101#half (std/srfi/101#sub1 _size769_))))))
  (define std/srfi/101#tree-update
    (lambda (_size758_ _t759_ _i760_ _f761_)
      (let _recr763_ ((_mid765_
                       (std/srfi/101#half (std/srfi/101#sub1 _size758_)))
                      (_t766_ _t759_)
                      (_i767_ _i760_))
        (if (zero? _i767_)
            (if (let ()
                  (declare (not safe))
                  (##structure-instance-of? _t766_ 'std/srfi/101#node::t))
                (let ((__tmp4462
                       (_f761_ (##structure-ref
                                _t766_
                                '1
                                std/srfi/101#node::t
                                '#f)))
                      (__tmp4461
                       (##structure-ref _t766_ '2 std/srfi/101#node::t '#f))
                      (__tmp4460
                       (##structure-ref _t766_ '3 std/srfi/101#node::t '#f)))
                  (declare (not safe))
                  (##structure
                   std/srfi/101#node::t
                   __tmp4462
                   __tmp4461
                   __tmp4460))
                (_f761_ _t766_))
            (if (<= _i767_ _mid765_)
                (let ((__tmp4465
                       (##structure-ref _t766_ '1 std/srfi/101#node::t '#f))
                      (__tmp4464
                       (_recr763_
                        (std/srfi/101#half (std/srfi/101#sub1 _mid765_))
                        (##structure-ref _t766_ '2 std/srfi/101#node::t '#f)
                        (std/srfi/101#sub1 _i767_)))
                      (__tmp4463
                       (##structure-ref _t766_ '3 std/srfi/101#node::t '#f)))
                  (declare (not safe))
                  (##structure
                   std/srfi/101#node::t
                   __tmp4465
                   __tmp4464
                   __tmp4463))
                (let ((__tmp4468
                       (##structure-ref _t766_ '1 std/srfi/101#node::t '#f))
                      (__tmp4467
                       (##structure-ref _t766_ '2 std/srfi/101#node::t '#f))
                      (__tmp4466
                       (_recr763_
                        (std/srfi/101#half (std/srfi/101#sub1 _mid765_))
                        (##structure-ref _t766_ '3 std/srfi/101#node::t '#f)
                        (std/srfi/101#sub1 (- _i767_ _mid765_)))))
                  (declare (not safe))
                  (##structure
                   std/srfi/101#node::t
                   __tmp4468
                   __tmp4467
                   __tmp4466)))))))
  (define std/srfi/101#ra:null '())
  (define std/srfi/101#ra:pair? std/srfi/101#kons?)
  (define std/srfi/101#ra:null? null?)
  (define std/srfi/101#ra:cons
    (lambda (_x753_ _ls754_)
      (if (let ()
            (declare (not safe))
            (##structure-instance-of? _ls754_ 'std/srfi/101#kons::t))
          (let ((_s756_ (##structure-ref _ls754_ '1 std/srfi/101#kons::t '#f)))
            (if (and (let ((__tmp4469
                            (##structure-ref
                             _ls754_
                             '3
                             std/srfi/101#kons::t
                             '#f)))
                       (declare (not safe))
                       (##structure-instance-of?
                        __tmp4469
                        'std/srfi/101#kons::t))
                     (= (##structure-ref
                         (##structure-ref _ls754_ '3 std/srfi/101#kons::t '#f)
                         '1
                         std/srfi/101#kons::t
                         '#f)
                        _s756_))
                (let ((__tmp4474 (+ '1 _s756_ _s756_))
                      (__tmp4471
                       (let ((__tmp4473
                              (##structure-ref
                               _ls754_
                               '2
                               std/srfi/101#kons::t
                               '#f))
                             (__tmp4472
                              (##structure-ref
                               (##structure-ref
                                _ls754_
                                '3
                                std/srfi/101#kons::t
                                '#f)
                               '2
                               std/srfi/101#kons::t
                               '#f)))
                         (declare (not safe))
                         (##structure
                          std/srfi/101#node::t
                          _x753_
                          __tmp4473
                          __tmp4472)))
                      (__tmp4470
                       (##structure-ref
                        (##structure-ref _ls754_ '3 std/srfi/101#kons::t '#f)
                        '3
                        std/srfi/101#kons::t
                        '#f)))
                  (declare (not safe))
                  (##structure
                   std/srfi/101#kons::t
                   __tmp4474
                   __tmp4471
                   __tmp4470))
                (let ()
                  (declare (not safe))
                  (##structure std/srfi/101#kons::t '1 _x753_ _ls754_))))
          (let ()
            (declare (not safe))
            (##structure std/srfi/101#kons::t '1 _x753_ _ls754_)))))
  (define std/srfi/101#ra:car+cdr
    (lambda (_p749_)
      (if (let ()
            (declare (not safe))
            (##structure-instance-of? _p749_ 'std/srfi/101#kons::t))
          '#!void
          (error '"assertion failure" '(kons? p)))
      (if (let ((__tmp4475
                 (##structure-ref _p749_ '2 std/srfi/101#kons::t '#f)))
            (declare (not safe))
            (##structure-instance-of? __tmp4475 'std/srfi/101#node::t))
          (let ((_s*751_ (std/srfi/101#half
                          (##structure-ref
                           _p749_
                           '1
                           std/srfi/101#kons::t
                           '#f))))
            (values (std/srfi/101#tree-val
                     (##structure-ref _p749_ '2 std/srfi/101#kons::t '#f))
                    (let ((__tmp4479
                           (##structure-ref
                            (##structure-ref
                             _p749_
                             '2
                             std/srfi/101#kons::t
                             '#f)
                            '2
                            std/srfi/101#node::t
                            '#f))
                          (__tmp4476
                           (let ((__tmp4478
                                  (##structure-ref
                                   (##structure-ref
                                    _p749_
                                    '2
                                    std/srfi/101#kons::t
                                    '#f)
                                   '3
                                   std/srfi/101#node::t
                                   '#f))
                                 (__tmp4477
                                  (##structure-ref
                                   _p749_
                                   '3
                                   std/srfi/101#kons::t
                                   '#f)))
                             (declare (not safe))
                             (##structure
                              std/srfi/101#kons::t
                              _s*751_
                              __tmp4478
                              __tmp4477))))
                      (declare (not safe))
                      (##structure
                       std/srfi/101#kons::t
                       _s*751_
                       __tmp4479
                       __tmp4476))))
          (values (##structure-ref _p749_ '2 std/srfi/101#kons::t '#f)
                  (##structure-ref _p749_ '3 std/srfi/101#kons::t '#f)))))
  (define std/srfi/101#ra:car
    (lambda (_p743_)
      (call-with-values
       (lambda () (std/srfi/101#ra:car+cdr _p743_))
       (lambda (_car746_ _cdr747_) _car746_))))
  (define std/srfi/101#ra:cdr
    (lambda (_p737_)
      (call-with-values
       (lambda () (std/srfi/101#ra:car+cdr _p737_))
       (lambda (_car740_ _cdr741_) _cdr741_))))
  (define std/srfi/101#ra:list-ref/update
    (lambda (_ls722_ _i723_ _f724_)
      (let _recr726_ ((_xs728_ _ls722_) (_j729_ _i723_))
        (if (< _j729_ (##structure-ref _xs728_ '1 std/srfi/101#kons::t '#f))
            (let ((_g4480_ (std/srfi/101#tree-ref/update
                            (std/srfi/101#half
                             (std/srfi/101#sub1
                              (##structure-ref
                               _xs728_
                               '1
                               std/srfi/101#kons::t
                               '#f)))
                            (##structure-ref
                             _xs728_
                             '2
                             std/srfi/101#kons::t
                             '#f)
                            _j729_
                            _f724_)))
              (begin
                (let ((_g4481_ (let ()
                                 (declare (not safe))
                                 (if (##values? _g4480_)
                                     (##vector-length _g4480_)
                                     1))))
                  (if (not (let () (declare (not safe)) (##fx= _g4481_ 2)))
                      (error "Context expects 2 values" _g4481_)))
                (let ((_v*731_ (let ()
                                 (declare (not safe))
                                 (##vector-ref _g4480_ 0)))
                      (_t*732_ (let ()
                                 (declare (not safe))
                                 (##vector-ref _g4480_ 1))))
                  (values _v*731_
                          (let ((__tmp4483
                                 (##structure-ref
                                  _xs728_
                                  '1
                                  std/srfi/101#kons::t
                                  '#f))
                                (__tmp4482
                                 (##structure-ref
                                  _xs728_
                                  '3
                                  std/srfi/101#kons::t
                                  '#f)))
                            (declare (not safe))
                            (##structure
                             std/srfi/101#kons::t
                             __tmp4483
                             _t*732_
                             __tmp4482))))))
            (let ((_g4484_ (_recr726_
                            (##structure-ref
                             _xs728_
                             '3
                             std/srfi/101#kons::t
                             '#f)
                            (- _j729_
                               (##structure-ref
                                _xs728_
                                '1
                                std/srfi/101#kons::t
                                '#f)))))
              (begin
                (let ((_g4485_ (let ()
                                 (declare (not safe))
                                 (if (##values? _g4484_)
                                     (##vector-length _g4484_)
                                     1))))
                  (if (not (let () (declare (not safe)) (##fx= _g4485_ 2)))
                      (error "Context expects 2 values" _g4485_)))
                (let ((_v*734_ (let ()
                                 (declare (not safe))
                                 (##vector-ref _g4484_ 0)))
                      (_r*735_ (let ()
                                 (declare (not safe))
                                 (##vector-ref _g4484_ 1))))
                  (values _v*734_
                          (let ((__tmp4487
                                 (##structure-ref
                                  _xs728_
                                  '1
                                  std/srfi/101#kons::t
                                  '#f))
                                (__tmp4486
                                 (##structure-ref
                                  _xs728_
                                  '2
                                  std/srfi/101#kons::t
                                  '#f)))
                            (declare (not safe))
                            (##structure
                             std/srfi/101#kons::t
                             __tmp4487
                             __tmp4486
                             _r*735_))))))))))
  (define std/srfi/101#ra:list-update
    (lambda (_ls711_ _i712_ _f713_)
      (let _recr715_ ((_xs717_ _ls711_) (_j718_ _i712_))
        (let ((_s720_ (##structure-ref _xs717_ '1 std/srfi/101#kons::t '#f)))
          (if (< _j718_ _s720_)
              (let ((__tmp4489
                     (std/srfi/101#tree-update
                      _s720_
                      (##structure-ref _xs717_ '2 std/srfi/101#kons::t '#f)
                      _j718_
                      _f713_))
                    (__tmp4488
                     (##structure-ref _xs717_ '3 std/srfi/101#kons::t '#f)))
                (declare (not safe))
                (##structure std/srfi/101#kons::t _s720_ __tmp4489 __tmp4488))
              (let ((__tmp4491
                     (##structure-ref _xs717_ '2 std/srfi/101#kons::t '#f))
                    (__tmp4490
                     (_recr715_
                      (##structure-ref _xs717_ '3 std/srfi/101#kons::t '#f)
                      (- _j718_ _s720_))))
                (declare (not safe))
                (##structure
                 std/srfi/101#kons::t
                 _s720_
                 __tmp4491
                 __tmp4490)))))))
  (define std/srfi/101#ra:list-ref/set
    (lambda (_ls706_ _i707_ _v708_)
      (std/srfi/101#ra:list-ref/update
       _ls706_
       _i707_
       (lambda (_g4492_) _v708_))))
  (define std/srfi/101#ra:list
    (lambda _xs704_
      (foldr1 std/srfi/101#ra:cons std/srfi/101#ra:null _xs704_)))
  (define std/srfi/101#ra:make-list__0
    (lambda (_k692_) (std/srfi/101#ra:make-list__1 _k692_ '0)))
  (define std/srfi/101#ra:make-list__1
    (lambda (_k694_ _obj695_)
      (let _loop697_ ((_n699_ _k694_) (_a700_ std/srfi/101#ra:null))
        (if (zero? _n699_)
            _a700_
            (let ((_t702_ (std/srfi/101#largest-skew-binary _n699_)))
              (_loop697_
               (- _n699_ _t702_)
               (let ((__tmp4493 (std/srfi/101#tr:make-tree _t702_ _obj695_)))
                 (declare (not safe))
                 (##structure
                  std/srfi/101#kons::t
                  _t702_
                  __tmp4493
                  _a700_))))))))
  (define std/srfi/101#ra:make-list
    (lambda _g4495_
      (let ((_g4494_ (let () (declare (not safe)) (##length _g4495_))))
        (cond ((let () (declare (not safe)) (##fx= _g4494_ 1))
               (apply std/srfi/101#ra:make-list__0 _g4495_))
              ((let () (declare (not safe)) (##fx= _g4494_ 2))
               (apply std/srfi/101#ra:make-list__1 _g4495_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/srfi/101#ra:make-list
                _g4495_))))))
  (define std/srfi/101#skew-succ
    (lambda (_t690_) (std/srfi/101#add1 (arithmetic-shift _t690_ '1))))
  (define std/srfi/101#largest-skew-binary
    (lambda (_n683_)
      (if (= '1 _n683_)
          '1
          (let* ((_t685_ (std/srfi/101#largest-skew-binary
                          (std/srfi/101#half _n683_)))
                 (_s687_ (std/srfi/101#skew-succ _t685_)))
            (if (> _s687_ _n683_) _t685_ _s687_)))))
  (define std/srfi/101#ra:list?
    (lambda (_x678_)
      (let ((_$e680_ (std/srfi/101#ra:null? _x678_)))
        (if _$e680_
            _$e680_
            (if (let ()
                  (declare (not safe))
                  (##structure-instance-of? _x678_ 'std/srfi/101#kons::t))
                (std/srfi/101#ra:list?
                 (##structure-ref _x678_ '3 std/srfi/101#kons::t '#f))
                '#f)))))
  (define std/srfi/101#ra:caar
    (lambda (_ls676_) (std/srfi/101#ra:car (std/srfi/101#ra:car _ls676_))))
  (define std/srfi/101#ra:cadr
    (lambda (_ls674_) (std/srfi/101#ra:car (std/srfi/101#ra:cdr _ls674_))))
  (define std/srfi/101#ra:cddr
    (lambda (_ls672_) (std/srfi/101#ra:cdr (std/srfi/101#ra:cdr _ls672_))))
  (define std/srfi/101#ra:cdar
    (lambda (_ls670_) (std/srfi/101#ra:cdr (std/srfi/101#ra:car _ls670_))))
  (define std/srfi/101#ra:caaar
    (lambda (_ls668_)
      (std/srfi/101#ra:car
       (std/srfi/101#ra:car (std/srfi/101#ra:car _ls668_)))))
  (define std/srfi/101#ra:caadr
    (lambda (_ls666_)
      (std/srfi/101#ra:car
       (std/srfi/101#ra:car (std/srfi/101#ra:cdr _ls666_)))))
  (define std/srfi/101#ra:caddr
    (lambda (_ls664_)
      (std/srfi/101#ra:car
       (std/srfi/101#ra:cdr (std/srfi/101#ra:cdr _ls664_)))))
  (define std/srfi/101#ra:cadar
    (lambda (_ls662_)
      (std/srfi/101#ra:car
       (std/srfi/101#ra:cdr (std/srfi/101#ra:car _ls662_)))))
  (define std/srfi/101#ra:cdaar
    (lambda (_ls660_)
      (std/srfi/101#ra:cdr
       (std/srfi/101#ra:car (std/srfi/101#ra:car _ls660_)))))
  (define std/srfi/101#ra:cdadr
    (lambda (_ls658_)
      (std/srfi/101#ra:cdr
       (std/srfi/101#ra:car (std/srfi/101#ra:cdr _ls658_)))))
  (define std/srfi/101#ra:cdddr
    (lambda (_ls656_)
      (std/srfi/101#ra:cdr
       (std/srfi/101#ra:cdr (std/srfi/101#ra:cdr _ls656_)))))
  (define std/srfi/101#ra:cddar
    (lambda (_ls654_)
      (std/srfi/101#ra:cdr
       (std/srfi/101#ra:cdr (std/srfi/101#ra:car _ls654_)))))
  (define std/srfi/101#ra:caaaar
    (lambda (_ls652_)
      (std/srfi/101#ra:car
       (std/srfi/101#ra:car
        (std/srfi/101#ra:car (std/srfi/101#ra:car _ls652_))))))
  (define std/srfi/101#ra:caaadr
    (lambda (_ls650_)
      (std/srfi/101#ra:car
       (std/srfi/101#ra:car
        (std/srfi/101#ra:car (std/srfi/101#ra:cdr _ls650_))))))
  (define std/srfi/101#ra:caaddr
    (lambda (_ls648_)
      (std/srfi/101#ra:car
       (std/srfi/101#ra:car
        (std/srfi/101#ra:cdr (std/srfi/101#ra:cdr _ls648_))))))
  (define std/srfi/101#ra:caadar
    (lambda (_ls646_)
      (std/srfi/101#ra:car
       (std/srfi/101#ra:car
        (std/srfi/101#ra:cdr (std/srfi/101#ra:car _ls646_))))))
  (define std/srfi/101#ra:cadaar
    (lambda (_ls644_)
      (std/srfi/101#ra:car
       (std/srfi/101#ra:cdr
        (std/srfi/101#ra:car (std/srfi/101#ra:car _ls644_))))))
  (define std/srfi/101#ra:cadadr
    (lambda (_ls642_)
      (std/srfi/101#ra:car
       (std/srfi/101#ra:cdr
        (std/srfi/101#ra:car (std/srfi/101#ra:cdr _ls642_))))))
  (define std/srfi/101#ra:cadddr
    (lambda (_ls640_)
      (std/srfi/101#ra:car
       (std/srfi/101#ra:cdr
        (std/srfi/101#ra:cdr (std/srfi/101#ra:cdr _ls640_))))))
  (define std/srfi/101#ra:caddar
    (lambda (_ls638_)
      (std/srfi/101#ra:car
       (std/srfi/101#ra:cdr
        (std/srfi/101#ra:cdr (std/srfi/101#ra:car _ls638_))))))
  (define std/srfi/101#ra:cdaaar
    (lambda (_ls636_)
      (std/srfi/101#ra:cdr
       (std/srfi/101#ra:car
        (std/srfi/101#ra:car (std/srfi/101#ra:car _ls636_))))))
  (define std/srfi/101#ra:cdaadr
    (lambda (_ls634_)
      (std/srfi/101#ra:cdr
       (std/srfi/101#ra:car
        (std/srfi/101#ra:car (std/srfi/101#ra:cdr _ls634_))))))
  (define std/srfi/101#ra:cdaddr
    (lambda (_ls632_)
      (std/srfi/101#ra:cdr
       (std/srfi/101#ra:car
        (std/srfi/101#ra:cdr (std/srfi/101#ra:cdr _ls632_))))))
  (define std/srfi/101#ra:cdadar
    (lambda (_ls630_)
      (std/srfi/101#ra:cdr
       (std/srfi/101#ra:car
        (std/srfi/101#ra:cdr (std/srfi/101#ra:car _ls630_))))))
  (define std/srfi/101#ra:cddaar
    (lambda (_ls628_)
      (std/srfi/101#ra:cdr
       (std/srfi/101#ra:cdr
        (std/srfi/101#ra:car (std/srfi/101#ra:car _ls628_))))))
  (define std/srfi/101#ra:cddadr
    (lambda (_ls626_)
      (std/srfi/101#ra:cdr
       (std/srfi/101#ra:cdr
        (std/srfi/101#ra:car (std/srfi/101#ra:cdr _ls626_))))))
  (define std/srfi/101#ra:cddddr
    (lambda (_ls624_)
      (std/srfi/101#ra:cdr
       (std/srfi/101#ra:cdr
        (std/srfi/101#ra:cdr (std/srfi/101#ra:cdr _ls624_))))))
  (define std/srfi/101#ra:cdddar
    (lambda (_ls622_)
      (std/srfi/101#ra:cdr
       (std/srfi/101#ra:cdr
        (std/srfi/101#ra:cdr (std/srfi/101#ra:car _ls622_))))))
  (define std/srfi/101#ra:length
    (lambda (_ls616_)
      (if (std/srfi/101#ra:list? _ls616_)
          '#!void
          (error '"assertion failure" '(ra:list? ls)))
      (let _recr618_ ((_ls620_ _ls616_))
        (if (let ()
              (declare (not safe))
              (##structure-instance-of? _ls620_ 'std/srfi/101#kons::t))
            (+ (##structure-ref _ls620_ '1 std/srfi/101#kons::t '#f)
               (_recr618_
                (##structure-ref _ls620_ '3 std/srfi/101#kons::t '#f)))
            '0))))
  (define std/srfi/101#make-foldl
    (lambda (_empty?606_ _first607_ _rest608_)
      (letrec ((_f610_ (lambda (_cons612_ _empty613_ _ls614_)
                         (if (_empty?606_ _ls614_)
                             _empty613_
                             (_f610_ _cons612_
                                     (_cons612_
                                      (_first607_ _ls614_)
                                      _empty613_)
                                     (_rest608_ _ls614_))))))
        _f610_)))
  (define std/srfi/101#make-foldr
    (lambda (_empty?596_ _first597_ _rest598_)
      (letrec ((_f600_ (lambda (_cons602_ _empty603_ _ls604_)
                         (if (_empty?596_ _ls604_)
                             _empty603_
                             (_cons602_
                              (_first597_ _ls604_)
                              (_f600_ _cons602_
                                      _empty603_
                                      (_rest598_ _ls604_)))))))
        _f600_)))
  (define std/srfi/101#ra:foldl/1
    (std/srfi/101#make-foldl
     std/srfi/101#ra:null?
     std/srfi/101#ra:car
     std/srfi/101#ra:cdr))
  (define std/srfi/101#ra:foldr/1
    (std/srfi/101#make-foldr
     std/srfi/101#ra:null?
     std/srfi/101#ra:car
     std/srfi/101#ra:cdr))
  (define std/srfi/101#ra:append
    (lambda _lss590_
      (if (null? _lss590_)
          std/srfi/101#ra:null
          (let _recr592_ ((_lss594_ _lss590_))
            (if (null? (cdr _lss594_))
                (car _lss594_)
                (std/srfi/101#ra:foldr/1
                 std/srfi/101#ra:cons
                 (_recr592_ (cdr _lss594_))
                 (car _lss594_)))))))
  (define std/srfi/101#ra:reverse
    (lambda (_ls588_)
      (std/srfi/101#ra:foldl/1
       std/srfi/101#ra:cons
       std/srfi/101#ra:null
       _ls588_)))
  (define std/srfi/101#ra:list-tail
    (lambda (_ls580_ _i581_)
      (let _loop583_ ((_xs585_ _ls580_) (_j586_ _i581_))
        (if (zero? _j586_)
            _xs585_
            (_loop583_
             (std/srfi/101#ra:cdr _xs585_)
             (std/srfi/101#sub1 _j586_))))))
  (define std/srfi/101#ra:list-ref
    (lambda (_ls572_ _i573_)
      (let _loop575_ ((_xs577_ _ls572_) (_j578_ _i573_))
        (if (< _j578_ (##structure-ref _xs577_ '1 std/srfi/101#kons::t '#f))
            (std/srfi/101#tree-ref
             (##structure-ref _xs577_ '1 std/srfi/101#kons::t '#f)
             (##structure-ref _xs577_ '2 std/srfi/101#kons::t '#f)
             _j578_)
            (_loop575_
             (##structure-ref _xs577_ '3 std/srfi/101#kons::t '#f)
             (- _j578_
                (##structure-ref _xs577_ '1 std/srfi/101#kons::t '#f)))))))
  (define std/srfi/101#ra:list-set
    (lambda (_ls566_ _i567_ _v568_)
      (let ((_g4496_ (std/srfi/101#ra:list-ref/set _ls566_ _i567_ _v568_)))
        (begin
          (let ((_g4497_ (let ()
                           (declare (not safe))
                           (if (##values? _g4496_)
                               (##vector-length _g4496_)
                               1))))
            (if (not (let () (declare (not safe)) (##fx= _g4497_ 2)))
                (error "Context expects 2 values" _g4497_)))
          (let ((_l*570_ (let ()
                           (declare (not safe))
                           (##vector-ref _g4496_ 1))))
            _l*570_)))))
  (define std/srfi/101#ra:map__0
    (lambda (_f552_ _ls553_)
      (let _recr555_ ((_ls557_ _ls553_))
        (if (let ()
              (declare (not safe))
              (##structure-instance-of? _ls557_ 'std/srfi/101#kons::t))
            (let ((__tmp4500
                   (##structure-ref _ls557_ '1 std/srfi/101#kons::t '#f))
                  (__tmp4499
                   (std/srfi/101#tree-map
                    _f552_
                    (##structure-ref _ls557_ '2 std/srfi/101#kons::t '#f)))
                  (__tmp4498
                   (_recr555_
                    (##structure-ref _ls557_ '3 std/srfi/101#kons::t '#f))))
              (declare (not safe))
              (##structure std/srfi/101#kons::t __tmp4500 __tmp4499 __tmp4498))
            std/srfi/101#ra:null))))
  (define std/srfi/101#ra:map__1
    (lambda (_f559_ . _lss560_)
      (let _recr562_ ((_lss564_ _lss560_))
        (if (std/srfi/101#ra:null? (car _lss564_))
            std/srfi/101#ra:null
            (let ((__tmp4503
                   (##structure-ref
                    (car _lss564_)
                    '1
                    std/srfi/101#kons::t
                    '#f))
                  (__tmp4502
                   (std/srfi/101#tree-map/n
                    _f559_
                    (map std/srfi/101#kons-tree _lss564_)))
                  (__tmp4501
                   (_recr562_ (map std/srfi/101#kons-rest _lss564_))))
              (declare (not safe))
              (##structure
               std/srfi/101#kons::t
               __tmp4503
               __tmp4502
               __tmp4501))))))
  (define std/srfi/101#ra:map
    (lambda _g4505_
      (let ((_g4504_ (let () (declare (not safe)) (##length _g4505_))))
        (cond ((let () (declare (not safe)) (##fx= _g4504_ 2))
               (apply std/srfi/101#ra:map__0 _g4505_))
              ((let () (declare (not safe)) (##fx>= _g4504_ 1))
               (apply std/srfi/101#ra:map__1 _g4505_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/srfi/101#ra:map
                _g4505_))))))
  (define std/srfi/101#ra:for-each__0
    (lambda (_f542_ _ls543_)
      (if (let ()
            (declare (not safe))
            (##structure-instance-of? _ls543_ 'std/srfi/101#kons::t))
          (begin
            (std/srfi/101#tree-for-each
             _f542_
             (##structure-ref _ls543_ '2 std/srfi/101#kons::t '#f))
            (std/srfi/101#ra:for-each__0
             _f542_
             (##structure-ref _ls543_ '3 std/srfi/101#kons::t '#f)))
          '#!void)))
  (define std/srfi/101#ra:for-each__1
    (lambda (_f545_ . _lss546_)
      (let _recr548_ ((_lss550_ _lss546_))
        (if (let ((__tmp4506 (car _lss550_)))
              (declare (not safe))
              (##structure-instance-of? __tmp4506 'std/srfi/101#kons::t))
            (begin
              (std/srfi/101#tree-map/n
               _f545_
               (map std/srfi/101#kons-tree _lss550_))
              (_recr548_ (map std/srfi/101#kons-rest _lss550_)))
            '#!void))))
  (define std/srfi/101#ra:for-each
    (lambda _g4508_
      (let ((_g4507_ (let () (declare (not safe)) (##length _g4508_))))
        (cond ((let () (declare (not safe)) (##fx= _g4507_ 2))
               (apply std/srfi/101#ra:for-each__0 _g4508_))
              ((let () (declare (not safe)) (##fx>= _g4507_ 1))
               (apply std/srfi/101#ra:for-each__1 _g4508_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/srfi/101#ra:for-each
                _g4508_))))))
  (define std/srfi/101#ra:random-access-list->linear-access-list
    (lambda (_x540_) (std/srfi/101#ra:foldr/1 cons '() _x540_)))
  (define std/srfi/101#ra:linear-access-list->random-access-list
    (lambda (_x538_) (foldr1 std/srfi/101#ra:cons '() _x538_)))
  (define std/srfi/101#get-cached
    (let ((_h522_ (make-table 'test: eq?)))
      (lambda (_x524_)
        (letrec ((_f526_ (lambda (_x536_)
                           (if (pair? _x536_)
                               (std/srfi/101#ra:cons
                                (_f526_ (car _x536_))
                                (_f526_ (cdr _x536_)))
                               (if (vector? _x536_)
                                   (vector-map _f526_ _x536_)
                                   _x536_)))))
          (if (not (or (pair? _x524_) (vector? _x524_)))
              _x524_
              (let ((_$e531_ (table-ref _h522_ _x524_ '#f)))
                (if _$e531_
                    _$e531_
                    (let ((_v534_ (_f526_ _x524_)))
                      (table-set! _h522_ _x524_ _v534_)
                      _v534_)))))))))
