(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/misc/hash#hash-empty?
    (lambda (_h681_) (zero? (table-length _h681_))))
  (define std/misc/hash#%none '#(none))
  (define std/misc/hash#hash-ensure-ref
    (lambda (_table673_ _key674_ _default675_)
      (let ((_val677_ (table-ref _table673_ _key674_ std/misc/hash#%none)))
        (if (eq? _val677_ std/misc/hash#%none)
            (let ((_value679_ (_default675_)))
              (table-set! _table673_ _key674_ _value679_)
              _value679_)
            _val677_))))
  (define std/misc/hash#invert-hash__%
    (lambda (_g4281_ _to647650_ _from652_)
      (let ((_to654_ (if (eq? _to647650_ absent-value)
                         (make-table)
                         _to647650_)))
        (table-for-each
         (lambda (_k656_ _v657_) (table-set! _to654_ _v657_ _k656_))
         _from652_)
        _to654_)))
  (define std/misc/hash#invert-hash__@
    (lambda (_keys646662_ . _args664_)
      (apply std/misc/hash#invert-hash__%
             _keys646662_
             (table-ref _keys646662_ 'to: absent-value)
             _args664_)))
  (define std/misc/hash#invert-hash
    (lambda _args648670_
      (apply keyword-dispatch
             '#(to:)
             std/misc/hash#invert-hash__@
             _args648670_)))
  (define std/misc/hash#invert-hash/fold__%
    (lambda (_g4282_ _to609614_ _nil610616_ _cons611618_ _from620_)
      (let* ((_to622_ (if (eq? _to609614_ absent-value)
                          (make-table)
                          _to609614_))
             (_nil624_ (if (eq? _nil610616_ absent-value) '() _nil610616_))
             (_cons626_
              (if (eq? _cons611618_ absent-value) cons _cons611618_)))
        (table-for-each
         (lambda (_k628_ _v629_)
           (table-set!
            _to622_
            _v629_
            (_cons626_ _k628_ (table-ref _to622_ _v629_ _nil624_))))
         _from620_)
        _to622_)))
  (define std/misc/hash#invert-hash/fold__@
    (lambda (_keys608634_ . _args636_)
      (apply std/misc/hash#invert-hash/fold__%
             _keys608634_
             (table-ref _keys608634_ 'to: absent-value)
             (table-ref _keys608634_ 'nil: absent-value)
             (table-ref _keys608634_ 'cons: absent-value)
             _args636_)))
  (define std/misc/hash#invert-hash/fold
    (lambda _args612642_
      (apply keyword-dispatch
             '#(nil: cons: to:)
             std/misc/hash#invert-hash/fold__@
             _args612642_)))
  (define std/misc/hash#invert-hash<-vector__%
    (lambda (_g4283_ _to578581_ _from583_)
      (let ((_to585_ (if (eq? _to578581_ absent-value)
                         (make-table)
                         _to578581_)))
        (letrec* ((_l587_ (vector-length _from583_)))
          (let _loop589_ ((_i591_ '0))
            (if (>= _i591_ _l587_)
                _to585_
                (begin
                  (table-set! _to585_ (vector-ref _from583_ _i591_) _i591_)
                  (_loop589_ (+ _i591_ '1)))))))))
  (define std/misc/hash#invert-hash<-vector__@
    (lambda (_keys577596_ . _args598_)
      (apply std/misc/hash#invert-hash<-vector__%
             _keys577596_
             (table-ref _keys577596_ 'to: absent-value)
             _args598_)))
  (define std/misc/hash#invert-hash<-vector
    (lambda _args579604_
      (apply keyword-dispatch
             '#(to:)
             std/misc/hash#invert-hash<-vector__@
             _args579604_)))
  (define std/misc/hash#invert-hash<-vector/fold__%
    (lambda (_g4284_ _to535540_ _nil536542_ _cons537544_ _from546_)
      (let* ((_to548_ (if (eq? _to535540_ absent-value)
                          (make-table)
                          _to535540_))
             (_nil550_ (if (eq? _nil536542_ absent-value) '() _nil536542_))
             (_cons552_
              (if (eq? _cons537544_ absent-value) cons _cons537544_)))
        (letrec* ((_l554_ (vector-length _from546_)))
          (let _loop556_ ((_i558_ '0))
            (if (>= _i558_ _l554_)
                _to548_
                (let ((_val560_ (vector-ref _from546_ _i558_)))
                  (table-set!
                   _to548_
                   _val560_
                   (_cons552_ _i558_ (table-ref _to548_ _val560_ _nil550_)))
                  (_loop556_ (+ _i558_ '1)))))))))
  (define std/misc/hash#invert-hash<-vector/fold__@
    (lambda (_keys534565_ . _args567_)
      (apply std/misc/hash#invert-hash<-vector/fold__%
             _keys534565_
             (table-ref _keys534565_ 'to: absent-value)
             (table-ref _keys534565_ 'nil: absent-value)
             (table-ref _keys534565_ 'cons: absent-value)
             _args567_)))
  (define std/misc/hash#invert-hash<-vector/fold
    (lambda _args538573_
      (apply keyword-dispatch
             '#(nil: cons: to:)
             std/misc/hash#invert-hash<-vector/fold__@
             _args538573_)))
  (define std/misc/hash#hash-restrict-keys
    (let ((_marker522_ '#(fresh)))
      (lambda (_h524_ _keys525_)
        (let ((_table527_ (make-table)))
          (for-each
           (lambda (_k529_)
             (let ((_v531_ (table-ref _h524_ _k529_ _marker522_)))
               (if (eq? _v531_ _marker522_)
                   '#!void
                   (table-set! _table527_ _k529_ _v531_))))
           _keys525_)
          _table527_))))
  (define std/misc/hash#hash-value-map
    (lambda (_h487_ _f488_)
      (list->table
       (map (lambda (_e489491_)
              (let* ((_g493500_ _e489491_)
                     (_E495504_
                      (lambda () (error '"No clause matching" _g493500_)))
                     (_K496510_
                      (lambda (_v507_ _k508_) (cons _k508_ (_f488_ _v507_)))))
                (if (let () (declare (not safe)) (##pair? _g493500_))
                    (let ((_hd497513_
                           (let () (declare (not safe)) (##car _g493500_)))
                          (_tl498515_
                           (let () (declare (not safe)) (##cdr _g493500_))))
                      (let* ((_k518_ _hd497513_) (_v520_ _tl498515_))
                        (_K496510_ _v520_ _k518_)))
                    (_E495504_))))
            (table->list _h487_)))))
  (define std/misc/hash#hash-filter__%
    (lambda (_from468_ _pred469_ _to470_)
      (table-for-each
       (lambda (_k472_ _v473_)
         (if (_pred469_ _k472_ _v473_)
             (table-set! _to470_ _k472_ _v473_)
             '#!void))
       _from468_)
      _to470_))
  (define std/misc/hash#hash-filter__0
    (lambda (_from478_ _pred479_)
      (let ((_to481_ (make-table)))
        (std/misc/hash#hash-filter__% _from478_ _pred479_ _to481_))))
  (define std/misc/hash#hash-filter
    (lambda _g4286_
      (let ((_g4285_ (let () (declare (not safe)) (##length _g4286_))))
        (cond ((let () (declare (not safe)) (##fx= _g4285_ 2))
               (apply std/misc/hash#hash-filter__0 _g4286_))
              ((let () (declare (not safe)) (##fx= _g4285_ 3))
               (apply std/misc/hash#hash-filter__% _g4286_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/misc/hash#hash-filter
                _g4286_))))))
  (define std/misc/hash#hash-remove__%
    (lambda (_from448_ _pred449_ _to450_)
      (table-for-each
       (lambda (_k452_ _v453_)
         (if (_pred449_ _k452_ _v453_)
             '#!void
             (table-set! _to450_ _k452_ _v453_)))
       _from448_)
      _to450_))
  (define std/misc/hash#hash-remove__0
    (lambda (_from458_ _pred459_)
      (let ((_to461_ (make-table)))
        (std/misc/hash#hash-remove__% _from458_ _pred459_ _to461_))))
  (define std/misc/hash#hash-remove
    (lambda _g4288_
      (let ((_g4287_ (let () (declare (not safe)) (##length _g4288_))))
        (cond ((let () (declare (not safe)) (##fx= _g4287_ 2))
               (apply std/misc/hash#hash-remove__0 _g4288_))
              ((let () (declare (not safe)) (##fx= _g4287_ 3))
               (apply std/misc/hash#hash-remove__% _g4288_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/misc/hash#hash-remove
                _g4288_))))))
  (define std/misc/hash#hash-remove-value__%
    (lambda (_from423_ _value424_ _to425_)
      (std/misc/hash#hash-remove__%
       _from423_
       (lambda (_g4289_ _v427_) (equal? _v427_ _value424_))
       _to425_)))
  (define std/misc/hash#hash-remove-value__0
    (lambda (_from432_)
      (let* ((_value434_ '#f) (_to436_ (make-table)))
        (std/misc/hash#hash-remove-value__% _from432_ _value434_ _to436_))))
  (define std/misc/hash#hash-remove-value__1
    (lambda (_from438_ _value439_)
      (let ((_to441_ (make-table)))
        (std/misc/hash#hash-remove-value__% _from438_ _value439_ _to441_))))
  (define std/misc/hash#hash-remove-value
    (lambda _g4291_
      (let ((_g4290_ (let () (declare (not safe)) (##length _g4291_))))
        (cond ((let () (declare (not safe)) (##fx= _g4290_ 1))
               (apply std/misc/hash#hash-remove-value__0 _g4291_))
              ((let () (declare (not safe)) (##fx= _g4290_ 2))
               (apply std/misc/hash#hash-remove-value__1 _g4291_))
              ((let () (declare (not safe)) (##fx= _g4290_ 3))
               (apply std/misc/hash#hash-remove-value__% _g4291_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/misc/hash#hash-remove-value
                _g4291_))))))
  (define std/misc/hash#hash-ensure-removed!
    (lambda (_table417_ _key418_)
      (let ((_val420_ (table-ref _table417_ _key418_ std/misc/hash#%none)))
        (if (eq? _val420_ std/misc/hash#%none)
            (values '#f '#f)
            (begin (table-set! _table417_ _key418_) (values _val420_ '#t))))))
  (define std/misc/hash#hash-ensure-modify!
    (lambda (_table407_ _key408_ _default409_ _function410_)
      (let* ((_val412_
              (std/misc/hash#hash-ensure-ref _table407_ _key408_ _default409_))
             (_new-val414_ (_function410_ _val412_)))
        (table-set! _table407_ _key408_ _new-val414_)
        _new-val414_)))
  (define std/misc/hash#hash-merge/override
    (lambda (_base-table401_ . _rest402_)
      (foldl1 (lambda (_tab404_ _r405_) (table-merge _r405_ _tab404_ '#t))
              _base-table401_
              _rest402_)))
  (define std/misc/hash#hash-merge/override!
    (lambda (_base-table395_ . _rest396_)
      (foldl1 (lambda (_tab398_ _r399_) (table-merge! _r399_ _tab398_ '#t))
              _base-table395_
              _rest396_)))
  (define std/misc/hash#hash->list/sort
    (lambda (_hash389_ _pred390_)
      (std/sort#sort
       (table->list _hash389_)
       (lambda (_x392_ _y393_) (_pred390_ (car _x392_) (car _y393_)))))))
