(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/srfi/146/hamt-map#phm?
    (lambda (_datum503_)
      (if (let ()
            (declare (not safe))
            (##structure-instance-of?
             _datum503_
             'std/srfi/146/hamt#hash-array-mapped-trie))
          (##structure-ref
           _datum503_
           '5
           std/srfi/146/hamt#hash-array-mapped-trie
           '#f)
          '#f)))
  (define std/srfi/146/hamt-map#make-phm-inner
    (lambda (_hash495_ _=496_ _alist497_)
      (let ((_phm499_ (std/srfi/146/hamt#make-hamt _=496_ _hash495_ '#t)))
        (if (null? _alist497_)
            _phm499_
            (let ((_phm-1501_ (std/srfi/146/hamt-map#phm/mutable _phm499_)))
              (std/srfi/146/hamt-map#phm/add-alist! _phm-1501_ _alist497_)
              (std/srfi/146/hamt-map#phm/immutable__0 _phm-1501_))))))
  (define std/srfi/146/hamt-map#make-phm__0
    (lambda (_hash488_ _=489_)
      (std/srfi/146/hamt-map#make-phm-inner _hash488_ _=489_ '())))
  (define std/srfi/146/hamt-map#make-phm
    (lambda _g4104_
      (let ((_g4103_ (let () (declare (not safe)) (##length _g4104_))))
        (cond ((let () (declare (not safe)) (##fx= _g4103_ 2))
               (apply std/srfi/146/hamt-map#make-phm__0 _g4104_))
              ((let () (declare (not safe)) (##fx= _g4103_ 3))
               (apply std/srfi/146/hamt-map#make-phm-inner _g4104_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/srfi/146/hamt-map#make-phm
                _g4104_))))))
  (define std/srfi/146/hamt-map#phm/count
    (lambda (_phm486_)
      (if (std/srfi/146/hamt-map#phm? _phm486_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm486_)))
      (##structure-ref
       _phm486_
       '2
       std/srfi/146/hamt#hash-array-mapped-trie
       '#f)))
  (define std/srfi/146/hamt-map#phm/empty?
    (lambda (_phm484_)
      (if (std/srfi/146/hamt-map#phm? _phm484_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm484_)))
      (std/srfi/146/hamt#hamt/empty? _phm484_)))
  (define std/srfi/146/hamt-map#phm/immutable__0
    (lambda (_phm479_)
      (if (std/srfi/146/hamt-map#phm? _phm479_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm479_)))
      (std/srfi/146/hamt#hamt/immutable__0 _phm479_)))
  (define std/srfi/146/hamt-map#phm/immutable__1
    (lambda (_phm481_ _replace482_)
      (if (std/srfi/146/hamt-map#phm? _phm481_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm481_)))
      (std/srfi/146/hamt#hamt/immutable-inner _phm481_ _replace482_)))
  (define std/srfi/146/hamt-map#phm/immutable
    (lambda _g4106_
      (let ((_g4105_ (let () (declare (not safe)) (##length _g4106_))))
        (cond ((let () (declare (not safe)) (##fx= _g4105_ 1))
               (apply std/srfi/146/hamt-map#phm/immutable__0 _g4106_))
              ((let () (declare (not safe)) (##fx= _g4105_ 2))
               (apply std/srfi/146/hamt-map#phm/immutable__1 _g4106_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/srfi/146/hamt-map#phm/immutable
                _g4106_))))))
  (define std/srfi/146/hamt-map#phm/mutable
    (lambda (_phm477_)
      (if (std/srfi/146/hamt-map#phm? _phm477_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm477_)))
      (std/srfi/146/hamt#hamt/mutable _phm477_)))
  (define std/srfi/146/hamt-map#phm/mutable?
    (lambda (_phm475_)
      (if (std/srfi/146/hamt-map#phm? _phm475_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm475_)))
      (##structure-ref
       _phm475_
       '4
       std/srfi/146/hamt#hash-array-mapped-trie
       '#f)))
  (define std/srfi/146/hamt-map#phm/put
    (lambda (_phm471_ _key472_ _datum473_)
      (if (std/srfi/146/hamt-map#phm? _phm471_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm471_)))
      (std/srfi/146/hamt#hamt/put _phm471_ _key472_ _datum473_)))
  (define std/srfi/146/hamt-map#phm/put!
    (lambda (_phm467_ _key468_ _datum469_)
      (if (std/srfi/146/hamt-map#phm? _phm467_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm467_)))
      (std/srfi/146/hamt#hamt/put! _phm467_ _key468_ _datum469_)))
  (define std/srfi/146/hamt-map#phm/replace
    (lambda (_phm463_ _key464_ _replace465_)
      (if (std/srfi/146/hamt-map#phm? _phm463_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm463_)))
      (std/srfi/146/hamt#hamt/replace _phm463_ _key464_ _replace465_)))
  (define std/srfi/146/hamt-map#phm/replace!
    (lambda (_phm459_ _key460_ _replace461_)
      (if (std/srfi/146/hamt-map#phm? _phm459_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm459_)))
      (std/srfi/146/hamt#hamt/replace! _phm459_ _key460_ _replace461_)))
  (define std/srfi/146/hamt-map#phm/get-inner
    (lambda (_phm453_ _key454_ _default455_)
      (if (std/srfi/146/hamt-map#phm? _phm453_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm453_)))
      (let ((_result457_ (std/srfi/146/hamt#hamt-fetch _phm453_ _key454_)))
        (if (std/srfi/146/hamt#hamt-null? _result457_)
            _default455_
            _result457_))))
  (define std/srfi/146/hamt-map#phm/get__0
    (lambda (_phm446_ _key447_)
      (std/srfi/146/hamt-map#phm/get-inner _phm446_ _key447_ '#f)))
  (define std/srfi/146/hamt-map#phm/get
    (lambda _g4108_
      (let ((_g4107_ (let () (declare (not safe)) (##length _g4108_))))
        (cond ((let () (declare (not safe)) (##fx= _g4107_ 2))
               (apply std/srfi/146/hamt-map#phm/get__0 _g4108_))
              ((let () (declare (not safe)) (##fx= _g4107_ 3))
               (apply std/srfi/146/hamt-map#phm/get-inner _g4108_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/srfi/146/hamt-map#phm/get
                _g4108_))))))
  (define std/srfi/146/hamt-map#phm/contains?
    (lambda (_phm443_ _key444_)
      (if (std/srfi/146/hamt-map#phm? _phm443_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm443_)))
      (not (std/srfi/146/hamt#hamt-null?
            (std/srfi/146/hamt#hamt-fetch _phm443_ _key444_)))))
  (define std/srfi/146/hamt-map#phm/remove
    (lambda (_phm440_ _key441_)
      (if (std/srfi/146/hamt-map#phm? _phm440_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm440_)))
      (std/srfi/146/hamt-map#phm/put
       _phm440_
       _key441_
       std/srfi/146/hamt#hamt-null)))
  (define std/srfi/146/hamt-map#phm/remove!
    (lambda (_phm437_ _key438_)
      (if (std/srfi/146/hamt-map#phm? _phm437_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm437_)))
      (if (##structure-ref
           _phm437_
           '4
           std/srfi/146/hamt#hash-array-mapped-trie
           '#f)
          '#!void
          (error '"Assertion failed:"
                 '(hamt/mutable? phm)
                 (list 'hamt/mutable? _phm437_)))
      (std/srfi/146/hamt-map#phm/put!
       _phm437_
       _key438_
       std/srfi/146/hamt#hamt-null)))
  (define std/srfi/146/hamt-map#phm/add-alist
    (lambda (_phm431_ _alist432_)
      (if (std/srfi/146/hamt-map#phm? _phm431_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm431_)))
      (foldl1 (lambda (_a434_ _phm435_)
                (std/srfi/146/hamt-map#phm/put
                 _phm435_
                 (car _a434_)
                 (cdr _a434_)))
              _phm431_
              _alist432_)))
  (define std/srfi/146/hamt-map#phm/add-alist!
    (lambda (_phm420_ _alist421_)
      (if (std/srfi/146/hamt-map#phm? _phm420_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm420_)))
      (let _$loop423_ ((_remaining426_ _alist421_))
        (if (null? _remaining426_)
            '#!void
            (begin
              (let ((_a429_ (car _remaining426_)))
                (std/srfi/146/hamt-map#phm/put!
                 _phm420_
                 (car _a429_)
                 (cdr _a429_)))
              (_$loop423_ (cdr _remaining426_)))))
      _phm420_))
  (define std/srfi/146/hamt-map#phm->alist
    (lambda (_phm418_)
      (if (std/srfi/146/hamt-map#phm? _phm418_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm418_)))
      (std/srfi/146/hamt#hamt->list _phm418_ cons)))
  (define std/srfi/146/hamt-map#phm/data
    (lambda (_phm413_)
      (if (std/srfi/146/hamt-map#phm? _phm413_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm413_)))
      (std/srfi/146/hamt#hamt->list _phm413_ (lambda (_k415_ _d416_) _d416_))))
  (define std/srfi/146/hamt-map#phm/keys
    (lambda (_phm408_)
      (if (std/srfi/146/hamt-map#phm? _phm408_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm408_)))
      (std/srfi/146/hamt#hamt->list _phm408_ (lambda (_k410_ _d411_) _k410_))))
  (define std/srfi/146/hamt-map#phm/for-each
    (lambda (_procedure405_ _phm406_)
      (if (std/srfi/146/hamt-map#phm? _phm406_)
          '#!void
          (error '"Assertion failed:" '(phm? phm) (list 'phm? _phm406_)))
      (std/srfi/146/hamt#hamt/for-each _procedure405_ _phm406_))))
