(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/misc/lru#lru-cache::t
    (make-struct-type
     'std/misc/lru#lru-cache::t
     '#f
     '5
     'lru-cache
     '((final: . #t))
     ':init!
     '(ht hd tl size cap)))
  (define std/misc/lru#lru-cache?
    (make-struct-predicate std/misc/lru#lru-cache::t))
  (define std/misc/lru#make-lru-cache
    (lambda _$args179956_
      (apply make-struct-instance std/misc/lru#lru-cache::t _$args179956_)))
  (define std/misc/lru#lru-cache-ht
    (make-struct-field-accessor std/misc/lru#lru-cache::t '0))
  (define std/misc/lru#lru-cache-hd
    (make-struct-field-accessor std/misc/lru#lru-cache::t '1))
  (define std/misc/lru#lru-cache-tl
    (make-struct-field-accessor std/misc/lru#lru-cache::t '2))
  (define std/misc/lru#lru-cache-size
    (make-struct-field-accessor std/misc/lru#lru-cache::t '3))
  (define std/misc/lru#lru-cache-cap
    (make-struct-field-accessor std/misc/lru#lru-cache::t '4))
  (define std/misc/lru#lru-cache-ht-set!
    (make-struct-field-mutator std/misc/lru#lru-cache::t '0))
  (define std/misc/lru#lru-cache-hd-set!
    (make-struct-field-mutator std/misc/lru#lru-cache::t '1))
  (define std/misc/lru#lru-cache-tl-set!
    (make-struct-field-mutator std/misc/lru#lru-cache::t '2))
  (define std/misc/lru#lru-cache-size-set!
    (make-struct-field-mutator std/misc/lru#lru-cache::t '3))
  (define std/misc/lru#lru-cache-cap-set!
    (make-struct-field-mutator std/misc/lru#lru-cache::t '4))
  (define std/misc/lru#&lru-cache-ht
    (make-struct-field-unchecked-accessor std/misc/lru#lru-cache::t '0))
  (define std/misc/lru#&lru-cache-hd
    (make-struct-field-unchecked-accessor std/misc/lru#lru-cache::t '1))
  (define std/misc/lru#&lru-cache-tl
    (make-struct-field-unchecked-accessor std/misc/lru#lru-cache::t '2))
  (define std/misc/lru#&lru-cache-size
    (make-struct-field-unchecked-accessor std/misc/lru#lru-cache::t '3))
  (define std/misc/lru#&lru-cache-cap
    (make-struct-field-unchecked-accessor std/misc/lru#lru-cache::t '4))
  (define std/misc/lru#&lru-cache-ht-set!
    (make-struct-field-unchecked-mutator std/misc/lru#lru-cache::t '0))
  (define std/misc/lru#&lru-cache-hd-set!
    (make-struct-field-unchecked-mutator std/misc/lru#lru-cache::t '1))
  (define std/misc/lru#&lru-cache-tl-set!
    (make-struct-field-unchecked-mutator std/misc/lru#lru-cache::t '2))
  (define std/misc/lru#&lru-cache-size-set!
    (make-struct-field-unchecked-mutator std/misc/lru#lru-cache::t '3))
  (define std/misc/lru#&lru-cache-cap-set!
    (make-struct-field-unchecked-mutator std/misc/lru#lru-cache::t '4))
  (define std/misc/lru#node::t
    (make-struct-type
     'std/misc/lru#node::t
     '#f
     '4
     'node
     '((final: . #t))
     '#f
     '(key val prev next)))
  (define std/misc/lru#node? (make-struct-predicate std/misc/lru#node::t))
  (define std/misc/lru#make-node
    (lambda _$args179953_
      (apply make-struct-instance std/misc/lru#node::t _$args179953_)))
  (define std/misc/lru#node-key
    (make-struct-field-accessor std/misc/lru#node::t '0))
  (define std/misc/lru#node-val
    (make-struct-field-accessor std/misc/lru#node::t '1))
  (define std/misc/lru#node-prev
    (make-struct-field-accessor std/misc/lru#node::t '2))
  (define std/misc/lru#node-next
    (make-struct-field-accessor std/misc/lru#node::t '3))
  (define std/misc/lru#node-key-set!
    (make-struct-field-mutator std/misc/lru#node::t '0))
  (define std/misc/lru#node-val-set!
    (make-struct-field-mutator std/misc/lru#node::t '1))
  (define std/misc/lru#node-prev-set!
    (make-struct-field-mutator std/misc/lru#node::t '2))
  (define std/misc/lru#node-next-set!
    (make-struct-field-mutator std/misc/lru#node::t '3))
  (define std/misc/lru#&node-key
    (make-struct-field-unchecked-accessor std/misc/lru#node::t '0))
  (define std/misc/lru#&node-val
    (make-struct-field-unchecked-accessor std/misc/lru#node::t '1))
  (define std/misc/lru#&node-prev
    (make-struct-field-unchecked-accessor std/misc/lru#node::t '2))
  (define std/misc/lru#&node-next
    (make-struct-field-unchecked-accessor std/misc/lru#node::t '3))
  (define std/misc/lru#&node-key-set!
    (make-struct-field-unchecked-mutator std/misc/lru#node::t '0))
  (define std/misc/lru#&node-val-set!
    (make-struct-field-unchecked-mutator std/misc/lru#node::t '1))
  (define std/misc/lru#&node-prev-set!
    (make-struct-field-unchecked-mutator std/misc/lru#node::t '2))
  (define std/misc/lru#&node-next-set!
    (make-struct-field-unchecked-mutator std/misc/lru#node::t '3))
  (define std/misc/lru#lru-cache:::init!
    (lambda (_self179950_ _cap179951_)
      (if (and (fixnum? _cap179951_) (##fx> _cap179951_ '1))
          '#!void
          (error '"Bad argument; expected fixnum > 1" _cap179951_))
      (if (##fx< '5 (##vector-length _self179950_))
          (begin
            (##vector-set! _self179950_ '1 (make-table))
            (##vector-set! _self179950_ '2 '#f)
            (##vector-set! _self179950_ '3 '#f)
            (##vector-set! _self179950_ '4 '0)
            (##vector-set! _self179950_ '5 _cap179951_))
          (error '"struct-instance-init!: too many arguments for struct"
                 _self179950_))))
  (bind-method!
   std/misc/lru#lru-cache::t
   ':init!
   std/misc/lru#lru-cache:::init!
   '#f)
  (define std/misc/lru#lru-cache-ref__%
    (lambda (_lru179785_ _key179786_ _default179787_)
      (let* ((_lru179788179794_ _lru179785_)
             (_E179790179798_
              (lambda () (error '"No clause matching" _lru179788179794_)))
             (_K179791179808_
              (lambda (_ht179801_)
                (let ((_$e179803_ (table-ref _ht179801_ _key179786_ '#f)))
                  (if _$e179803_
                      ((lambda (_n179806_)
                         (std/misc/lru#lru-cache-touch! _lru179785_ _n179806_)
                         (##unchecked-structure-ref
                          _n179806_
                          '2
                          std/misc/lru#node::t
                          '#f))
                       _$e179803_)
                      (if (eq? _default179787_ absent-obj)
                          (error '"No value associated with key"
                                 _lru179785_
                                 _key179786_)
                          _default179787_))))))
        (if (##structure-direct-instance-of?
             _lru179788179794_
             'std/misc/lru#lru-cache::t)
            (let* ((_e179792179811_ (##vector-ref _lru179788179794_ '1))
                   (_ht179814_ _e179792179811_))
              (_K179791179808_ _ht179814_))
            (_E179790179798_)))))
  (define std/misc/lru#lru-cache-ref__0
    (lambda (_lru179819_ _key179820_)
      (let ((_default179822_ absent-obj))
        (std/misc/lru#lru-cache-ref__%
         _lru179819_
         _key179820_
         _default179822_))))
  (define std/misc/lru#lru-cache-ref
    (lambda _g179959_
      (let ((_g179958_ (length _g179959_)))
        (cond ((##fx= _g179958_ 2)
               (apply std/misc/lru#lru-cache-ref__0 _g179959_))
              ((##fx= _g179958_ 3)
               (apply std/misc/lru#lru-cache-ref__% _g179959_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/misc/lru#lru-cache-ref
                _g179959_))))))
  (define std/misc/lru#lru-cache-touch!
    (lambda (_lru179770_ _n179771_)
      (let ((_hd179773_
             (##unchecked-structure-ref
              _lru179770_
              '2
              std/misc/lru#lru-cache::t
              '#f))
            (_tl179774_
             (##unchecked-structure-ref
              _lru179770_
              '3
              std/misc/lru#lru-cache::t
              '#f)))
        (let ((_$e179776_ (eq? _n179771_ _hd179773_)))
          (if _$e179776_
              _$e179776_
              (if (eq? _n179771_ _tl179774_)
                  (let ((_prev179779_
                         (##unchecked-structure-ref
                          _n179771_
                          '3
                          std/misc/lru#node::t
                          '#f)))
                    (##unchecked-structure-set!
                     _prev179779_
                     '#f
                     '4
                     std/misc/lru#node::t
                     '#f)
                    (##unchecked-structure-set!
                     _lru179770_
                     _prev179779_
                     '3
                     std/misc/lru#lru-cache::t
                     '#f)
                    (##unchecked-structure-set!
                     _n179771_
                     _hd179773_
                     '4
                     std/misc/lru#node::t
                     '#f)
                    (##unchecked-structure-set!
                     _hd179773_
                     _n179771_
                     '3
                     std/misc/lru#node::t
                     '#f)
                    (##unchecked-structure-set!
                     _n179771_
                     '#f
                     '3
                     std/misc/lru#node::t
                     '#f)
                    (##unchecked-structure-set!
                     _lru179770_
                     _n179771_
                     '2
                     std/misc/lru#lru-cache::t
                     '#f))
                  (let ((_prev179781_
                         (##unchecked-structure-ref
                          _n179771_
                          '3
                          std/misc/lru#node::t
                          '#f))
                        (_next179782_
                         (##unchecked-structure-ref
                          _n179771_
                          '4
                          std/misc/lru#node::t
                          '#f)))
                    (##unchecked-structure-set!
                     _prev179781_
                     _next179782_
                     '4
                     std/misc/lru#node::t
                     '#f)
                    (##unchecked-structure-set!
                     _next179782_
                     _prev179781_
                     '3
                     std/misc/lru#node::t
                     '#f)
                    (##unchecked-structure-set!
                     _n179771_
                     _hd179773_
                     '4
                     std/misc/lru#node::t
                     '#f)
                    (##unchecked-structure-set!
                     _hd179773_
                     _n179771_
                     '3
                     std/misc/lru#node::t
                     '#f)
                    (##unchecked-structure-set!
                     _n179771_
                     '#f
                     '3
                     std/misc/lru#node::t
                     '#f)
                    (##unchecked-structure-set!
                     _lru179770_
                     _n179771_
                     '2
                     std/misc/lru#lru-cache::t
                     '#f))))))))
  (define std/misc/lru#lru-cache-get
    (lambda (_lru179767_ _key179768_)
      (std/misc/lru#lru-cache-ref__% _lru179767_ _key179768_ '#f)))
  (define std/misc/lru#lru-cache-put!
    (lambda (_lru179724_ _key179725_ _val179726_)
      (let* ((_lru179727179733_ _lru179724_)
             (_E179729179737_
              (lambda () (error '"No clause matching" _lru179727179733_)))
             (_K179730179759_
              (lambda (_ht179740_)
                (let ((_$e179742_ (table-ref _ht179740_ _key179725_ '#f)))
                  (if _$e179742_
                      ((lambda (_n179745_)
                         (##unchecked-structure-set!
                          _n179745_
                          _val179726_
                          '2
                          std/misc/lru#node::t
                          '#f)
                         (std/misc/lru#lru-cache-touch! _lru179724_ _n179745_)
                         '#!void)
                       _$e179742_)
                      (let ((_n179747_
                             (##structure
                              std/misc/lru#node::t
                              _key179725_
                              _val179726_
                              '#f
                              '#f))
                            (_sz179748_
                             (##unchecked-structure-ref
                              _lru179724_
                              '4
                              std/misc/lru#lru-cache::t
                              '#f)))
                        (table-set! _ht179740_ _key179725_ _n179747_)
                        (if (##fx= _sz179748_ '0)
                            (begin
                              (##unchecked-structure-set!
                               _lru179724_
                               _n179747_
                               '2
                               std/misc/lru#lru-cache::t
                               '#f)
                              (##unchecked-structure-set!
                               _lru179724_
                               _n179747_
                               '3
                               std/misc/lru#lru-cache::t
                               '#f)
                              (##unchecked-structure-set!
                               _lru179724_
                               '1
                               '4
                               std/misc/lru#lru-cache::t
                               '#f))
                            (if (##fx< _sz179748_
                                       (##unchecked-structure-ref
                                        _lru179724_
                                        '5
                                        std/misc/lru#lru-cache::t
                                        '#f))
                                (let ((_hd179750_
                                       (##unchecked-structure-ref
                                        _lru179724_
                                        '2
                                        std/misc/lru#lru-cache::t
                                        '#f)))
                                  (##unchecked-structure-set!
                                   _hd179750_
                                   _n179747_
                                   '3
                                   std/misc/lru#node::t
                                   '#f)
                                  (##unchecked-structure-set!
                                   _n179747_
                                   _hd179750_
                                   '4
                                   std/misc/lru#node::t
                                   '#f)
                                  (##unchecked-structure-set!
                                   _lru179724_
                                   _n179747_
                                   '2
                                   std/misc/lru#lru-cache::t
                                   '#f)
                                  (##unchecked-structure-set!
                                   _lru179724_
                                   (##fx+ _sz179748_ '1)
                                   '4
                                   std/misc/lru#lru-cache::t
                                   '#f))
                                (let* ((_hd179752_
                                        (##unchecked-structure-ref
                                         _lru179724_
                                         '2
                                         std/misc/lru#lru-cache::t
                                         '#f))
                                       (_tl179754_
                                        (##unchecked-structure-ref
                                         _lru179724_
                                         '3
                                         std/misc/lru#lru-cache::t
                                         '#f))
                                       (_xl179756_
                                        (##unchecked-structure-ref
                                         _tl179754_
                                         '3
                                         std/misc/lru#node::t
                                         '#f)))
                                  (table-set!
                                   _ht179740_
                                   (##unchecked-structure-ref
                                    _tl179754_
                                    '1
                                    std/misc/lru#node::t
                                    '#f))
                                  (##unchecked-structure-set!
                                   _xl179756_
                                   '#f
                                   '4
                                   std/misc/lru#node::t
                                   '#f)
                                  (##unchecked-structure-set!
                                   _lru179724_
                                   _xl179756_
                                   '3
                                   std/misc/lru#lru-cache::t
                                   '#f)
                                  (##unchecked-structure-set!
                                   _hd179752_
                                   _n179747_
                                   '3
                                   std/misc/lru#node::t
                                   '#f)
                                  (##unchecked-structure-set!
                                   _n179747_
                                   _hd179752_
                                   '4
                                   std/misc/lru#node::t
                                   '#f)
                                  (##unchecked-structure-set!
                                   _lru179724_
                                   _n179747_
                                   '2
                                   std/misc/lru#lru-cache::t
                                   '#f))))
                        '#!void))))))
        (if (##structure-direct-instance-of?
             _lru179727179733_
             'std/misc/lru#lru-cache::t)
            (let* ((_e179731179762_ (##vector-ref _lru179727179733_ '1))
                   (_ht179765_ _e179731179762_))
              (_K179730179759_ _ht179765_))
            (_E179729179737_)))))
  (define std/misc/lru#lru-cache-remove!
    (lambda (_lru179665_ _key179666_)
      (let* ((_lru179667179676_ _lru179665_)
             (_E179669179680_
              (lambda () (error '"No clause matching" _lru179667179676_)))
             (_K179670179701_
              (lambda (_sz179683_ _tl179684_ _hd179685_ _ht179686_)
                (let ((_n179687179689_ (table-ref _ht179686_ _key179666_ '#f)))
                  (if _n179687179689_
                      (let ((_n179692_ _n179687179689_))
                        (table-set! _ht179686_ _key179666_)
                        (##unchecked-structure-set!
                         _lru179665_
                         (##fx- _sz179683_ '1)
                         '4
                         std/misc/lru#lru-cache::t
                         '#f)
                        (if (eq? _n179692_ _hd179685_)
                            (if (eq? _n179692_ _tl179684_)
                                (begin
                                  (##unchecked-structure-set!
                                   _lru179665_
                                   '#f
                                   '2
                                   std/misc/lru#lru-cache::t
                                   '#f)
                                  (##unchecked-structure-set!
                                   _lru179665_
                                   '#f
                                   '3
                                   std/misc/lru#lru-cache::t
                                   '#f))
                                (let ((_next179694_
                                       (##unchecked-structure-ref
                                        _n179692_
                                        '4
                                        std/misc/lru#node::t
                                        '#f)))
                                  (##unchecked-structure-set!
                                   _next179694_
                                   '#f
                                   '3
                                   std/misc/lru#node::t
                                   '#f)
                                  (##unchecked-structure-set!
                                   _lru179665_
                                   _next179694_
                                   '2
                                   std/misc/lru#lru-cache::t
                                   '#f)))
                            (if (eq? _n179692_ _tl179684_)
                                (let ((_prev179696_
                                       (##unchecked-structure-ref
                                        _n179692_
                                        '3
                                        std/misc/lru#node::t
                                        '#f)))
                                  (##unchecked-structure-set!
                                   _prev179696_
                                   '#f
                                   '4
                                   std/misc/lru#node::t
                                   '#f)
                                  (##unchecked-structure-set!
                                   _lru179665_
                                   _prev179696_
                                   '3
                                   std/misc/lru#lru-cache::t
                                   '#f))
                                (let ((_prev179698_
                                       (##unchecked-structure-ref
                                        _n179692_
                                        '3
                                        std/misc/lru#node::t
                                        '#f))
                                      (_next179699_
                                       (##unchecked-structure-ref
                                        _n179692_
                                        '4
                                        std/misc/lru#node::t
                                        '#f)))
                                  (##unchecked-structure-set!
                                   _prev179698_
                                   _next179699_
                                   '4
                                   std/misc/lru#node::t
                                   '#f)
                                  (##unchecked-structure-set!
                                   _next179699_
                                   _prev179698_
                                   '3
                                   std/misc/lru#node::t
                                   '#f))))
                        '#!void)
                      '#f)))))
        (if (##structure-direct-instance-of?
             _lru179667179676_
             'std/misc/lru#lru-cache::t)
            (let* ((_e179671179704_ (##vector-ref _lru179667179676_ '1))
                   (_ht179707_ _e179671179704_)
                   (_e179672179709_ (##vector-ref _lru179667179676_ '2))
                   (_hd179712_ _e179672179709_)
                   (_e179673179714_ (##vector-ref _lru179667179676_ '3))
                   (_tl179717_ _e179673179714_)
                   (_e179674179719_ (##vector-ref _lru179667179676_ '4))
                   (_sz179722_ _e179674179719_))
              (_K179670179701_ _sz179722_ _tl179717_ _hd179712_ _ht179707_))
            (_E179669179680_)))))
  (define std/misc/lru#lru-cache-flush!
    (lambda (_lru179663_)
      (if (##fx> (##direct-structure-ref
                  _lru179663_
                  '4
                  std/misc/lru#lru-cache::t
                  '#f)
                 '0)
          (if (##fx< '4 (##vector-length _lru179663_))
              (begin
                (##vector-set! _lru179663_ '1 (make-table))
                (##vector-set! _lru179663_ '2 '#f)
                (##vector-set! _lru179663_ '3 '#f)
                (##vector-set! _lru179663_ '4 '0))
              (error '"struct-instance-init!: too many arguments for struct"
                     _lru179663_))
          '#!void)))
  (define std/misc/lru#lru-cache-for-each
    (lambda (_proc179656_ _lru179657_)
      (let _lp179659_ ((_n179661_
                        (##direct-structure-ref
                         _lru179657_
                         '2
                         std/misc/lru#lru-cache::t
                         '#f)))
        (if _n179661_
            (begin
              (_proc179656_
               (##unchecked-structure-ref
                _n179661_
                '1
                std/misc/lru#node::t
                '#f)
               (##unchecked-structure-ref
                _n179661_
                '2
                std/misc/lru#node::t
                '#f))
              (_lp179659_
               (##unchecked-structure-ref
                _n179661_
                '4
                std/misc/lru#node::t
                '#f)))
            '#!void))))
  (define std/misc/lru#lru-cache-walk
    (lambda (_lru179653_ _proc179654_)
      (std/misc/lru#lru-cache-for-each _proc179654_ _lru179653_)))
  (define std/misc/lru#lru-cache-fold
    (lambda (_proc179644_ _iv179645_ _lru179646_)
      (let _lp179648_ ((_n179650_
                        (##direct-structure-ref
                         _lru179646_
                         '2
                         std/misc/lru#lru-cache::t
                         '#f))
                       (_r179651_ _iv179645_))
        (if _n179650_
            (_lp179648_
             (##unchecked-structure-ref _n179650_ '4 std/misc/lru#node::t '#f)
             (_proc179644_
              (##unchecked-structure-ref _n179650_ '1 std/misc/lru#node::t '#f)
              (##unchecked-structure-ref _n179650_ '2 std/misc/lru#node::t '#f)
              _r179651_))
            _r179651_))))
  (define std/misc/lru#lru-cache-foldr
    (lambda (_proc179635_ _iv179636_ _lru179637_)
      (let _lp179639_ ((_n179641_
                        (##direct-structure-ref
                         _lru179637_
                         '3
                         std/misc/lru#lru-cache::t
                         '#f))
                       (_r179642_ _iv179636_))
        (if _n179641_
            (_lp179639_
             (##unchecked-structure-ref _n179641_ '3 std/misc/lru#node::t '#f)
             (_proc179635_
              (##unchecked-structure-ref _n179641_ '1 std/misc/lru#node::t '#f)
              (##unchecked-structure-ref _n179641_ '2 std/misc/lru#node::t '#f)
              _r179642_))
            _r179642_))))
  (define std/misc/lru#lru-cache->list
    (lambda (_lru179629_)
      (std/misc/lru#lru-cache-foldr
       (lambda (_k179631_ _v179632_ _r179633_)
         (cons (cons _k179631_ _v179632_) _r179633_))
       '()
       _lru179629_)))
  (define std/misc/lru#:iter::lru-cache
    (lambda (_lru179627_) (std/misc/lru#in-lru-cache _lru179627_)))
  (std/generic/dispatch#generic-bind!
   std/iter#:iter::t
   (cons (std/generic/dispatch#type-linearize-class std/misc/lru#lru-cache::t)
         '())
   std/misc/lru#:iter::lru-cache)
  (define std/misc/lru#in-lru-cache
    (lambda (_lru179556_)
      (letrec ((_iterate179558_
                (lambda ()
                  (std/misc/lru#lru-cache-for-each
                   std/coroutine#yield
                   _lru179556_))))
        (std/iter#in-coroutine _iterate179558_))))
  (define std/misc/lru#in-lru-cache-keys
    (lambda (_lru179548_)
      (letrec ((_iterate179550_
                (lambda ()
                  (std/misc/lru#lru-cache-for-each
                   (lambda (_k179553_ _v179554_)
                     (std/coroutine#yield _k179553_))
                   _lru179548_))))
        (std/iter#in-coroutine _iterate179550_))))
  (define std/misc/lru#in-lru-cache-values
    (lambda (_lru179540_)
      (letrec ((_iterate179542_
                (lambda ()
                  (std/misc/lru#lru-cache-for-each
                   (lambda (_k179545_ _v179546_)
                     (std/coroutine#yield _v179546_))
                   _lru179540_))))
        (std/iter#in-coroutine _iterate179542_)))))
