(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/net/wamp#wamp-error::t
    (make-struct-type
     'std/net/wamp#wamp-error::t
     error::t
     '0
     'wamp-error
     '((final: . #t))
     ':init!
     '()))
  (define std/net/wamp#wamp-error?
    (make-struct-predicate std/net/wamp#wamp-error::t))
  (define std/net/wamp#make-wamp-error
    (lambda _$args8417_
      (apply make-struct-instance std/net/wamp#wamp-error::t _$args8417_)))
  (define std/net/wamp#invocation-error::t
    (make-struct-type
     'std/net/wamp#invocation-error::t
     '#f
     '3
     'invocation-error
     '((final: . #t))
     ':init!
     '(err details tail)))
  (define std/net/wamp#invocation-error?
    (make-struct-predicate std/net/wamp#invocation-error::t))
  (define std/net/wamp#make-invocation-error
    (lambda _$args8414_
      (apply make-struct-instance
             std/net/wamp#invocation-error::t
             _$args8414_)))
  (define std/net/wamp#invocation-error-err
    (make-struct-field-accessor std/net/wamp#invocation-error::t '0))
  (define std/net/wamp#invocation-error-details
    (make-struct-field-accessor std/net/wamp#invocation-error::t '1))
  (define std/net/wamp#invocation-error-tail
    (make-struct-field-accessor std/net/wamp#invocation-error::t '2))
  (define std/net/wamp#invocation-error-err-set!
    (make-struct-field-mutator std/net/wamp#invocation-error::t '0))
  (define std/net/wamp#invocation-error-details-set!
    (make-struct-field-mutator std/net/wamp#invocation-error::t '1))
  (define std/net/wamp#invocation-error-tail-set!
    (make-struct-field-mutator std/net/wamp#invocation-error::t '2))
  (define std/net/wamp#wamp-error:::init!
    (lambda (_self8409_ _where8410_ _err8411_ . _irritants8412_)
      (if (let ((__tmp14449
                 (let () (declare (not safe)) (##vector-length _self8409_))))
            (declare (not safe))
            (##fx< '3 __tmp14449))
          (begin
            (let ()
              (declare (not safe))
              (##vector-set! _self8409_ '1 _err8411_))
            (let ()
              (declare (not safe))
              (##vector-set! _self8409_ '2 _irritants8412_))
            (let ()
              (declare (not safe))
              (##vector-set! _self8409_ '3 _where8410_)))
          (error '"struct-instance-init!: too many arguments for struct"
                 _self8409_))))
  (bind-method!
   std/net/wamp#wamp-error::t
   ':init!
   std/net/wamp#wamp-error:::init!
   '#f)
  (define std/net/wamp#invocation-error:::init!
    (lambda (_self8279_ _err8280_ _details8281_ _args8282_ _kws8283_)
      (let ((_tail8285_
             (if _kws8283_
                 (cons _args8282_ (cons _kws8283_ '()))
                 (if (not (null? _args8282_)) (cons _args8282_ '()) '()))))
        (if (let ((__tmp14450
                   (let () (declare (not safe)) (##vector-length _self8279_))))
              (declare (not safe))
              (##fx< '3 __tmp14450))
            (begin
              (let ()
                (declare (not safe))
                (##vector-set! _self8279_ '1 _err8280_))
              (let ()
                (declare (not safe))
                (##vector-set! _self8279_ '2 _details8281_))
              (let ()
                (declare (not safe))
                (##vector-set! _self8279_ '3 _tail8285_)))
            (error '"struct-instance-init!: too many arguments for struct"
                   _self8279_)))))
  (bind-method!
   std/net/wamp#invocation-error::t
   ':init!
   std/net/wamp#invocation-error:::init!
   '#f)
  (define std/net/wamp#raise-invocation-error__%
    (lambda (_err8131_ _details8132_ _args8133_ _kws8134_)
      (raise (let ((__obj14447
                    (make-object std/net/wamp#invocation-error::t '3)))
               (std/net/wamp#invocation-error:::init!
                __obj14447
                _err8131_
                _details8132_
                _args8133_
                _kws8134_)
               __obj14447))))
  (define std/net/wamp#raise-invocation-error__0
    (lambda (_err8139_ _details8140_)
      (let* ((_args8142_ '()) (_kws8144_ '#f))
        (std/net/wamp#raise-invocation-error__%
         _err8139_
         _details8140_
         _args8142_
         _kws8144_))))
  (define std/net/wamp#raise-invocation-error__1
    (lambda (_err8146_ _details8147_ _args8148_)
      (let ((_kws8150_ '#f))
        (std/net/wamp#raise-invocation-error__%
         _err8146_
         _details8147_
         _args8148_
         _kws8150_))))
  (define std/net/wamp#raise-invocation-error
    (lambda _g14452_
      (let ((_g14451_ (let () (declare (not safe)) (##length _g14452_))))
        (cond ((let () (declare (not safe)) (##fx= _g14451_ 2))
               (apply std/net/wamp#raise-invocation-error__0 _g14452_))
              ((let () (declare (not safe)) (##fx= _g14451_ 3))
               (apply std/net/wamp#raise-invocation-error__1 _g14452_))
              ((let () (declare (not safe)) (##fx= _g14451_ 4))
               (apply std/net/wamp#raise-invocation-error__% _g14452_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/net/wamp#raise-invocation-error
                _g14452_))))))
  (define std/net/wamp#start-wamp-client!__%
    (lambda (_g14453_
             _redirect80778083_
             _headers80788085_
             _cookies80798087_
             _params80808089_
             _url8091_
             _realm8092_)
      (let* ((_redirect8094_
              (if (eq? _redirect80778083_ absent-value)
                  '#t
                  _redirect80778083_))
             (_headers8096_
              (if (eq? _headers80788085_ absent-value) '#f _headers80788085_))
             (_cookies8098_
              (if (eq? _cookies80798087_ absent-value) '#f _cookies80798087_))
             (_params8100_
              (if (eq? _params80808089_ absent-value) '#f _params80808089_)))
        (std/logger#start-logger!__0)
        (let* ((_compl8102_
                (let ((__obj14448
                       (make-object std/misc/completion#completion::t '5)))
                  (std/misc/completion#completion:::init! __obj14448)
                  __obj14448))
               (_client8104_
                (gerbil/gambit/threads#spawn/group
                 'wamp-client
                 std/net/wamp#wamp-client-main
                 _compl8102_
                 _url8091_
                 _realm8092_
                 'redirect:
                 _redirect8094_
                 'headers:
                 _headers8096_
                 'cookies:
                 _cookies8098_
                 'params:
                 _params8100_))
               (_details8113_
                (with-exception-catcher
                 (lambda (_g81058107_)
                   (if '#t
                       (let ((_e8110_ _g81058107_))
                         (std/misc/threads#thread-group-kill!
                          (thread-thread-group _client8104_))
                         (raise _e8110_))
                       (raise _g81058107_)))
                 (lambda ()
                   (std/misc/completion#completion-wait! _compl8102_)))))
          (values _client8104_ _details8113_)))))
  (define std/net/wamp#start-wamp-client!__@
    (lambda (_keys80768119_ . _args8121_)
      (apply std/net/wamp#start-wamp-client!__%
             _keys80768119_
             (table-ref _keys80768119_ 'redirect: absent-value)
             (table-ref _keys80768119_ 'headers: absent-value)
             (table-ref _keys80768119_ 'cookies: absent-value)
             (table-ref _keys80768119_ 'params: absent-value)
             _args8121_)))
  (define std/net/wamp#start-wamp-client!
    (lambda _args80818127_
      (apply keyword-dispatch
             '#(params:
                cookies:
                #f
                #f
                #f
                #f
                #f
                #f
                #f
                #f
                #f
                #f
                #f
                redirect:
                headers:
                #f
                #f
                #f
                #f)
             std/net/wamp#start-wamp-client!__@
             _args80818127_)))
  (define std/net/wamp#wamp-client-main__%
    (lambda (_g14454_
             _redirect80028008_
             _headers80038010_
             _cookies80048012_
             _params80058014_
             _compl8016_
             _url8017_
             _realm8018_)
      (let* ((_redirect8020_
              (if (eq? _redirect80028008_ absent-value)
                  (error '"Missing required keyword argument" 'redirect:)
                  _redirect80028008_))
             (_headers8022_
              (if (eq? _headers80038010_ absent-value)
                  (error '"Missing required keyword argument" 'headers:)
                  _headers80038010_))
             (_cookies8024_
              (if (eq? _cookies80048012_ absent-value)
                  (error '"Missing required keyword argument" 'cookies:)
                  _cookies80048012_))
             (_params8026_
              (if (eq? _params80058014_ absent-value)
                  (error '"Missing required keyword argument" 'params:)
                  _params80058014_)))
        (letrec ((_open-session8028_
                  (lambda ()
                    (let* ((_headers8046_
                            (cons '("Sec-WebSocket-Protocol" . "wamp.2.json")
                                  (let ((_$e8043_ _headers8022_))
                                    (if _$e8043_ _$e8043_ '()))))
                           (_ws8048_
                            (std/net/websocket#open-websocket-client__%
                             '#f
                             _redirect8020_
                             _headers8046_
                             _cookies8024_
                             _params8026_
                             _url8017_))
                           (_g14455_
                            (with-exception-catcher
                             (lambda (_g80498051_)
                               (if '#t
                                   (let ((_e8054_ _g80498051_))
                                     (std/net/websocket#websocket-close__%__0
                                      '#f
                                      absent-value
                                      _ws8048_)
                                     (raise _e8054_))
                                   (raise _g80498051_)))
                             (lambda ()
                               (std/net/wamp#wamp-open-session
                                _ws8048_
                                _realm8018_)))))
                      (begin
                        (let ((_g14456_
                               (let ()
                                 (declare (not safe))
                                 (if (##values? _g14455_)
                                     (##vector-length _g14455_)
                                     1))))
                          (if (not (let ()
                                     (declare (not safe))
                                     (##fx= _g14456_ 2)))
                              (error "Context expects 2 values" _g14456_)))
                        (let ((_sid8057_
                               (let ()
                                 (declare (not safe))
                                 (##vector-ref _g14455_ 0)))
                              (_details8058_
                               (let ()
                                 (declare (not safe))
                                 (##vector-ref _g14455_ 1))))
                          (let ()
                            (values _ws8048_ _sid8057_ _details8058_))))))))
          (let ((_g14457_
                 (with-exception-catcher
                  (lambda (_g80298031_)
                    (if '#t
                        (let ((_e8034_ _g80298031_))
                          (std/misc/completion#completion-error!
                           _compl8016_
                           _e8034_)
                          (raise _e8034_))
                        (raise _g80298031_)))
                  (lambda () (_open-session8028_)))))
            (begin
              (let ((_g14458_
                     (let ()
                       (declare (not safe))
                       (if (##values? _g14457_)
                           (##vector-length _g14457_)
                           1))))
                (if (not (let () (declare (not safe)) (##fx= _g14458_ 3)))
                    (error "Context expects 3 values" _g14458_)))
              (let ((_ws8038_
                     (let () (declare (not safe)) (##vector-ref _g14457_ 0)))
                    (_sid8039_
                     (let () (declare (not safe)) (##vector-ref _g14457_ 1)))
                    (_details8040_
                     (let () (declare (not safe)) (##vector-ref _g14457_ 2))))
                (begin
                  (std/misc/completion#completion-post!
                   _compl8016_
                   _details8040_)
                  (std/net/wamp#wamp-client
                   _ws8038_
                   _realm8018_
                   _sid8039_)))))))))
  (define std/net/wamp#wamp-client-main__@
    (lambda (_keys80018064_ . _args8066_)
      (apply std/net/wamp#wamp-client-main__%
             _keys80018064_
             (table-ref _keys80018064_ 'redirect: absent-value)
             (table-ref _keys80018064_ 'headers: absent-value)
             (table-ref _keys80018064_ 'cookies: absent-value)
             (table-ref _keys80018064_ 'params: absent-value)
             _args8066_)))
  (define std/net/wamp#wamp-client-main
    (lambda _args80068072_
      (apply keyword-dispatch
             '#(params:
                cookies:
                #f
                #f
                #f
                #f
                #f
                #f
                #f
                #f
                #f
                #f
                #f
                redirect:
                headers:
                #f
                #f
                #f
                #f)
             std/net/wamp#wamp-client-main__@
             _args80068072_)))
  (define std/net/wamp#wamp-call
    (lambda (_cli7989_ _name7990_ _opts7991_ _args7992_ _kws7993_)
      (if (string? _name7990_)
          '#!void
          (error '"Bad argument; expected string" _name7990_))
      (let ((_token7995_
             (let ()
               (declare (not safe))
               (##structure std/actor/proto#!token::t)))
            (_dest7997_ _cli7989_))
        (std/actor/message#send-message__%
         _dest7997_
         (let ((__tmp14459
                (let ()
                  (declare (not safe))
                  (##structure
                   std/net/wamp#wamp.call::t
                   _name7990_
                   _opts7991_
                   _args7992_
                   _kws7993_))))
           (declare (not safe))
           (##structure std/actor/proto#!call::t __tmp14459 _token7995_))
         '#f
         '#t)
        (std/actor/proto#!!call-recv _token7995_ _dest7997_))))
  (define std/net/wamp#wamp-publish
    (lambda (_cli7983_ _topic7984_ _opts7985_ _args7986_ _kws7987_)
      (if (string? _topic7984_)
          '#!void
          (error '"Bad argument; expected string" _topic7984_))
      (std/actor/message#send-message__0
       _cli7983_
       (let ((__tmp14460
              (let ()
                (declare (not safe))
                (##structure
                 std/net/wamp#wamp.publish::t
                 _topic7984_
                 _opts7985_
                 _args7986_
                 _kws7987_))))
         (declare (not safe))
         (##structure std/actor/proto#!event::t __tmp14460)))))
  (define std/net/wamp#wamp-subscribe
    (lambda (_cli7791_ _topic7792_)
      (letrec ((_event-handler7794_
                (lambda (_outp7806_)
                  (with-exception-catcher
                   (lambda (_g78077809_)
                     (if '#t
                         (let ((_e7812_ _g78077809_))
                           (std/actor/message#send-message__0
                            _cli7791_
                            (let ((__tmp14461
                                   (let ()
                                     (declare (not safe))
                                     (##structure
                                      std/net/wamp#wamp.unsubscribe::t
                                      _topic7792_))))
                              (declare (not safe))
                              (##structure
                               std/actor/proto#!event::t
                               __tmp14461)))
                           (write _e7812_ _outp7806_)
                           (close-port _outp7806_))
                         (raise _g78077809_)))
                   (lambda ()
                     (let ((_token7815_
                            (let ()
                              (declare (not safe))
                              (##structure std/actor/proto#!token::t)))
                           (_dest7817_ _cli7791_))
                       (std/actor/message#send-message__%
                        _dest7817_
                        (let ((__tmp14462
                               (let ()
                                 (declare (not safe))
                                 (##structure
                                  std/net/wamp#wamp.subscribe::t
                                  _topic7792_
                                  '#f))))
                          (declare (not safe))
                          (##structure
                           std/actor/proto#!call::t
                           __tmp14462
                           _token7815_))
                        '#f
                        '#t)
                       (std/actor/proto#!!call-recv _token7815_ _dest7817_))
                     (let _lp7820_ ()
                       (let _loop78227824_ ()
                         (let ((_next7828_ (thread-mailbox-next)))
                           ((lambda (_$message7831_)
                              (let* ((_$message78337843_ _$message7831_)
                                     (_else78357851_
                                      (lambda () (_loop78227824_)))
                                     (_K78377960_
                                      (lambda (_$options7854_
                                               _$dest7856_
                                               _$source7858_
                                               _$value7860_)
                                        (let* ((_$value78827899_ _$value7860_)
                                               (_else78867907_
                                                (lambda () (_loop78227824_))))
                                          (let ((_K78927936_
                                                 (lambda (_kws7932_
                                                          _args7933_
                                                          _details7934_)
                                                   (thread-mailbox-extract-and-rewind)
                                                   (write (values _details7934_
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          _args7933_
                          _kws7932_)
                  _outp7806_)
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                   (_lp7820_)))
                                                (_K78907923_
                                                 (lambda ()
                                                   (thread-mailbox-extract-and-rewind)
                                                   (std/actor/message#send-message__0
                                                    _cli7791_
                                                    (let ((__tmp14463
                                                           (let ()
                                                             (declare
                                                               (not safe))
                                                             (##structure
                                                              std/net/wamp#wamp.unsubscribe::t
                                                              _topic7792_))))
                                                      (declare (not safe))
                                                      (##structure
                                                       std/actor/proto#!event::t
                                                       __tmp14463)))
                                                   (close-port _outp7806_)))
                                                (_K78887912_
                                                 (lambda ()
                                                   (thread-mailbox-extract-and-rewind)
                                                   (close-port _outp7806_))))
                                            (if (let ()
                                                  (declare (not safe))
                                                  (##structure-direct-instance-of?
                                                   _$value78827899_
                                                   'std/actor/proto#!event::t))
                                                (let ((_e78937939_
                                                       (let ()
                                                         (declare (not safe))
                                                         (##vector-ref
                                                          _$value78827899_
                                                          '1))))
                                                  (if (let ()
                                                        (declare (not safe))
                                                        (##structure-direct-instance-of?
                                                         _e78937939_
                                                         'std/net/wamp#wamp.event::t))
                                                      (let* ((_e78947942_
                                                              (let ()
                                                                (declare
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          (not safe))
                        (##vector-ref _e78937939_ '1)))
                     (_e78957945_
                      (let ()
                        (declare (not safe))
                        (##vector-ref _e78937939_ '2)))
                     (_e78967950_
                      (let ()
                        (declare (not safe))
                        (##vector-ref _e78937939_ '3)))
                     (_e78977955_
                      (let ()
                        (declare (not safe))
                        (##vector-ref _e78937939_ '4))))
                (let ((_details7948_ _e78957945_)
                      (_args7953_ _e78967950_)
                      (_kws7958_ _e78977955_))
                  (_K78927936_ _kws7958_ _args7953_ _details7948_)))
              (if (let ()
                    (declare (not safe))
                    (##structure-direct-instance-of?
                     _e78937939_
                     'std/net/wamp#wamp.close-stream::t))
                  (_K78907923_)
                  (if (let ()
                        (declare (not safe))
                        (##structure-direct-instance-of?
                         _e78937939_
                         'std/net/wamp#wamp.shutdown::t))
                      (_K78887912_)
                      (_loop78227824_)))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                (_loop78227824_)))))))
                                (if (let ()
                                      (declare (not safe))
                                      (##structure-direct-instance-of?
                                       _$message78337843_
                                       'std/actor/message#message::t))
                                    (let* ((_e78387963_
                                            (let ()
                                              (declare (not safe))
                                              (##vector-ref
                                               _$message78337843_
                                               '1)))
                                           (_$value7966_ _e78387963_)
                                           (_e78397968_
                                            (let ()
                                              (declare (not safe))
                                              (##vector-ref
                                               _$message78337843_
                                               '2)))
                                           (_$source7971_ _e78397968_)
                                           (_e78407973_
                                            (let ()
                                              (declare (not safe))
                                              (##vector-ref
                                               _$message78337843_
                                               '3)))
                                           (_$dest7976_ _e78407973_)
                                           (_e78417978_
                                            (let ()
                                              (declare (not safe))
                                              (##vector-ref
                                               _$message78337843_
                                               '4)))
                                           (_$options7981_ _e78417978_))
                                      (_K78377960_
                                       _$options7981_
                                       _$dest7976_
                                       _$source7971_
                                       _$value7966_))
                                    (_loop78227824_))))
                            _next7828_)))))))))
        (if (string? _topic7792_)
            '#!void
            (error '"Bad argument; expected string" _topic7792_))
        (let ((_g14464_
               (open-vector-pipe
                (cons 'permanent-close:
                      (cons '#t (cons 'direction: (cons 'input '()))))
                (cons 'permanent-close:
                      (cons '#t (cons 'direction: (cons 'output '())))))))
          (begin
            (let ((_g14465_
                   (let ()
                     (declare (not safe))
                     (if (##values? _g14464_) (##vector-length _g14464_) 1))))
              (if (not (let () (declare (not safe)) (##fx= _g14465_ 2)))
                  (error "Context expects 2 values" _g14465_)))
            (let ((_inp7796_
                   (let () (declare (not safe)) (##vector-ref _g14464_ 0)))
                  (_outp7797_
                   (let () (declare (not safe)) (##vector-ref _g14464_ 1))))
              (let* ((_handler7799_
                      (gerbil/gambit/threads#spawn/name
                       'wamp-receive
                       _event-handler7794_
                       _outp7797_))
                     (_close7802_
                      (lambda ()
                        (std/actor/message#send-message__0
                         _handler7799_
                         (let ((__tmp14466
                                (let ()
                                  (declare (not safe))
                                  (##structure
                                   std/net/wamp#wamp.close-stream::t))))
                           (declare (not safe))
                           (##structure
                            std/actor/proto#!event::t
                            __tmp14466))))))
                (make-will _inp7796_ (lambda (_g14467_) (_close7802_)))
                (values _inp7796_ _close7802_))))))))
  (define std/net/wamp#wamp-register
    (lambda (_cli7781_ _proc7782_ _name7783_ _opts7784_)
      (if (procedure? _proc7782_)
          '#!void
          (error '"Bad argument; expected procedure" _proc7782_))
      (if (string? _name7783_)
          '#!void
          (error '"Bad argument; expected string" _name7783_))
      (let ((_token7786_
             (let ()
               (declare (not safe))
               (##structure std/actor/proto#!token::t)))
            (_dest7788_ _cli7781_))
        (std/actor/message#send-message__%
         _dest7788_
         (let ((__tmp14468
                (let ()
                  (declare (not safe))
                  (##structure
                   std/net/wamp#wamp.register::t
                   _proc7782_
                   _name7783_
                   _opts7784_))))
           (declare (not safe))
           (##structure std/actor/proto#!call::t __tmp14468 _token7786_))
         '#f
         '#t)
        (std/actor/proto#!!call-recv _token7786_ _dest7788_))))
  (define std/net/wamp#wamp-unregister
    (lambda (_cli7773_ _name7774_)
      (let ((_token7776_
             (let ()
               (declare (not safe))
               (##structure std/actor/proto#!token::t)))
            (_dest7778_ _cli7773_))
        (std/actor/message#send-message__%
         _dest7778_
         (let ((__tmp14469
                (let ()
                  (declare (not safe))
                  (##structure std/net/wamp#wamp.unregister::t _name7774_))))
           (declare (not safe))
           (##structure std/actor/proto#!call::t __tmp14469 _token7776_))
         '#f
         '#t)
        (std/actor/proto#!!call-recv _token7776_ _dest7778_))))
  (define std/net/wamp#wamp-close
    (lambda (_cli7767_)
      (let ((_tgroup7769_ (thread-thread-group _cli7767_)))
        (with-unwind-protect
         (lambda ()
           (std/actor/message#send-message__0
            _cli7767_
            (let ((__tmp14470
                   (let ()
                     (declare (not safe))
                     (##structure std/net/wamp#wamp.shutdown::t))))
              (declare (not safe))
              (##structure std/actor/proto#!event::t __tmp14470)))
           (thread-join! _cli7767_))
         (lambda () (std/misc/threads#thread-group-kill! _tgroup7769_))))))
  (define std/net/wamp#wamp::proto
    (let ((__tmp14471 (hash-copy std/actor/xdr#+xdr-default-type-registry+)))
      (declare (not safe))
      (##structure
       std/actor/proto#!protocol::t
       'std/net/wamp#wamp
       '()
       __tmp14471)))
  (define std/net/wamp#wamp.register::t
    (make-struct-type
     'std/net/wamp#wamp.register::t
     '#f
     '3
     'wamp.register
     '((final: . #t))
     '#f
     '(proc name opts)))
  (define std/net/wamp#wamp.register?
    (make-struct-predicate std/net/wamp#wamp.register::t))
  (define std/net/wamp#make-wamp.register
    (lambda _$args7764_
      (apply make-struct-instance std/net/wamp#wamp.register::t _$args7764_)))
  (define std/net/wamp#wamp.register-proc
    (make-struct-field-accessor std/net/wamp#wamp.register::t '0))
  (define std/net/wamp#wamp.register-name
    (make-struct-field-accessor std/net/wamp#wamp.register::t '1))
  (define std/net/wamp#wamp.register-opts
    (make-struct-field-accessor std/net/wamp#wamp.register::t '2))
  (define std/net/wamp#wamp.register-proc-set!
    (make-struct-field-mutator std/net/wamp#wamp.register::t '0))
  (define std/net/wamp#wamp.register-name-set!
    (make-struct-field-mutator std/net/wamp#wamp.register::t '1))
  (define std/net/wamp#wamp.register-opts-set!
    (make-struct-field-mutator std/net/wamp#wamp.register::t '2))
  (define std/net/wamp#xdr-wamp.register-read
    (lambda (_buffer7762_)
      (std/actor/xdr#xdr-read-struct
       std/net/wamp#wamp.register::t
       _buffer7762_)))
  (define std/net/wamp#xdr-wamp.register-write
    (lambda (_obj7759_ _buffer7760_)
      (std/actor/xdr#xdr-write-struct _obj7759_ _buffer7760_)))
  (define std/net/wamp#wamp.register::xdr
    (let ()
      (declare (not safe))
      (##structure
       std/actor/xdr#XDR::t
       std/net/wamp#xdr-wamp.register-read
       std/net/wamp#xdr-wamp.register-write)))
  (table-set!
   (##direct-structure-ref
    std/net/wamp#wamp::proto
    '3
    std/actor/proto#!protocol::t
    '#f)
   'std/net/wamp#wamp.register::t
   std/net/wamp#wamp.register::xdr)
  (define std/net/wamp#wamp.unregister::t
    (make-struct-type
     'std/net/wamp#wamp.unregister::t
     '#f
     '1
     'wamp.unregister
     '((final: . #t))
     '#f
     '(name)))
  (define std/net/wamp#wamp.unregister?
    (make-struct-predicate std/net/wamp#wamp.unregister::t))
  (define std/net/wamp#make-wamp.unregister
    (lambda _$args7756_
      (apply make-struct-instance
             std/net/wamp#wamp.unregister::t
             _$args7756_)))
  (define std/net/wamp#wamp.unregister-name
    (make-struct-field-accessor std/net/wamp#wamp.unregister::t '0))
  (define std/net/wamp#wamp.unregister-name-set!
    (make-struct-field-mutator std/net/wamp#wamp.unregister::t '0))
  (define std/net/wamp#xdr-wamp.unregister-read
    (lambda (_buffer7754_)
      (std/actor/xdr#xdr-read-struct
       std/net/wamp#wamp.unregister::t
       _buffer7754_)))
  (define std/net/wamp#xdr-wamp.unregister-write
    (lambda (_obj7751_ _buffer7752_)
      (std/actor/xdr#xdr-write-struct _obj7751_ _buffer7752_)))
  (define std/net/wamp#wamp.unregister::xdr
    (let ()
      (declare (not safe))
      (##structure
       std/actor/xdr#XDR::t
       std/net/wamp#xdr-wamp.unregister-read
       std/net/wamp#xdr-wamp.unregister-write)))
  (table-set!
   (##direct-structure-ref
    std/net/wamp#wamp::proto
    '3
    std/actor/proto#!protocol::t
    '#f)
   'std/net/wamp#wamp.unregister::t
   std/net/wamp#wamp.unregister::xdr)
  (define std/net/wamp#wamp.call::t
    (make-struct-type
     'std/net/wamp#wamp.call::t
     '#f
     '4
     'wamp.call
     '((final: . #t))
     '#f
     '(name opts args kws)))
  (define std/net/wamp#wamp.call?
    (make-struct-predicate std/net/wamp#wamp.call::t))
  (define std/net/wamp#make-wamp.call
    (lambda _$args7748_
      (apply make-struct-instance std/net/wamp#wamp.call::t _$args7748_)))
  (define std/net/wamp#wamp.call-name
    (make-struct-field-accessor std/net/wamp#wamp.call::t '0))
  (define std/net/wamp#wamp.call-opts
    (make-struct-field-accessor std/net/wamp#wamp.call::t '1))
  (define std/net/wamp#wamp.call-args
    (make-struct-field-accessor std/net/wamp#wamp.call::t '2))
  (define std/net/wamp#wamp.call-kws
    (make-struct-field-accessor std/net/wamp#wamp.call::t '3))
  (define std/net/wamp#wamp.call-name-set!
    (make-struct-field-mutator std/net/wamp#wamp.call::t '0))
  (define std/net/wamp#wamp.call-opts-set!
    (make-struct-field-mutator std/net/wamp#wamp.call::t '1))
  (define std/net/wamp#wamp.call-args-set!
    (make-struct-field-mutator std/net/wamp#wamp.call::t '2))
  (define std/net/wamp#wamp.call-kws-set!
    (make-struct-field-mutator std/net/wamp#wamp.call::t '3))
  (define std/net/wamp#xdr-wamp.call-read
    (lambda (_buffer7746_)
      (std/actor/xdr#xdr-read-struct std/net/wamp#wamp.call::t _buffer7746_)))
  (define std/net/wamp#xdr-wamp.call-write
    (lambda (_obj7743_ _buffer7744_)
      (std/actor/xdr#xdr-write-struct _obj7743_ _buffer7744_)))
  (define std/net/wamp#wamp.call::xdr
    (let ()
      (declare (not safe))
      (##structure
       std/actor/xdr#XDR::t
       std/net/wamp#xdr-wamp.call-read
       std/net/wamp#xdr-wamp.call-write)))
  (table-set!
   (##direct-structure-ref
    std/net/wamp#wamp::proto
    '3
    std/actor/proto#!protocol::t
    '#f)
   'std/net/wamp#wamp.call::t
   std/net/wamp#wamp.call::xdr)
  (define std/net/wamp#wamp.subscribe::t
    (make-struct-type
     'std/net/wamp#wamp.subscribe::t
     '#f
     '2
     'wamp.subscribe
     '((final: . #t))
     '#f
     '(topic opts)))
  (define std/net/wamp#wamp.subscribe?
    (make-struct-predicate std/net/wamp#wamp.subscribe::t))
  (define std/net/wamp#make-wamp.subscribe
    (lambda _$args7740_
      (apply make-struct-instance std/net/wamp#wamp.subscribe::t _$args7740_)))
  (define std/net/wamp#wamp.subscribe-topic
    (make-struct-field-accessor std/net/wamp#wamp.subscribe::t '0))
  (define std/net/wamp#wamp.subscribe-opts
    (make-struct-field-accessor std/net/wamp#wamp.subscribe::t '1))
  (define std/net/wamp#wamp.subscribe-topic-set!
    (make-struct-field-mutator std/net/wamp#wamp.subscribe::t '0))
  (define std/net/wamp#wamp.subscribe-opts-set!
    (make-struct-field-mutator std/net/wamp#wamp.subscribe::t '1))
  (define std/net/wamp#xdr-wamp.subscribe-read
    (lambda (_buffer7738_)
      (std/actor/xdr#xdr-read-struct
       std/net/wamp#wamp.subscribe::t
       _buffer7738_)))
  (define std/net/wamp#xdr-wamp.subscribe-write
    (lambda (_obj7735_ _buffer7736_)
      (std/actor/xdr#xdr-write-struct _obj7735_ _buffer7736_)))
  (define std/net/wamp#wamp.subscribe::xdr
    (let ()
      (declare (not safe))
      (##structure
       std/actor/xdr#XDR::t
       std/net/wamp#xdr-wamp.subscribe-read
       std/net/wamp#xdr-wamp.subscribe-write)))
  (table-set!
   (##direct-structure-ref
    std/net/wamp#wamp::proto
    '3
    std/actor/proto#!protocol::t
    '#f)
   'std/net/wamp#wamp.subscribe::t
   std/net/wamp#wamp.subscribe::xdr)
  (define std/net/wamp#wamp.unsubscribe::t
    (make-struct-type
     'std/net/wamp#wamp.unsubscribe::t
     '#f
     '1
     'wamp.unsubscribe
     '((final: . #t))
     '#f
     '(topic)))
  (define std/net/wamp#wamp.unsubscribe?
    (make-struct-predicate std/net/wamp#wamp.unsubscribe::t))
  (define std/net/wamp#make-wamp.unsubscribe
    (lambda _$args7732_
      (apply make-struct-instance
             std/net/wamp#wamp.unsubscribe::t
             _$args7732_)))
  (define std/net/wamp#wamp.unsubscribe-topic
    (make-struct-field-accessor std/net/wamp#wamp.unsubscribe::t '0))
  (define std/net/wamp#wamp.unsubscribe-topic-set!
    (make-struct-field-mutator std/net/wamp#wamp.unsubscribe::t '0))
  (define std/net/wamp#xdr-wamp.unsubscribe-read
    (lambda (_buffer7730_)
      (std/actor/xdr#xdr-read-struct
       std/net/wamp#wamp.unsubscribe::t
       _buffer7730_)))
  (define std/net/wamp#xdr-wamp.unsubscribe-write
    (lambda (_obj7727_ _buffer7728_)
      (std/actor/xdr#xdr-write-struct _obj7727_ _buffer7728_)))
  (define std/net/wamp#wamp.unsubscribe::xdr
    (let ()
      (declare (not safe))
      (##structure
       std/actor/xdr#XDR::t
       std/net/wamp#xdr-wamp.unsubscribe-read
       std/net/wamp#xdr-wamp.unsubscribe-write)))
  (table-set!
   (##direct-structure-ref
    std/net/wamp#wamp::proto
    '3
    std/actor/proto#!protocol::t
    '#f)
   'std/net/wamp#wamp.unsubscribe::t
   std/net/wamp#wamp.unsubscribe::xdr)
  (define std/net/wamp#wamp.publish::t
    (make-struct-type
     'std/net/wamp#wamp.publish::t
     '#f
     '4
     'wamp.publish
     '((final: . #t))
     '#f
     '(topic opts args kws)))
  (define std/net/wamp#wamp.publish?
    (make-struct-predicate std/net/wamp#wamp.publish::t))
  (define std/net/wamp#make-wamp.publish
    (lambda _$args7724_
      (apply make-struct-instance std/net/wamp#wamp.publish::t _$args7724_)))
  (define std/net/wamp#wamp.publish-topic
    (make-struct-field-accessor std/net/wamp#wamp.publish::t '0))
  (define std/net/wamp#wamp.publish-opts
    (make-struct-field-accessor std/net/wamp#wamp.publish::t '1))
  (define std/net/wamp#wamp.publish-args
    (make-struct-field-accessor std/net/wamp#wamp.publish::t '2))
  (define std/net/wamp#wamp.publish-kws
    (make-struct-field-accessor std/net/wamp#wamp.publish::t '3))
  (define std/net/wamp#wamp.publish-topic-set!
    (make-struct-field-mutator std/net/wamp#wamp.publish::t '0))
  (define std/net/wamp#wamp.publish-opts-set!
    (make-struct-field-mutator std/net/wamp#wamp.publish::t '1))
  (define std/net/wamp#wamp.publish-args-set!
    (make-struct-field-mutator std/net/wamp#wamp.publish::t '2))
  (define std/net/wamp#wamp.publish-kws-set!
    (make-struct-field-mutator std/net/wamp#wamp.publish::t '3))
  (define std/net/wamp#xdr-wamp.publish-read
    (lambda (_buffer7722_)
      (std/actor/xdr#xdr-read-struct
       std/net/wamp#wamp.publish::t
       _buffer7722_)))
  (define std/net/wamp#xdr-wamp.publish-write
    (lambda (_obj7719_ _buffer7720_)
      (std/actor/xdr#xdr-write-struct _obj7719_ _buffer7720_)))
  (define std/net/wamp#wamp.publish::xdr
    (let ()
      (declare (not safe))
      (##structure
       std/actor/xdr#XDR::t
       std/net/wamp#xdr-wamp.publish-read
       std/net/wamp#xdr-wamp.publish-write)))
  (table-set!
   (##direct-structure-ref
    std/net/wamp#wamp::proto
    '3
    std/actor/proto#!protocol::t
    '#f)
   'std/net/wamp#wamp.publish::t
   std/net/wamp#wamp.publish::xdr)
  (define std/net/wamp#wamp.event::t
    (make-struct-type
     'std/net/wamp#wamp.event::t
     '#f
     '4
     'wamp.event
     '((final: . #t))
     '#f
     '(topic details args kws)))
  (define std/net/wamp#wamp.event?
    (make-struct-predicate std/net/wamp#wamp.event::t))
  (define std/net/wamp#make-wamp.event
    (lambda _$args7716_
      (apply make-struct-instance std/net/wamp#wamp.event::t _$args7716_)))
  (define std/net/wamp#wamp.event-topic
    (make-struct-field-accessor std/net/wamp#wamp.event::t '0))
  (define std/net/wamp#wamp.event-details
    (make-struct-field-accessor std/net/wamp#wamp.event::t '1))
  (define std/net/wamp#wamp.event-args
    (make-struct-field-accessor std/net/wamp#wamp.event::t '2))
  (define std/net/wamp#wamp.event-kws
    (make-struct-field-accessor std/net/wamp#wamp.event::t '3))
  (define std/net/wamp#wamp.event-topic-set!
    (make-struct-field-mutator std/net/wamp#wamp.event::t '0))
  (define std/net/wamp#wamp.event-details-set!
    (make-struct-field-mutator std/net/wamp#wamp.event::t '1))
  (define std/net/wamp#wamp.event-args-set!
    (make-struct-field-mutator std/net/wamp#wamp.event::t '2))
  (define std/net/wamp#wamp.event-kws-set!
    (make-struct-field-mutator std/net/wamp#wamp.event::t '3))
  (define std/net/wamp#xdr-wamp.event-read
    (lambda (_buffer7714_)
      (std/actor/xdr#xdr-read-struct std/net/wamp#wamp.event::t _buffer7714_)))
  (define std/net/wamp#xdr-wamp.event-write
    (lambda (_obj7711_ _buffer7712_)
      (std/actor/xdr#xdr-write-struct _obj7711_ _buffer7712_)))
  (define std/net/wamp#wamp.event::xdr
    (let ()
      (declare (not safe))
      (##structure
       std/actor/xdr#XDR::t
       std/net/wamp#xdr-wamp.event-read
       std/net/wamp#xdr-wamp.event-write)))
  (table-set!
   (##direct-structure-ref
    std/net/wamp#wamp::proto
    '3
    std/actor/proto#!protocol::t
    '#f)
   'std/net/wamp#wamp.event::t
   std/net/wamp#wamp.event::xdr)
  (define std/net/wamp#wamp.shutdown::t
    (make-struct-type
     'std/net/wamp#wamp.shutdown::t
     '#f
     '0
     'wamp.shutdown
     '((final: . #t))
     '#f
     '()))
  (define std/net/wamp#wamp.shutdown?
    (make-struct-predicate std/net/wamp#wamp.shutdown::t))
  (define std/net/wamp#make-wamp.shutdown
    (lambda _$args7708_
      (apply make-struct-instance std/net/wamp#wamp.shutdown::t _$args7708_)))
  (define std/net/wamp#xdr-wamp.shutdown-read
    (lambda (_buffer7706_)
      (std/actor/xdr#xdr-read-struct
       std/net/wamp#wamp.shutdown::t
       _buffer7706_)))
  (define std/net/wamp#xdr-wamp.shutdown-write
    (lambda (_obj7703_ _buffer7704_)
      (std/actor/xdr#xdr-write-struct _obj7703_ _buffer7704_)))
  (define std/net/wamp#wamp.shutdown::xdr
    (let ()
      (declare (not safe))
      (##structure
       std/actor/xdr#XDR::t
       std/net/wamp#xdr-wamp.shutdown-read
       std/net/wamp#xdr-wamp.shutdown-write)))
  (table-set!
   (##direct-structure-ref
    std/net/wamp#wamp::proto
    '3
    std/actor/proto#!protocol::t
    '#f)
   'std/net/wamp#wamp.shutdown::t
   std/net/wamp#wamp.shutdown::xdr)
  (define std/net/wamp#wamp.receive::t
    (make-struct-type
     'std/net/wamp#wamp.receive::t
     '#f
     '1
     'wamp.receive
     '((final: . #t))
     '#f
     '(msg)))
  (define std/net/wamp#wamp.receive?
    (make-struct-predicate std/net/wamp#wamp.receive::t))
  (define std/net/wamp#make-wamp.receive
    (lambda _$args7700_
      (apply make-struct-instance std/net/wamp#wamp.receive::t _$args7700_)))
  (define std/net/wamp#wamp.receive-msg
    (make-struct-field-accessor std/net/wamp#wamp.receive::t '0))
  (define std/net/wamp#wamp.receive-msg-set!
    (make-struct-field-mutator std/net/wamp#wamp.receive::t '0))
  (define std/net/wamp#xdr-wamp.receive-read
    (lambda (_buffer7698_)
      (std/actor/xdr#xdr-read-struct
       std/net/wamp#wamp.receive::t
       _buffer7698_)))
  (define std/net/wamp#xdr-wamp.receive-write
    (lambda (_obj7695_ _buffer7696_)
      (std/actor/xdr#xdr-write-struct _obj7695_ _buffer7696_)))
  (define std/net/wamp#wamp.receive::xdr
    (let ()
      (declare (not safe))
      (##structure
       std/actor/xdr#XDR::t
       std/net/wamp#xdr-wamp.receive-read
       std/net/wamp#xdr-wamp.receive-write)))
  (table-set!
   (##direct-structure-ref
    std/net/wamp#wamp::proto
    '3
    std/actor/proto#!protocol::t
    '#f)
   'std/net/wamp#wamp.receive::t
   std/net/wamp#wamp.receive::xdr)
  (define std/net/wamp#wamp.close-connection::t
    (make-struct-type
     'std/net/wamp#wamp.close-connection::t
     '#f
     '1
     'wamp.close-connection
     '((final: . #t))
     '#f
     '(e)))
  (define std/net/wamp#wamp.close-connection?
    (make-struct-predicate std/net/wamp#wamp.close-connection::t))
  (define std/net/wamp#make-wamp.close-connection
    (lambda _$args7692_
      (apply make-struct-instance
             std/net/wamp#wamp.close-connection::t
             _$args7692_)))
  (define std/net/wamp#wamp.close-connection-e
    (make-struct-field-accessor std/net/wamp#wamp.close-connection::t '0))
  (define std/net/wamp#wamp.close-connection-e-set!
    (make-struct-field-mutator std/net/wamp#wamp.close-connection::t '0))
  (define std/net/wamp#xdr-wamp.close-connection-read
    (lambda (_buffer7690_)
      (std/actor/xdr#xdr-read-struct
       std/net/wamp#wamp.close-connection::t
       _buffer7690_)))
  (define std/net/wamp#xdr-wamp.close-connection-write
    (lambda (_obj7687_ _buffer7688_)
      (std/actor/xdr#xdr-write-struct _obj7687_ _buffer7688_)))
  (define std/net/wamp#wamp.close-connection::xdr
    (let ()
      (declare (not safe))
      (##structure
       std/actor/xdr#XDR::t
       std/net/wamp#xdr-wamp.close-connection-read
       std/net/wamp#xdr-wamp.close-connection-write)))
  (table-set!
   (##direct-structure-ref
    std/net/wamp#wamp::proto
    '3
    std/actor/proto#!protocol::t
    '#f)
   'std/net/wamp#wamp.close-connection::t
   std/net/wamp#wamp.close-connection::xdr)
  (define std/net/wamp#wamp.remove-thread::t
    (make-struct-type
     'std/net/wamp#wamp.remove-thread::t
     '#f
     '1
     'wamp.remove-thread
     '((final: . #t))
     '#f
     '(e)))
  (define std/net/wamp#wamp.remove-thread?
    (make-struct-predicate std/net/wamp#wamp.remove-thread::t))
  (define std/net/wamp#make-wamp.remove-thread
    (lambda _$args7684_
      (apply make-struct-instance
             std/net/wamp#wamp.remove-thread::t
             _$args7684_)))
  (define std/net/wamp#wamp.remove-thread-e
    (make-struct-field-accessor std/net/wamp#wamp.remove-thread::t '0))
  (define std/net/wamp#wamp.remove-thread-e-set!
    (make-struct-field-mutator std/net/wamp#wamp.remove-thread::t '0))
  (define std/net/wamp#xdr-wamp.remove-thread-read
    (lambda (_buffer7682_)
      (std/actor/xdr#xdr-read-struct
       std/net/wamp#wamp.remove-thread::t
       _buffer7682_)))
  (define std/net/wamp#xdr-wamp.remove-thread-write
    (lambda (_obj7679_ _buffer7680_)
      (std/actor/xdr#xdr-write-struct _obj7679_ _buffer7680_)))
  (define std/net/wamp#wamp.remove-thread::xdr
    (let ()
      (declare (not safe))
      (##structure
       std/actor/xdr#XDR::t
       std/net/wamp#xdr-wamp.remove-thread-read
       std/net/wamp#xdr-wamp.remove-thread-write)))
  (table-set!
   (##direct-structure-ref
    std/net/wamp#wamp::proto
    '3
    std/actor/proto#!protocol::t
    '#f)
   'std/net/wamp#wamp.remove-thread::t
   std/net/wamp#wamp.remove-thread::xdr)
  (define std/net/wamp#wamp.close-stream::t
    (make-struct-type
     'std/net/wamp#wamp.close-stream::t
     '#f
     '0
     'wamp.close-stream
     '((final: . #t))
     '#f
     '()))
  (define std/net/wamp#wamp.close-stream?
    (make-struct-predicate std/net/wamp#wamp.close-stream::t))
  (define std/net/wamp#make-wamp.close-stream
    (lambda _$args7676_
      (apply make-struct-instance
             std/net/wamp#wamp.close-stream::t
             _$args7676_)))
  (define std/net/wamp#xdr-wamp.close-stream-read
    (lambda (_buffer7674_)
      (std/actor/xdr#xdr-read-struct
       std/net/wamp#wamp.close-stream::t
       _buffer7674_)))
  (define std/net/wamp#xdr-wamp.close-stream-write
    (lambda (_obj7669_ _buffer7671_)
      (std/actor/xdr#xdr-write-struct _obj7669_ _buffer7671_)))
  (define std/net/wamp#wamp.close-stream::xdr
    (let ()
      (declare (not safe))
      (##structure
       std/actor/xdr#XDR::t
       std/net/wamp#xdr-wamp.close-stream-read
       std/net/wamp#xdr-wamp.close-stream-write)))
  (table-set!
   (##direct-structure-ref
    std/net/wamp#wamp::proto
    '3
    std/actor/proto#!protocol::t
    '#f)
   'std/net/wamp#wamp.close-stream::t
   std/net/wamp#wamp.close-stream::xdr)
  (define std/net/wamp#wamp-client
    (lambda (_ws6084_ _realm6085_ _sid6086_)
      (letrec* ((_pend-calls6088_ (make-table 'test: eqv?))
                (_pend-subscriptions6089_ (make-table 'test: eqv?))
                (_pend-topic-subscriptions6090_ (make-table))
                (_subscriptions6091_ (make-table 'test: eqv?))
                (_topic-subscription-ids6092_ (make-table))
                (_topic-subscriptions6093_ (make-table))
                (_actor-subscriptions6094_ (make-table 'test: eq?))
                (_pend-registrations6095_ (make-table 'test: eqv?))
                (_registrations6096_ (make-table 'test: eqv?))
                (_procedure-registrations6097_ (make-table))
                (_pend-unregistrations6098_ (make-table 'test: eqv?))
                (_reader6099_
                 (gerbil/gambit/threads#spawn/name
                  'wamp-reader
                  std/net/wamp#wamp-reader
                  (current-thread)
                  _ws6084_))
                (_monitor-thread6100_
                 (lambda (_thread7661_)
                   (letrec ((_monitor7663_
                             (lambda (_cli7665_ _thread7666_)
                               (with-exception-catcher
                                void
                                (lambda () (thread-join! _thread7666_)))
                               (std/actor/message#send-message__0
                                _cli7665_
                                (let ((__tmp14472
                                       (let ()
                                         (declare (not safe))
                                         (##structure
                                          std/net/wamp#wamp.remove-thread::t
                                          _thread7666_))))
                                  (declare (not safe))
                                  (##structure
                                   std/actor/proto#!event::t
                                   __tmp14472))))))
                     (gerbil/gambit/threads#spawn/name
                      'wamp-monitor
                      _monitor7663_
                      (current-thread)
                      _thread7661_))))
                (_remove-thread!6101_
                 (lambda (_thread7649_)
                   (let ((_topics76507652_
                          (table-ref
                           _actor-subscriptions6094_
                           _thread7649_
                           '#f)))
                     (if _topics76507652_
                         (let ((_topics7655_ _topics76507652_))
                           (for-each
                            (lambda (_g76567658_)
                              (_remove-subscription!6102_
                               _g76567658_
                               _thread7649_))
                            _topics7655_)
                           (table-set! _actor-subscriptions6094_ _thread7649_))
                         '#f))))
                (_remove-subscription!6102_
                 (lambda (_topic7637_ _thread7638_)
                   (let* ((_subs7640_
                           (table-ref _topic-subscriptions6093_ _topic7637_))
                          (_subs7642_ (remq _thread7638_ _subs7640_)))
                     (if (null? _subs7642_)
                         (let ((_subid7645_
                                (table-ref
                                 _topic-subscription-ids6092_
                                 _topic7637_)))
                           (table-set! _subscriptions6091_ _subid7645_)
                           (table-set! _topic-subscriptions6093_ _topic7637_)
                           (table-set!
                            _topic-subscription-ids6092_
                            _topic7637_)
                           (let ((_reqid7647_ (_request-id6109_)))
                             (std/net/wamp#wamp-send
                              _ws6084_
                              (cons '34
                                    (cons _reqid7647_
                                          (cons _subid7645_ '()))))))
                         (table-set!
                          _topic-subscriptions6093_
                          _topic7637_
                          _subs7642_)))))
                (_remove-actor-subscription!6103_
                 (lambda (_topic7626_ _thread7627_)
                   (let ((_topics76287630_
                          (table-ref
                           _actor-subscriptions6094_
                           _thread7627_
                           '#f)))
                     (if _topics76287630_
                         (let ((_topics7633_ _topics76287630_))
                           (let ((_topics7635_
                                  (remove _topic7626_ _topics7633_)))
                             (if (null? _topics7635_)
                                 (table-set!
                                  _actor-subscriptions6094_
                                  _thread7627_)
                                 (table-set!
                                  _actor-subscriptions6094_
                                  _thread7627_
                                  _topics7635_)))
                           (_remove-subscription!6102_
                            _topic7626_
                            _thread7627_))
                         '#f))))
                (_add-actor-subscription!6104_
                 (lambda (_topic7618_ _thread7619_)
                   (let ((_$e7621_
                          (table-ref
                           _actor-subscriptions6094_
                           _thread7619_
                           '#f)))
                     (if _$e7621_
                         ((lambda (_topics7624_)
                            (table-set!
                             _actor-subscriptions6094_
                             _thread7619_
                             (cons _topic7618_ _topics7624_)))
                          _$e7621_)
                         (begin
                           (_monitor-thread6100_ _thread7619_)
                           (table-set!
                            _actor-subscriptions6094_
                            _thread7619_
                            (cons _topic7618_ '())))))))
                (_invoke6105_
                 (lambda (_proc7491_ _reqid7492_ _details7493_ _rest7494_)
                   (let ((_vals7561_
                          (let* ((_rest74957510_ _rest7494_)
                                 (_E74997514_
                                  (lambda ()
                                    (error '"No clause matching"
                                           _rest74957510_))))
                            (let ((_K75087558_
                                   (lambda () (values _details7493_ '() '#f)))
                                  (_K75057544_
                                   (lambda (_args7542_)
                                     (values _details7493_ _args7542_ '#f)))
                                  (_K75007521_
                                   (lambda (_kws7518_ _args7519_)
                                     (values _details7493_
                                             _args7519_
                                             _kws7518_))))
                              (let ((_try-match74977554_
                                     (lambda ()
                                       (if (let ()
                                             (declare (not safe))
                                             (##pair? _rest74957510_))
                                           (let ((_tl75077549_
                                                  (let ()
                                                    (declare (not safe))
                                                    (##cdr _rest74957510_)))
                                                 (_hd75067547_
                                                  (let ()
                                                    (declare (not safe))
                                                    (##car _rest74957510_))))
                                             (if (let ()
                                                   (declare (not safe))
                                                   (##null? _tl75077549_))
                                                 (let ((_args7552_
                                                        _hd75067547_))
                                                   (_K75057544_ _args7552_))
                                                 (if (let ()
                                                       (declare (not safe))
                                                       (##pair? _tl75077549_))
                                                     (let ((_tl75047533_
                                                            (let ()
                                                              (declare
                                                                (not safe))
                                                              (##cdr _tl75077549_)))
                                                           (_hd75037531_
                                                            (let ()
                                                              (declare
                                                                (not safe))
                                                              (##car _tl75077549_))))
                                                       (if (let ()
                                                             (declare
                                                               (not safe))
                                                             (##null? _tl75047533_))
                                                           (let ((_args7529_
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          _hd75067547_)
                         (_kws7536_ _hd75037531_))
                     (_K75007521_ _kws7536_ _args7529_))
                   (_E74997514_)))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                     (_E74997514_))))
                                           (_E74997514_)))))
                                (if (let ()
                                      (declare (not safe))
                                      (##null? _rest74957510_))
                                    (_K75087558_)
                                    (_try-match74977554_)))))))
                     (with-exception-catcher
                      (lambda (_g75627564_)
                        (if ((lambda (_$obj7567_)
                               (let ()
                                 (declare (not safe))
                                 (##structure-direct-instance-of?
                                  _$obj7567_
                                  'std/net/wamp#invocation-error::t)))
                             _g75627564_)
                            (let ((_e7570_ _g75627564_))
                              (std/net/wamp#wamp-send
                               _ws6084_
                               (cons '8
                                     (cons '68
                                           (cons _reqid7492_
                                                 (cons (##direct-structure-ref
                                                        _e7570_
                                                        '2
                                                        std/net/wamp#invocation-error::t
                                                        '#f)
                                                       (cons (##direct-structure-ref
                                                              _e7570_
                                                              '1
                                                              std/net/wamp#invocation-error::t
                                                              '#f)
                                                             (##direct-structure-ref
                                                              _e7570_
                                                              '3
                                                              std/net/wamp#invocation-error::t
                                                              '#f))))))))
                            (if '#t
                                (let ((_e7572_ _g75627564_))
                                  (std/logger#log-error
                                   '"invocation error"
                                   _e7572_)
                                  (std/net/wamp#wamp-send
                                   _ws6084_
                                   (cons '8
                                         (cons '68
                                               (cons _reqid7492_
                                                     (cons (let ((_ht7574_
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          (make-table 'size: '1)))
                     (table-set! _ht7574_ 'message '"Internal Server Error")
                     _ht7574_)
                   (cons '"internal_server_error" '())))))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                (raise _g75627564_))))
                      (lambda ()
                        (let* ((_g75777586_
                                (call-with-values
                                 (lambda () _vals7561_)
                                 _proc7491_))
                               (_E75797590_
                                (lambda ()
                                  (error '"No clause matching" _g75777586_)))
                               (_K75807600_
                                (lambda (_kws7593_ _args7594_ _opts7595_)
                                  (std/net/wamp#wamp-send
                                   _ws6084_
                                   (cons '70
                                         (cons _reqid7492_
                                               (cons (let ((_$e7597_
                                                            _opts7595_))
                                                       (if _$e7597_
                                                           _$e7597_
                                                           std/net/wamp#empty-hash))
                                                     (_message-tail6110_
                                                      _args7594_
                                                      _kws7593_))))))))
                          (if (let ((__tmp14473
                                     (if (let ()
                                           (declare (not safe))
                                           (##values? _g75777586_))
                                         (let ()
                                           (declare (not safe))
                                           (##vector-length _g75777586_))
                                         '1)))
                                (declare (not safe))
                                (##fx= __tmp14473 '3))
                              (let* ((_e75817603_
                                      (let ()
                                        (declare (not safe))
                                        (##vector-ref _g75777586_ '0)))
                                     (_opts7606_ _e75817603_)
                                     (_e75827608_
                                      (let ()
                                        (declare (not safe))
                                        (##vector-ref _g75777586_ '1)))
                                     (_args7611_ _e75827608_)
                                     (_e75837613_
                                      (let ()
                                        (declare (not safe))
                                        (##vector-ref _g75777586_ '2)))
                                     (_kws7616_ _e75837613_))
                                (_K75807600_ _kws7616_ _args7611_ _opts7606_))
                              (_E75797590_))))))))
                (_receive6106_
                 (lambda (_msg6609_)
                   (let* ((_msg66106688_ _msg6609_)
                          (_else66206696_
                           (lambda ()
                             (std/logger#warning
                              '"unexpected message: ~a"
                              _msg6609_))))
                     (let ((_K66787456_
                            (lambda (_rest7375_
                                     _details7376_
                                     _pubid7377_
                                     _subid7378_)
                              (let ((_topic73797381_
                                     (table-ref
                                      _subscriptions6091_
                                      _subid7378_
                                      '#f)))
                                (if _topic73797381_
                                    (let ((_topic7384_ _topic73797381_))
                                      (let ((_actors7451_
                                             (table-ref
                                              _topic-subscriptions6093_
                                              _topic7384_))
                                            (_evt7452_
                                             (let* ((_rest73857400_ _rest7375_)
                                                    (_E73897404_
                                                     (lambda ()
                                                       (error '"No clause matching"
                                                              _rest73857400_))))
                                               (let ((_K73987448_
                                                      (lambda ()
                                                        (let ()
                                                          (declare (not safe))
                                                          (##structure
                                                           std/net/wamp#wamp.event::t
                                                           _topic7384_
                                                           _details7376_
                                                           '()
                                                           '#f))))
                                                     (_K73957434_
                                                      (lambda (_args7432_)
                                                        (let ()
                                                          (declare (not safe))
                                                          (##structure
                                                           std/net/wamp#wamp.event::t
                                                           _topic7384_
                                                           _details7376_
                                                           _args7432_
                                                           '#f))))
                                                     (_K73907411_
                                                      (lambda (_kws7408_
                                                               _args7409_)
                                                        (let ()
                                                          (declare (not safe))
                                                          (##structure
                                                           std/net/wamp#wamp.event::t
                                                           _topic7384_
                                                           _details7376_
                                                           _args7409_
                                                           _kws7408_)))))
                                                 (let ((_try-match73877444_
                                                        (lambda ()
                                                          (if (let ()
                                                                (declare
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          (not safe))
                        (##pair? _rest73857400_))
                      (let ((_tl73977439_
                             (let ()
                               (declare (not safe))
                               (##cdr _rest73857400_)))
                            (_hd73967437_
                             (let ()
                               (declare (not safe))
                               (##car _rest73857400_))))
                        (if (let ()
                              (declare (not safe))
                              (##null? _tl73977439_))
                            (let ((_args7442_ _hd73967437_))
                              (_K73957434_ _args7442_))
                            (if (let ()
                                  (declare (not safe))
                                  (##pair? _tl73977439_))
                                (let ((_tl73947423_
                                       (let ()
                                         (declare (not safe))
                                         (##cdr _tl73977439_)))
                                      (_hd73937421_
                                       (let ()
                                         (declare (not safe))
                                         (##car _tl73977439_))))
                                  (if (let ()
                                        (declare (not safe))
                                        (##null? _tl73947423_))
                                      (let ((_args7419_ _hd73967437_)
                                            (_kws7426_ _hd73937421_))
                                        (_K73907411_ _kws7426_ _args7419_))
                                      (_E73897404_)))
                                (_E73897404_))))
                      (_E73897404_)))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                   (if (let ()
                                                         (declare (not safe))
                                                         (##null? _rest73857400_))
                                                       (_K73987448_)
                                                       (_try-match73877444_)))))))
                                        (for-each
                                         (lambda (_thread7454_)
                                           (std/actor/message#send-message__0
                                            _thread7454_
                                            (let ()
                                              (declare (not safe))
                                              (##structure
                                               std/actor/proto#!event::t
                                               _evt7452_))))
                                         _actors7451_)))
                                    '#f))))
                           (_K66717344_
                            (lambda (_rest7245_ _details7246_ _reqid7247_)
                              (let* ((_g72487255_
                                      (table-ref _pend-calls6088_ _reqid7247_))
                                     (_E72507259_
                                      (lambda ()
                                        (error '"No clause matching"
                                               _g72487255_)))
                                     (_K72517332_
                                      (lambda (_k7262_ _src7263_)
                                        (table-set!
                                         _pend-calls6088_
                                         _reqid7247_)
                                        (let ((_val7330_
                                               (let* ((_rest72647279_
                                                       _rest7245_)
                                                      (_E72687283_
                                                       (lambda ()
                                                         (error '"No clause matching"
                                                                _rest72647279_))))
                                                 (let ((_K72777327_
                                                        (lambda ()
                                                          (values _details7246_
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          '()
                          '#f)))
               (_K72747313_
                (lambda (_args7311_) (values _details7246_ _args7311_ '#f)))
               (_K72697290_
                (lambda (_kws7287_ _args7288_)
                  (values _details7246_ _args7288_ _kws7287_))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                   (let ((_try-match72667323_
                                                          (lambda ()
                                                            (if (let ()
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          (declare (not safe))
                          (##pair? _rest72647279_))
                        (let ((_tl72767318_
                               (let ()
                                 (declare (not safe))
                                 (##cdr _rest72647279_)))
                              (_hd72757316_
                               (let ()
                                 (declare (not safe))
                                 (##car _rest72647279_))))
                          (if (let ()
                                (declare (not safe))
                                (##null? _tl72767318_))
                              (let ((_args7321_ _hd72757316_))
                                (_K72747313_ _args7321_))
                              (if (let ()
                                    (declare (not safe))
                                    (##pair? _tl72767318_))
                                  (let ((_tl72737302_
                                         (let ()
                                           (declare (not safe))
                                           (##cdr _tl72767318_)))
                                        (_hd72727300_
                                         (let ()
                                           (declare (not safe))
                                           (##car _tl72767318_))))
                                    (if (let ()
                                          (declare (not safe))
                                          (##null? _tl72737302_))
                                        (let ((_args7298_ _hd72757316_)
                                              (_kws7305_ _hd72727300_))
                                          (_K72697290_ _kws7305_ _args7298_))
                                        (_E72687283_)))
                                  (_E72687283_))))
                        (_E72687283_)))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                     (if (let ()
                                                           (declare (not safe))
                                                           (##null? _rest72647279_))
                                                         (_K72777327_)
                                                         (_try-match72667323_)))))))
                                          (std/actor/message#send-message__%
                                           _src7263_
                                           (let ()
                                             (declare (not safe))
                                             (##structure
                                              std/actor/proto#!value::t
                                              _val7330_
                                              _k7262_))
                                           '#f
                                           '#f)))))
                                (if (let ()
                                      (declare (not safe))
                                      (##pair? _g72487255_))
                                    (let ((_hd72527335_
                                           (let ()
                                             (declare (not safe))
                                             (##car _g72487255_)))
                                          (_tl72537337_
                                           (let ()
                                             (declare (not safe))
                                             (##cdr _g72487255_))))
                                      (let* ((_src7340_ _hd72527335_)
                                             (_k7342_ _tl72537337_))
                                        (_K72517332_ _k7342_ _src7340_)))
                                    (_E72507259_)))))
                           (_K66627206_
                            (lambda (_rest7173_
                                     _details7174_
                                     _regid7175_
                                     _reqid7176_)
                              (let* ((_g71777184_
                                      (table-ref
                                       _registrations6096_
                                       _regid7175_))
                                     (_E71797188_
                                      (lambda ()
                                        (error '"No clause matching"
                                               _g71777184_)))
                                     (_K71807194_
                                      (lambda (_proc7191_ _name7192_)
                                        (gerbil/gambit/threads#spawn/name
                                         'wamp-invocation
                                         _invoke6105_
                                         _proc7191_
                                         _reqid7176_
                                         _details7174_
                                         _rest7173_))))
                                (if (let ()
                                      (declare (not safe))
                                      (##pair? _g71777184_))
                                    (let ((_hd71817197_
                                           (let ()
                                             (declare (not safe))
                                             (##car _g71777184_)))
                                          (_tl71827199_
                                           (let ()
                                             (declare (not safe))
                                             (##cdr _g71777184_))))
                                      (let* ((_name7202_ _hd71817197_)
                                             (_proc7204_ _tl71827199_))
                                        (_K71807194_ _proc7204_ _name7202_)))
                                    (_E71797188_)))))
                           (_K66557143_
                            (lambda (_subid7103_ _reqid7104_)
                              (let* ((_topic7106_
                                      (table-ref
                                       _pend-subscriptions6089_
                                       _reqid7104_))
                                     (_pend7108_
                                      (table-ref
                                       _pend-topic-subscriptions6090_
                                       _topic7106_)))
                                (table-set!
                                 _subscriptions6091_
                                 _subid7103_
                                 _topic7106_)
                                (table-set!
                                 _topic-subscriptions6093_
                                 _topic7106_
                                 (map car _pend7108_))
                                (table-set!
                                 _topic-subscription-ids6092_
                                 _topic7106_
                                 _subid7103_)
                                (for-each
                                 (lambda (_e71107112_)
                                   (let* ((_g71147121_ _e71107112_)
                                          (_E71167125_
                                           (lambda ()
                                             (error '"No clause matching"
                                                    _g71147121_)))
                                          (_K71177131_
                                           (lambda (_k7128_ _src7129_)
                                             (_add-actor-subscription!6104_
                                              _topic7106_
                                              _src7129_)
                                             (std/actor/message#send-message__%
                                              _src7129_
                                              (let ()
                                                (declare (not safe))
                                                (##structure
                                                 std/actor/proto#!value::t
                                                 '#!void
                                                 _k7128_))
                                              '#f
                                              '#f))))
                                     (if (let ()
                                           (declare (not safe))
                                           (##pair? _g71147121_))
                                         (let ((_hd71187134_
                                                (let ()
                                                  (declare (not safe))
                                                  (##car _g71147121_)))
                                               (_tl71197136_
                                                (let ()
                                                  (declare (not safe))
                                                  (##cdr _g71147121_))))
                                           (let* ((_src7139_ _hd71187134_)
                                                  (_k7141_ _tl71197136_))
                                             (_K71177131_ _k7141_ _src7139_)))
                                         (_E71167125_))))
                                 _pend7108_))))
                           (_K66527089_ (lambda () '#!void))
                           (_K66457058_
                            (lambda (_regid6970_ _reqid6971_)
                              (let* ((_g69726979_
                                      (table-ref
                                       _pend-registrations6095_
                                       _reqid6971_))
                                     (_E69746983_
                                      (lambda ()
                                        (error '"No clause matching"
                                               _g69726979_)))
                                     (_K69757046_
                                      (lambda (_reg6986_ _pend6987_)
                                        (let* ((_pend69886995_ _pend6987_)
                                               (_E69906999_
                                                (lambda ()
                                                  (error '"No clause matching"
                                                         _pend69886995_)))
                                               (_K69917034_
                                                (lambda (_k7002_ _src7003_)
                                                  (let* ((_reg70047011_
                                                          _reg6986_)
                                                         (_E70067015_
                                                          (lambda ()
                                                            (error '"No clause matching"
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                           _reg70047011_)))
                 (_K70077022_
                  (lambda (_proc7018_ _name7019_)
                    (let ()
                      (table-set! _pend-registrations6095_ _reqid6971_)
                      (table-set! _registrations6096_ _regid6970_ _reg6986_)
                      (table-set!
                       _procedure-registrations6097_
                       _name7019_
                       _regid6970_)
                      (std/actor/message#send-message__%
                       _src7003_
                       (let ()
                         (declare (not safe))
                         (##structure
                          std/actor/proto#!value::t
                          '#!void
                          _k7002_))
                       '#f
                       '#f)))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                    (if (let ()
                                                          (declare (not safe))
                                                          (##pair? _reg70047011_))
                                                        (let ((_hd70087025_
                                                               (let ()
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                         (declare (not safe))
                         (##car _reg70047011_)))
                      (_tl70097027_
                       (let () (declare (not safe)) (##cdr _reg70047011_))))
                  (let* ((_name7030_ _hd70087025_) (_proc7032_ _tl70097027_))
                    (_K70077022_ _proc7032_ _name7030_)))
                (_E70067015_))))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                          (if (let ()
                                                (declare (not safe))
                                                (##pair? _pend69886995_))
                                              (let ((_hd69927037_
                                                     (let ()
                                                       (declare (not safe))
                                                       (##car _pend69886995_)))
                                                    (_tl69937039_
                                                     (let ()
                                                       (declare (not safe))
                                                       (##cdr _pend69886995_))))
                                                (let* ((_src7042_ _hd69927037_)
                                                       (_k7044_ _tl69937039_))
                                                  (_K69917034_
                                                   _k7044_
                                                   _src7042_)))
                                              (_E69906999_))))))
                                (if (let ()
                                      (declare (not safe))
                                      (##pair? _g69726979_))
                                    (let ((_hd69767049_
                                           (let ()
                                             (declare (not safe))
                                             (##car _g69726979_)))
                                          (_tl69777051_
                                           (let ()
                                             (declare (not safe))
                                             (##cdr _g69726979_))))
                                      (let* ((_pend7054_ _hd69767049_)
                                             (_reg7056_ _tl69777051_))
                                        (_K69757046_ _reg7056_ _pend7054_)))
                                    (_E69746983_)))))
                           (_K66406947_
                            (lambda (_reqid6860_)
                              (let* ((_g68616868_
                                      (table-ref
                                       _pend-unregistrations6098_
                                       _reqid6860_))
                                     (_E68636872_
                                      (lambda ()
                                        (error '"No clause matching"
                                               _g68616868_)))
                                     (_K68646935_
                                      (lambda (_regid6875_ _pend6876_)
                                        (let* ((_pend68776884_ _pend6876_)
                                               (_E68796888_
                                                (lambda ()
                                                  (error '"No clause matching"
                                                         _pend68776884_)))
                                               (_K68806923_
                                                (lambda (_k6891_ _src6892_)
                                                  (let* ((_g68936900_
                                                          (table-ref
                                                           _registrations6096_
                                                           _regid6875_))
                                                         (_E68956904_
                                                          (lambda ()
                                                            (error '"No clause matching"
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                           _g68936900_)))
                 (_K68966911_
                  (lambda (_proc6907_ _name6908_)
                    (let ()
                      (table-set! _pend-unregistrations6098_ _reqid6860_)
                      (table-set! _registrations6096_ _regid6875_)
                      (table-set! _procedure-registrations6097_ _name6908_)
                      (std/actor/message#send-message__%
                       _src6892_
                       (let ()
                         (declare (not safe))
                         (##structure
                          std/actor/proto#!value::t
                          '#!void
                          _k6891_))
                       '#f
                       '#f)))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                    (if (let ()
                                                          (declare (not safe))
                                                          (##pair? _g68936900_))
                                                        (let ((_hd68976914_
                                                               (let ()
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                         (declare (not safe))
                         (##car _g68936900_)))
                      (_tl68986916_
                       (let () (declare (not safe)) (##cdr _g68936900_))))
                  (let* ((_name6919_ _hd68976914_) (_proc6921_ _tl68986916_))
                    (_K68966911_ _proc6921_ _name6919_)))
                (_E68956904_))))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                          (if (let ()
                                                (declare (not safe))
                                                (##pair? _pend68776884_))
                                              (let ((_hd68816926_
                                                     (let ()
                                                       (declare (not safe))
                                                       (##car _pend68776884_)))
                                                    (_tl68826928_
                                                     (let ()
                                                       (declare (not safe))
                                                       (##cdr _pend68776884_))))
                                                (let* ((_src6931_ _hd68816926_)
                                                       (_k6933_ _tl68826928_))
                                                  (_K68806923_
                                                   _k6933_
                                                   _src6931_)))
                                              (_E68796888_))))))
                                (if (let ()
                                      (declare (not safe))
                                      (##pair? _g68616868_))
                                    (let ((_hd68656938_
                                           (let ()
                                             (declare (not safe))
                                             (##car _g68616868_)))
                                          (_tl68666940_
                                           (let ()
                                             (declare (not safe))
                                             (##cdr _g68616868_))))
                                      (let* ((_pend6943_ _hd68656938_)
                                             (_regid6945_ _tl68666940_))
                                        (_K68646935_ _regid6945_ _pend6943_)))
                                    (_E68636872_)))))
                           (_K66296814_
                            (lambda (_rest6733_
                                     _err6734_
                                     _details6735_
                                     _reqid6736_
                                     _what6737_)
                              (if (eq? _what6737_ '48)
                                  (let ((_pend6739_
                                         (table-ref
                                          _pend-calls6088_
                                          _reqid6736_)))
                                    (table-set! _pend-calls6088_ _reqid6736_)
                                    (let ((_err6741_
                                           (apply std/net/wamp#make-wamp-error
                                                  'CALL
                                                  _err6734_
                                                  _details6735_
                                                  _rest6733_)))
                                      (_send-pend-error6113_
                                       _pend6739_
                                       _err6741_)))
                                  (if (eq? _what6737_ '32)
                                      (let* ((_topic6743_
                                              (table-ref
                                               _pend-subscriptions6089_
                                               _reqid6736_))
                                             (_pend6745_
                                              (table-ref
                                               _pend-topic-subscriptions6090_
                                               _topic6743_)))
                                        (table-set!
                                         _pend-subscriptions6089_
                                         _reqid6736_)
                                        (table-set!
                                         _pend-topic-subscriptions6090_
                                         _topic6743_)
                                        (let ((_err6748_
                                               (apply std/net/wamp#make-wamp-error
                                                      'SUBSCRIBE
                                                      _err6734_
                                                      _details6735_
                                                      _rest6733_)))
                                          (for-each
                                           (lambda (_g67496751_)
                                             (_send-pend-error6113_
                                              _g67496751_
                                              _err6748_))
                                           _pend6745_)))
                                      (if (eq? _what6737_ '64)
                                          (let* ((_g67536760_
                                                  (table-ref
                                                   _pend-registrations6095_
                                                   _reqid6736_))
                                                 (_E67556764_
                                                  (lambda ()
                                                    (error '"No clause matching"
                                                           _g67536760_)))
                                                 (_K67566772_
                                                  (lambda (_reg6767_
                                                           _pend6768_)
                                                    (table-set!
                                                     _pend-registrations6095_
                                                     _reqid6736_)
                                                    (let ((_err6770_
                                                           (apply std/net/wamp#make-wamp-error
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          'REGISTER
                          _err6734_
                          _details6735_
                          _rest6733_)))
              (_send-pend-error6113_ _pend6768_ _err6770_)))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                            (if (let ()
                                                  (declare (not safe))
                                                  (##pair? _g67536760_))
                                                (let ((_hd67576775_
                                                       (let ()
                                                         (declare (not safe))
                                                         (##car _g67536760_)))
                                                      (_tl67586777_
                                                       (let ()
                                                         (declare (not safe))
                                                         (##cdr _g67536760_))))
                                                  (let* ((_pend6780_
                                                          _hd67576775_)
                                                         (_reg6782_
                                                          _tl67586777_))
                                                    (_K67566772_
                                                     _reg6782_
                                                     _pend6780_)))
                                                (_E67556764_)))
                                          (if (eq? _what6737_ '66)
                                              (let* ((_g67836790_
                                                      (table-ref
                                                       _pend-unregistrations6098_
                                                       _reqid6736_))
                                                     (_E67856794_
                                                      (lambda ()
                                                        (error '"No clause matching"
                                                               _g67836790_)))
                                                     (_K67866802_
                                                      (lambda (_regid6797_
                                                               _pend6798_)
                                                        (table-set!
                                                         _pend-unregistrations6098_
                                                         _reqid6736_)
                                                        (let ((_err6800_
                                                               (apply std/net/wamp#make-wamp-error
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                              'UNREGISTER
                              _err6734_
                              _details6735_
                              _rest6733_)))
                  (_send-pend-error6113_ _pend6798_ _err6800_)))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                (if (let ()
                                                      (declare (not safe))
                                                      (##pair? _g67836790_))
                                                    (let ((_hd67876805_
                                                           (let ()
                                                             (declare
                                                               (not safe))
                                                             (##car _g67836790_)))
                                                          (_tl67886807_
                                                           (let ()
                                                             (declare
                                                               (not safe))
                                                             (##cdr _g67836790_))))
                                                      (let* ((_pend6810_
                                                              _hd67876805_)
                                                             (_regid6812_
                                                              _tl67886807_))
                                                        (_K67866802_
                                                         _regid6812_
                                                         _pend6810_)))
                                                    (_E67856794_)))
                                              (std/logger#warning
                                               '"unexpected ERROR: ~a ~a"
                                               _what6737_
                                               _err6734_)))))))
                           (_K66226703_
                            (lambda (_reason6700_ _details6701_)
                              (std/net/wamp#wamp-send
                               _ws6084_
                               (cons '6
                                     (cons std/net/wamp#empty-hash
                                           (cons '"wamp.error.goodbye_and_out"
                                                 '()))))
                              (raise 'shutdown))))
                       (if (let ()
                             (declare (not safe))
                             (##pair? _msg66106688_))
                           (let ((_tl66807461_
                                  (let ()
                                    (declare (not safe))
                                    (##cdr _msg66106688_)))
                                 (_hd66797459_
                                  (let ()
                                    (declare (not safe))
                                    (##car _msg66106688_))))
                             (if ((lambda (_g74637465_) (eq? _g74637465_ '36))
                                  _hd66797459_)
                                 (if (let ()
                                       (declare (not safe))
                                       (##pair? _tl66807461_))
                                     (let ((_tl66827470_
                                            (let ()
                                              (declare (not safe))
                                              (##cdr _tl66807461_)))
                                           (_hd66817468_
                                            (let ()
                                              (declare (not safe))
                                              (##car _tl66807461_))))
                                       (if (let ()
                                             (declare (not safe))
                                             (##pair? _tl66827470_))
                                           (let ((_tl66847477_
                                                  (let ()
                                                    (declare (not safe))
                                                    (##cdr _tl66827470_)))
                                                 (_hd66837475_
                                                  (let ()
                                                    (declare (not safe))
                                                    (##car _tl66827470_))))
                                             (if (let ()
                                                   (declare (not safe))
                                                   (##pair? _tl66847477_))
                                                 (let ((_tl66867484_
                                                        (let ()
                                                          (declare (not safe))
                                                          (##cdr _tl66847477_)))
                                                       (_hd66857482_
                                                        (let ()
                                                          (declare (not safe))
                                                          (##car _tl66847477_))))
                                                   (let ((_subid7473_
                                                          _hd66817468_)
                                                         (_pubid7480_
                                                          _hd66837475_)
                                                         (_details7487_
                                                          _hd66857482_)
                                                         (_rest7489_
                                                          _tl66867484_))
                                                     (_K66787456_
                                                      _rest7489_
                                                      _details7487_
                                                      _pubid7480_
                                                      _subid7473_)))
                                                 (_else66206696_)))
                                           (_else66206696_)))
                                     (_else66206696_))
                                 (if ((lambda (_g73517353_)
                                        (eq? _g73517353_ '50))
                                      _hd66797459_)
                                     (if (let ()
                                           (declare (not safe))
                                           (##pair? _tl66807461_))
                                         (let ((_tl66757358_
                                                (let ()
                                                  (declare (not safe))
                                                  (##cdr _tl66807461_)))
                                               (_hd66747356_
                                                (let ()
                                                  (declare (not safe))
                                                  (##car _tl66807461_))))
                                           (if (let ()
                                                 (declare (not safe))
                                                 (##pair? _tl66757358_))
                                               (let ((_tl66777365_
                                                      (let ()
                                                        (declare (not safe))
                                                        (##cdr _tl66757358_)))
                                                     (_hd66767363_
                                                      (let ()
                                                        (declare (not safe))
                                                        (##car _tl66757358_))))
                                                 (let ((_reqid7361_
                                                        _hd66747356_)
                                                       (_details7368_
                                                        _hd66767363_)
                                                       (_rest7370_
                                                        _tl66777365_))
                                                   (_K66717344_
                                                    _rest7370_
                                                    _details7368_
                                                    _reqid7361_)))
                                               (_else66206696_)))
                                         (_else66206696_))
                                     (if ((lambda (_g72137215_)
                                            (eq? _g72137215_ '68))
                                          _hd66797459_)
                                         (if (let ()
                                               (declare (not safe))
                                               (##pair? _tl66807461_))
                                             (let ((_tl66667220_
                                                    (let ()
                                                      (declare (not safe))
                                                      (##cdr _tl66807461_)))
                                                   (_hd66657218_
                                                    (let ()
                                                      (declare (not safe))
                                                      (##car _tl66807461_))))
                                               (if (let ()
                                                     (declare (not safe))
                                                     (##pair? _tl66667220_))
                                                   (let ((_tl66687227_
                                                          (let ()
                                                            (declare
                                                              (not safe))
                                                            (##cdr _tl66667220_)))
                                                         (_hd66677225_
                                                          (let ()
                                                            (declare
                                                              (not safe))
                                                            (##car _tl66667220_))))
                                                     (if (let ()
                                                           (declare (not safe))
                                                           (##pair? _tl66687227_))
                                                         (let ((_tl66707234_
                                                                (let ()
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          (declare (not safe))
                          (##cdr _tl66687227_)))
                       (_hd66697232_
                        (let () (declare (not safe)) (##car _tl66687227_))))
                   (let ((_reqid7223_ _hd66657218_)
                         (_regid7230_ _hd66677225_)
                         (_details7237_ _hd66697232_)
                         (_rest7239_ _tl66707234_))
                     (_K66627206_
                      _rest7239_
                      _details7237_
                      _regid7230_
                      _reqid7223_)))
                 (_else66206696_)))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                   (_else66206696_)))
                                             (_else66206696_))
                                         (if ((lambda (_g71507152_)
                                                (eq? _g71507152_ '33))
                                              _hd66797459_)
                                             (if (let ()
                                                   (declare (not safe))
                                                   (##pair? _tl66807461_))
                                                 (let ((_tl66597157_
                                                        (let ()
                                                          (declare (not safe))
                                                          (##cdr _tl66807461_)))
                                                       (_hd66587155_
                                                        (let ()
                                                          (declare (not safe))
                                                          (##car _tl66807461_))))
                                                   (if (let ()
                                                         (declare (not safe))
                                                         (##pair? _tl66597157_))
                                                       (let ((_tl66617164_
                                                              (let ()
                                                                (declare
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          (not safe))
                        (##cdr _tl66597157_)))
                     (_hd66607162_
                      (let () (declare (not safe)) (##car _tl66597157_))))
                 (if (let () (declare (not safe)) (##null? _tl66617164_))
                     (let ((_reqid7160_ _hd66587155_)
                           (_subid7167_ _hd66607162_))
                       (_K66557143_ _subid7167_ _reqid7160_))
                     (_else66206696_)))
               (_else66206696_)))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                 (_else66206696_))
                                             (if ((lambda (_g70947096_)
                                                    (eq? _g70947096_ '35))
                                                  _hd66797459_)
                                                 '#!void
                                                 (if ((lambda (_g70657067_)
                                                        (eq? _g70657067_ '65))
                                                      _hd66797459_)
                                                     (if (let ()
                                                           (declare (not safe))
                                                           (##pair? _tl66807461_))
                                                         (let ((_tl66497072_
                                                                (let ()
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          (declare (not safe))
                          (##cdr _tl66807461_)))
                       (_hd66487070_
                        (let () (declare (not safe)) (##car _tl66807461_))))
                   (if (let () (declare (not safe)) (##pair? _tl66497072_))
                       (let ((_tl66517079_
                              (let ()
                                (declare (not safe))
                                (##cdr _tl66497072_)))
                             (_hd66507077_
                              (let ()
                                (declare (not safe))
                                (##car _tl66497072_))))
                         (if (let ()
                               (declare (not safe))
                               (##null? _tl66517079_))
                             (let ((_reqid7075_ _hd66487070_)
                                   (_regid7082_ _hd66507077_))
                               (_K66457058_ _regid7082_ _reqid7075_))
                             (_else66206696_)))
                       (_else66206696_)))
                 (_else66206696_))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                     (if ((lambda (_g69546956_)
                                                            (eq? _g69546956_
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                         '67))
                  _hd66797459_)
                 (if (let () (declare (not safe)) (##pair? _tl66807461_))
                     (let ((_tl66446961_
                            (let () (declare (not safe)) (##cdr _tl66807461_)))
                           (_hd66436959_
                            (let ()
                              (declare (not safe))
                              (##car _tl66807461_))))
                       (if (let () (declare (not safe)) (##null? _tl66446961_))
                           (let ((_reqid6964_ _hd66436959_))
                             (_K66406947_ _reqid6964_))
                           (_else66206696_)))
                     (_else66206696_))
                 (if ((lambda (_g68216823_) (eq? _g68216823_ '8)) _hd66797459_)
                     (if (let () (declare (not safe)) (##pair? _tl66807461_))
                         (let ((_tl66336828_
                                (let ()
                                  (declare (not safe))
                                  (##cdr _tl66807461_)))
                               (_hd66326826_
                                (let ()
                                  (declare (not safe))
                                  (##car _tl66807461_))))
                           (if (let ()
                                 (declare (not safe))
                                 (##pair? _tl66336828_))
                               (let ((_tl66356835_
                                      (let ()
                                        (declare (not safe))
                                        (##cdr _tl66336828_)))
                                     (_hd66346833_
                                      (let ()
                                        (declare (not safe))
                                        (##car _tl66336828_))))
                                 (if (let ()
                                       (declare (not safe))
                                       (##pair? _tl66356835_))
                                     (let ((_tl66376842_
                                            (let ()
                                              (declare (not safe))
                                              (##cdr _tl66356835_)))
                                           (_hd66366840_
                                            (let ()
                                              (declare (not safe))
                                              (##car _tl66356835_))))
                                       (if (let ()
                                             (declare (not safe))
                                             (##pair? _tl66376842_))
                                           (let ((_tl66396849_
                                                  (let ()
                                                    (declare (not safe))
                                                    (##cdr _tl66376842_)))
                                                 (_hd66386847_
                                                  (let ()
                                                    (declare (not safe))
                                                    (##car _tl66376842_))))
                                             (let ((_what6831_ _hd66326826_)
                                                   (_reqid6838_ _hd66346833_)
                                                   (_details6845_ _hd66366840_)
                                                   (_err6852_ _hd66386847_)
                                                   (_rest6854_ _tl66396849_))
                                               (_K66296814_
                                                _rest6854_
                                                _err6852_
                                                _details6845_
                                                _reqid6838_
                                                _what6831_)))
                                           (_else66206696_)))
                                     (_else66206696_)))
                               (_else66206696_)))
                         (_else66206696_))
                     (if ((lambda (_g67106712_) (eq? _g67106712_ '6))
                          _hd66797459_)
                         (if (let ()
                               (declare (not safe))
                               (##pair? _tl66807461_))
                             (let ((_tl66266717_
                                    (let ()
                                      (declare (not safe))
                                      (##cdr _tl66807461_)))
                                   (_hd66256715_
                                    (let ()
                                      (declare (not safe))
                                      (##car _tl66807461_))))
                               (if (let ()
                                     (declare (not safe))
                                     (##pair? _tl66266717_))
                                   (let ((_tl66286724_
                                          (let ()
                                            (declare (not safe))
                                            (##cdr _tl66266717_)))
                                         (_hd66276722_
                                          (let ()
                                            (declare (not safe))
                                            (##car _tl66266717_))))
                                     (if (let ()
                                           (declare (not safe))
                                           (##null? _tl66286724_))
                                         (let ((_details6720_ _hd66256715_)
                                               (_reason6727_ _hd66276722_))
                                           (_K66226703_
                                            _reason6727_
                                            _details6720_))
                                         (_else66206696_)))
                                   (_else66206696_)))
                             (_else66206696_))
                         (_else66206696_)))))))))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                           (_else66206696_))))))
                (_rbytes6107_ (make-u8vector '7))
                (_rmax6108_ (expt '2 '53))
                (_request-id6109_
                 (lambda ()
                   (std/crypto/etc#random-bytes!__0 _rbytes6107_)
                   (let _lp6604_ ((_k6606_ '0) (_r6607_ '0))
                     (if (let () (declare (not safe)) (##fx< _k6606_ '7))
                         (_lp6604_
                          (let () (declare (not safe)) (##fx+ _k6606_ '1))
                          (bitwise-ior
                           (arithmetic-shift _r6607_ '8)
                           (let ()
                             (declare (not safe))
                             (##u8vector-ref _rbytes6107_ _k6606_))))
                         (modulo _r6607_ _rmax6108_)))))
                (_message-tail6110_
                 (lambda (_args6600_ _kws6601_)
                   (if (null? _args6600_)
                       (if (and _kws6601_
                                (not (let ((__tmp14474
                                            (table-length _kws6601_)))
                                       (declare (not safe))
                                       (##fxzero? __tmp14474))))
                           (cons '() (cons _kws6601_ '()))
                           '())
                       (if (and _kws6601_
                                (not (let ((__tmp14475
                                            (table-length _kws6601_)))
                                       (declare (not safe))
                                       (##fxzero? __tmp14475))))
                           (cons _args6600_ (cons _kws6601_ '()))
                           (cons _args6600_ '())))))
                (_loop6111_
                 (lambda ()
                   (let _loop61656167_ ()
                     (let ((_next6171_ (thread-mailbox-next)))
                       ((lambda (_$message6174_)
                          (let* ((_$message61766186_ _$message6174_)
                                 (_else61786194_ (lambda () (_loop61656167_)))
                                 (_K61806577_
                                  (lambda (_$options6197_
                                           _$dest6199_
                                           _$source6201_
                                           _$value6203_)
                                    (let* ((_$value62226280_ _$value6203_)
                                           (_else62346288_
                                            (lambda () (_loop61656167_))))
                                      (let ((_K62766566_
                                             (lambda (_msg6564_)
                                               (thread-mailbox-extract-and-rewind)
                                               (_receive6106_ _msg6564_)))
                                            (_K62696530_
                                             (lambda (_k6519_
                                                      _kws6520_
                                                      _args6521_
                                                      _opts6522_
                                                      _name6523_)
                                               (thread-mailbox-extract-and-rewind)
                                               (let ((_reqid6525_
                                                      (_request-id6109_)))
                                                 (table-set!
                                                  _pend-calls6088_
                                                  _reqid6525_
                                                  (cons _$source6201_ _k6519_))
                                                 (std/net/wamp#wamp-send
                                                  _ws6084_
                                                  (cons '48
                                                        (cons _reqid6525_
                                                              (cons (let ((_$e6527_
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                                   _opts6522_))
                              (if _$e6527_ _$e6527_ std/net/wamp#empty-hash))
                            (cons _name6523_
                                  (_message-tail6110_
                                   _args6521_
                                   _kws6520_)))))))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                            (_K62636489_
                                             (lambda (_k6479_
                                                      _opts6480_
                                                      _name6481_
                                                      _proc6482_)
                                               (thread-mailbox-extract-and-rewind)
                                               (if (table-ref
                                                    _procedure-registrations6097_
                                                    _name6481_
                                                    '#f)
                                                   (std/actor/message#send-message__%
                                                    _$source6201_
                                                    (let ()
                                                      (declare (not safe))
                                                      (##structure
                                                       std/actor/proto#!error::t
                                                       '"procedure already registered"
                                                       _k6479_))
                                                    '#f
                                                    '#f)
                                                   (let ((_reqid6484_
                                                          (_request-id6109_)))
                                                     (table-set!
                                                      _pend-registrations6095_
                                                      _reqid6484_
                                                      (cons (cons _$source6201_
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          _k6479_)
                    (cons _name6481_ _proc6482_)))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                     (std/net/wamp#wamp-send
                                                      _ws6084_
                                                      (cons '64
                                                            (cons _reqid6484_
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          (cons (let ((_$e6486_ _opts6480_))
                                  (if _$e6486_
                                      _$e6486_
                                      std/net/wamp#empty-hash))
                                (cons _name6481_ '())))))))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                            (_K62596459_
                                             (lambda (_k6449_ _name6450_)
                                               (thread-mailbox-extract-and-rewind)
                                               (let ((_$e6452_
                                                      (table-ref
                                                       _procedure-registrations6097_
                                                       _name6450_
                                                       '#f)))
                                                 (if _$e6452_
                                                     ((lambda (_regid6455_)
                                                        (let ((_reqid6457_
                                                               (_request-id6109_)))
                                                          (table-set!
                                                           _pend-unregistrations6098_
                                                           _reqid6457_
                                                           (cons (cons _$source6201_
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                               _k6449_)
                         _regid6455_))
                  (std/net/wamp#wamp-send
                   _ws6084_
                   (cons '66 (cons _reqid6457_ (cons _regid6455_ '()))))))
              _$e6452_)
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                     (std/actor/message#send-message__%
                                                      _$source6201_
                                                      (let ()
                                                        (declare (not safe))
                                                        (##structure
                                                         std/actor/proto#!error::t
                                                         '"procedure is not registered"
                                                         _k6449_))
                                                      '#f
                                                      '#f)))))
                                            (_K62546424_
                                             (lambda (_k6405_
                                                      _opts6406_
                                                      _topic6407_)
                                               (thread-mailbox-extract-and-rewind)
                                               (let ((_$e6409_
                                                      (table-ref
                                                       _topic-subscriptions6093_
                                                       _topic6407_
                                                       '#f)))
                                                 (if _$e6409_
                                                     ((lambda (_actors6412_)
                                                        (table-set!
                                                         _topic-subscriptions6093_
                                                         _topic6407_
                                                         (cons _$source6201_
                                                               _actors6412_))
                                                        (_add-actor-subscription!6104_
                                                         _topic6407_
                                                         _$source6201_)
                                                        (std/actor/message#send-message__%
                                                         _$source6201_
                                                         (let ()
                                                           (declare (not safe))
                                                           (##structure
                                                            std/actor/proto#!value::t
                                                            '#!void
                                                            _k6405_))
                                                         '#f
                                                         '#f))
                                                      _$e6409_)
                                                     (let ((_$e6414_
                                                            (table-ref
                                                             _pend-topic-subscriptions6090_
                                                             _topic6407_
                                                             '#f)))
                                                       (if _$e6414_
                                                           ((lambda (_pend6417_)
                                                              (table-set!
                                                               _pend-topic-subscriptions6090_
                                                               _topic6407_
                                                               (cons (cons _$source6201_
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                                   _k6405_)
                             _pend6417_))
                      (std/actor/message#send-message__%
                       _$source6201_
                       (let ()
                         (declare (not safe))
                         (##structure
                          std/actor/proto#!value::t
                          '#!void
                          _k6405_))
                       '#f
                       '#f))
                    _$e6414_)
                   (let ((_reqid6419_ (_request-id6109_)))
                     (table-set!
                      _pend-subscriptions6089_
                      _reqid6419_
                      _topic6407_)
                     (table-set!
                      _pend-topic-subscriptions6090_
                      _topic6407_
                      (cons (cons _$source6201_ _k6405_) '()))
                     (std/net/wamp#wamp-send
                      _ws6084_
                      (cons '32
                            (cons _reqid6419_
                                  (cons (let ((_$e6421_ _opts6406_))
                                          (if _$e6421_
                                              _$e6421_
                                              std/net/wamp#empty-hash))
                                        (cons _topic6407_ '()))))))))))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                            (_K62516390_
                                             (lambda (_topic6388_)
                                               (thread-mailbox-extract-and-rewind)
                                               (_remove-actor-subscription!6103_
                                                _topic6388_
                                                _$source6201_)))
                                            (_K62456358_
                                             (lambda (_kws6348_
                                                      _args6349_
                                                      _opts6350_
                                                      _topic6351_)
                                               (thread-mailbox-extract-and-rewind)
                                               (let ((_reqid6353_
                                                      (_request-id6109_)))
                                                 (std/net/wamp#wamp-send
                                                  _ws6084_
                                                  (cons '16
                                                        (cons _reqid6353_
                                                              (cons (let ((_$e6355_
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                                   _opts6350_))
                              (if _$e6355_ _$e6355_ std/net/wamp#empty-hash))
                            (cons _topic6351_
                                  (_message-tail6110_
                                   _args6349_
                                   _kws6348_)))))))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                            (_K62436338_
                                             (lambda ()
                                               (thread-mailbox-extract-and-rewind)
                                               (std/net/wamp#wamp-send
                                                _ws6084_
                                                (cons '6
                                                      (cons std/net/wamp#empty-hash
                                                            (cons '"wamp.error.close_realm"
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          '()))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                               (raise 'shutdown)))
                                            (_K62406322_
                                             (lambda (_e6320_)
                                               (thread-mailbox-extract-and-rewind)
                                               (raise _e6320_)))
                                            (_K62376305_
                                             (lambda (_thread6303_)
                                               (thread-mailbox-extract-and-rewind)
                                               (_remove-thread!6101_
                                                _thread6303_)))
                                            (_K62366294_
                                             (lambda (_bogus6292_)
                                               (thread-mailbox-extract-and-rewind)
                                               (std/logger#warning
                                                '"unexpected message: ~a"
                                                _bogus6292_))))
                                        (let ((_try-match62246561_
                                               (lambda ()
                                                 (if (let ()
                                                       (declare (not safe))
                                                       (##structure-direct-instance-of?
                                                        _$value62226280_
                                                        'std/actor/proto#!call::t))
                                                     (let ((_e62706533_
                                                            (let ()
                                                              (declare
                                                                (not safe))
                                                              (##vector-ref
                                                               _$value62226280_
                                                               '1))))
                                                       (if (let ()
                                                             (declare
                                                               (not safe))
                                                             (##structure-direct-instance-of?
                                                              _e62706533_
                                                              'std/net/wamp#wamp.call::t))
                                                           (let* ((_e62726536_
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                           (let ()
                             (declare (not safe))
                             (##vector-ref _e62706533_ '1)))
                          (_e62736541_
                           (let ()
                             (declare (not safe))
                             (##vector-ref _e62706533_ '2)))
                          (_e62746546_
                           (let ()
                             (declare (not safe))
                             (##vector-ref _e62706533_ '3)))
                          (_e62756551_
                           (let ()
                             (declare (not safe))
                             (##vector-ref _e62706533_ '4)))
                          (_e62716556_
                           (let ()
                             (declare (not safe))
                             (##vector-ref _$value62226280_ '2))))
                     (let ((_name6539_ _e62726536_)
                           (_opts6544_ _e62736541_)
                           (_args6549_ _e62746546_)
                           (_kws6554_ _e62756551_)
                           (_k6559_ _e62716556_))
                       (_K62696530_
                        _k6559_
                        _kws6554_
                        _args6549_
                        _opts6544_
                        _name6539_)))
                   (if (let ()
                         (declare (not safe))
                         (##structure-direct-instance-of?
                          _e62706533_
                          'std/net/wamp#wamp.register::t))
                       (let* ((_e62666495_
                               (let ()
                                 (declare (not safe))
                                 (##vector-ref _e62706533_ '1)))
                              (_e62676500_
                               (let ()
                                 (declare (not safe))
                                 (##vector-ref _e62706533_ '2)))
                              (_e62686505_
                               (let ()
                                 (declare (not safe))
                                 (##vector-ref _e62706533_ '3)))
                              (_e62656510_
                               (let ()
                                 (declare (not safe))
                                 (##vector-ref _$value62226280_ '2))))
                         (let ((_proc6498_ _e62666495_)
                               (_name6503_ _e62676500_)
                               (_opts6508_ _e62686505_)
                               (_k6513_ _e62656510_))
                           (_K62636489_
                            _k6513_
                            _opts6508_
                            _name6503_
                            _proc6498_)))
                       (if (let ()
                             (declare (not safe))
                             (##structure-direct-instance-of?
                              _e62706533_
                              'std/net/wamp#wamp.unregister::t))
                           (let* ((_e62626465_
                                   (let ()
                                     (declare (not safe))
                                     (##vector-ref _e62706533_ '1)))
                                  (_e62616470_
                                   (let ()
                                     (declare (not safe))
                                     (##vector-ref _$value62226280_ '2))))
                             (let ((_name6468_ _e62626465_)
                                   (_k6473_ _e62616470_))
                               (_K62596459_ _k6473_ _name6468_)))
                           (if (let ()
                                 (declare (not safe))
                                 (##structure-direct-instance-of?
                                  _e62706533_
                                  'std/net/wamp#wamp.subscribe::t))
                               (let* ((_e62576430_
                                       (let ()
                                         (declare (not safe))
                                         (##vector-ref _e62706533_ '1)))
                                      (_e62586435_
                                       (let ()
                                         (declare (not safe))
                                         (##vector-ref _e62706533_ '2)))
                                      (_e62566440_
                                       (let ()
                                         (declare (not safe))
                                         (##vector-ref _$value62226280_ '2))))
                                 (let ((_topic6433_ _e62576430_)
                                       (_opts6438_ _e62586435_)
                                       (_k6443_ _e62566440_))
                                   (_K62546424_
                                    _k6443_
                                    _opts6438_
                                    _topic6433_)))
                               (let ((_bogus6297_ _$value62226280_))
                                 (_K62366294_ _bogus6297_)))))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                                     (let ((_bogus6297_
                                                            _$value62226280_))
                                                       (_K62366294_
                                                        _bogus6297_))))))
                                          (if (let ()
                                                (declare (not safe))
                                                (##structure-direct-instance-of?
                                                 _$value62226280_
                                                 'std/actor/proto#!event::t))
                                              (let ((_e62776569_
                                                     (let ()
                                                       (declare (not safe))
                                                       (##vector-ref
                                                        _$value62226280_
                                                        '1))))
                                                (if (let ()
                                                      (declare (not safe))
                                                      (##structure-direct-instance-of?
                                                       _e62776569_
                                                       'std/net/wamp#wamp.receive::t))
                                                    (let* ((_e62786572_
                                                            (let ()
                                                              (declare
                                                                (not safe))
                                                              (##vector-ref
                                                               _e62776569_
                                                               '1)))
                                                           (_msg6575_
                                                            _e62786572_))
                                                      (_K62766566_ _msg6575_))
                                                    (if (let ()
                                                          (declare (not safe))
                                                          (##structure-direct-instance-of?
                                                           _e62776569_
                                                           'std/net/wamp#wamp.unsubscribe::t))
                                                        (let* ((_e62536396_
                                                                (let ()
;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          (declare (not safe))
                          (##vector-ref _e62776569_ '1)))
                       (_topic6399_ _e62536396_))
                  (_K62516390_ _topic6399_))
                (if (let ()
                      (declare (not safe))
                      (##structure-direct-instance-of?
                       _e62776569_
                       'std/net/wamp#wamp.publish::t))
                    (let* ((_e62476364_
                            (let ()
                              (declare (not safe))
                              (##vector-ref _e62776569_ '1)))
                           (_e62486369_
                            (let ()
                              (declare (not safe))
                              (##vector-ref _e62776569_ '2)))
                           (_e62496374_
                            (let ()
                              (declare (not safe))
                              (##vector-ref _e62776569_ '3)))
                           (_e62506379_
                            (let ()
                              (declare (not safe))
                              (##vector-ref _e62776569_ '4))))
                      (let ((_topic6367_ _e62476364_)
                            (_opts6372_ _e62486369_)
                            (_args6377_ _e62496374_)
                            (_kws6382_ _e62506379_))
                        (_K62456358_
                         _kws6382_
                         _args6377_
                         _opts6372_
                         _topic6367_)))
                    (if (let ()
                          (declare (not safe))
                          (##structure-direct-instance-of?
                           _e62776569_
                           'std/net/wamp#wamp.shutdown::t))
                        (_K62436338_)
                        (if (let ()
                              (declare (not safe))
                              (##structure-direct-instance-of?
                               _e62776569_
                               'std/net/wamp#wamp.close-connection::t))
                            (let* ((_e62426328_
                                    (let ()
                                      (declare (not safe))
                                      (##vector-ref _e62776569_ '1)))
                                   (_e6331_ _e62426328_))
                              (_K62406322_ _e6331_))
                            (if (let ()
                                  (declare (not safe))
                                  (##structure-direct-instance-of?
                                   _e62776569_
                                   'std/net/wamp#wamp.remove-thread::t))
                                (let* ((_e62396311_
                                        (let ()
                                          (declare (not safe))
                                          (##vector-ref _e62776569_ '1)))
                                       (_thread6314_ _e62396311_))
                                  (_K62376305_ _thread6314_))
                                (let ((_bogus6297_ _$value62226280_))
                                  (_K62366294_ _bogus6297_)))))))))
;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                                              (_try-match62246561_))))))))
                            (if (let ()
                                  (declare (not safe))
                                  (##structure-direct-instance-of?
                                   _$message61766186_
                                   'std/actor/message#message::t))
                                (let* ((_e61816580_
                                        (let ()
                                          (declare (not safe))
                                          (##vector-ref
                                           _$message61766186_
                                           '1)))
                                       (_$value6583_ _e61816580_)
                                       (_e61826585_
                                        (let ()
                                          (declare (not safe))
                                          (##vector-ref
                                           _$message61766186_
                                           '2)))
                                       (_$source6588_ _e61826585_)
                                       (_e61836590_
                                        (let ()
                                          (declare (not safe))
                                          (##vector-ref
                                           _$message61766186_
                                           '3)))
                                       (_$dest6593_ _e61836590_)
                                       (_e61846595_
                                        (let ()
                                          (declare (not safe))
                                          (##vector-ref
                                           _$message61766186_
                                           '4)))
                                       (_$options6598_ _e61846595_))
                                  (_K61806577_
                                   _$options6598_
                                   _$dest6593_
                                   _$source6588_
                                   _$value6583_))
                                (_loop61656167_))))
                        _next6171_)))
                   (_loop6111_)))
                (_send-shutdown-errors6112_
                 (lambda (_pend6157_)
                   (let ((_err6159_
                          (make-struct-instance
                           std/net/wamp#wamp-error::t
                           'wamp-client
                           '"client shutdown")))
                     (for-each
                      (lambda (_g61606162_)
                        (_send-pend-error6113_ _g61606162_ _err6159_))
                      _pend6157_))))
                (_send-pend-error6113_
                 (lambda (_pend6126_ _err6127_)
                   (let* ((_pend61286135_ _pend6126_)
                          (_E61306139_
                           (lambda ()
                             (error '"No clause matching" _pend61286135_)))
                          (_K61316145_
                           (lambda (_k6142_ _src6143_)
                             (std/actor/message#send-message__%
                              _src6143_
                              (let ()
                                (declare (not safe))
                                (##structure
                                 std/actor/proto#!error::t
                                 _err6127_
                                 _k6142_))
                              '#f
                              '#f))))
                     (if (let () (declare (not safe)) (##pair? _pend61286135_))
                         (let ((_hd61326148_
                                (let ()
                                  (declare (not safe))
                                  (##car _pend61286135_)))
                               (_tl61336150_
                                (let ()
                                  (declare (not safe))
                                  (##cdr _pend61286135_))))
                           (let* ((_src6153_ _hd61326148_)
                                  (_k6155_ _tl61336150_))
                             (_K61316145_ _k6155_ _src6153_)))
                         (_E61306139_))))))
        (with-exception-catcher
         (lambda (_g61146116_)
           (if '#t
               (let ((_e6119_ _g61146116_))
                 (if (eq? _e6119_ 'shutdown)
                     '#!void
                     (std/logger#log-error '"wamp client error" _e6119_))
                 (std/net/websocket#websocket-close__%__0
                  '#f
                  absent-value
                  _ws6084_)
                 (_send-shutdown-errors6112_ (hash-values _pend-calls6088_))
                 (for-each
                  _send-shutdown-errors6112_
                  (hash-values _pend-subscriptions6089_))
                 (_send-shutdown-errors6112_
                  (map car (hash-values _pend-registrations6095_)))
                 (_send-shutdown-errors6112_
                  (map car (hash-values _pend-unregistrations6098_)))
                 (for-each
                  (lambda (_g61206122_)
                    (std/actor/message#send-message__0
                     _g61206122_
                     (let ((__tmp14476
                            (let ()
                              (declare (not safe))
                              (##structure std/net/wamp#wamp.shutdown::t))))
                       (declare (not safe))
                       (##structure std/actor/proto#!event::t __tmp14476))))
                  (hash-keys _actor-subscriptions6094_))
                 (if (eq? _e6119_ 'shutdown) '#!void (raise _e6119_)))
               (raise _g61146116_)))
         (lambda () (_loop6111_))))))
  (define std/net/wamp#wamp-reader
    (lambda (_cli6069_ _ws6070_)
      (with-exception-catcher
       (lambda (_g60716073_)
         (if '#t
             (let ((_e6076_ _g60716073_))
               (std/actor/message#send-message__0
                _cli6069_
                (let ((__tmp14477
                       (let ()
                         (declare (not safe))
                         (##structure
                          std/net/wamp#wamp.close-connection::t
                          _e6076_))))
                  (declare (not safe))
                  (##structure std/actor/proto#!event::t __tmp14477))))
             (raise _g60716073_)))
       (lambda ()
         (let _lp6079_ ()
           (let ((_msg6082_ (std/net/wamp#wamp-recv _ws6070_)))
             (std/actor/message#send-message__0
              _cli6069_
              (let ((__tmp14478
                     (let ()
                       (declare (not safe))
                       (##structure std/net/wamp#wamp.receive::t _msg6082_))))
                (declare (not safe))
                (##structure std/actor/proto#!event::t __tmp14478)))
             (_lp6079_)))))))
  (define std/net/wamp#empty-hash (make-table))
  (define std/net/wamp#session-details
    (let ((_ht6063_ (make-table 'size: '2)))
      (table-set!
       _ht6063_
       'agent
       (string-append '"Gerbil-" (gerbil-version-string)))
      (table-set!
       _ht6063_
       'roles
       (let ((_ht6066_ (make-table 'size: '4)))
         (table-set! _ht6066_ 'publisher std/net/wamp#empty-hash)
         (table-set! _ht6066_ 'subscriber std/net/wamp#empty-hash)
         (table-set! _ht6066_ 'caller std/net/wamp#empty-hash)
         (table-set! _ht6066_ 'callee std/net/wamp#empty-hash)
         _ht6066_))
      _ht6063_))
  (define std/net/wamp#wamp-open-session
    (lambda (_ws5973_ _realm5974_)
      (std/net/wamp#wamp-send
       _ws5973_
       (cons '1 (cons _realm5974_ (cons std/net/wamp#session-details '()))))
      (let* ((_g59755994_ (std/net/wamp#wamp-recv _ws5973_))
             (_E59785998_
              (lambda () (error '"No clause matching" _g59755994_))))
        (let ((_K59866037_
               (lambda (_details6034_ _sid6035_)
                 (values _sid6035_ _details6034_)))
              (_K59796005_
               (lambda (_reason6002_ _details6003_)
                 (raise (make-struct-instance
                         std/net/wamp#wamp-error::t
                         'wamp-open-session
                         _reason6002_
                         _details6003_)))))
          (if (let () (declare (not safe)) (##pair? _g59755994_))
              (let ((_tl59886042_
                     (let () (declare (not safe)) (##cdr _g59755994_)))
                    (_hd59876040_
                     (let () (declare (not safe)) (##car _g59755994_))))
                (if ((lambda (_g60446046_) (eq? _g60446046_ '2)) _hd59876040_)
                    (if (let () (declare (not safe)) (##pair? _tl59886042_))
                        (let ((_tl59906051_
                               (let ()
                                 (declare (not safe))
                                 (##cdr _tl59886042_)))
                              (_hd59896049_
                               (let ()
                                 (declare (not safe))
                                 (##car _tl59886042_))))
                          (if (let ()
                                (declare (not safe))
                                (##pair? _tl59906051_))
                              (let ((_tl59926058_
                                     (let ()
                                       (declare (not safe))
                                       (##cdr _tl59906051_)))
                                    (_hd59916056_
                                     (let ()
                                       (declare (not safe))
                                       (##car _tl59906051_))))
                                (if (let ()
                                      (declare (not safe))
                                      (##null? _tl59926058_))
                                    (let ((_sid6054_ _hd59896049_)
                                          (_details6061_ _hd59916056_))
                                      (_K59866037_ _details6061_ _sid6054_))
                                    (_E59785998_)))
                              (_E59785998_)))
                        (_E59785998_))
                    (if ((lambda (_g60126014_) (eq? _g60126014_ '3))
                         _hd59876040_)
                        (if (let ()
                              (declare (not safe))
                              (##pair? _tl59886042_))
                            (let ((_tl59836019_
                                   (let ()
                                     (declare (not safe))
                                     (##cdr _tl59886042_)))
                                  (_hd59826017_
                                   (let ()
                                     (declare (not safe))
                                     (##car _tl59886042_))))
                              (if (let ()
                                    (declare (not safe))
                                    (##pair? _tl59836019_))
                                  (let ((_tl59856026_
                                         (let ()
                                           (declare (not safe))
                                           (##cdr _tl59836019_)))
                                        (_hd59846024_
                                         (let ()
                                           (declare (not safe))
                                           (##car _tl59836019_))))
                                    (if (let ()
                                          (declare (not safe))
                                          (##null? _tl59856026_))
                                        (let ((_details6022_ _hd59826017_)
                                              (_reason6029_ _hd59846024_))
                                          (_K59796005_
                                           _reason6029_
                                           _details6022_))
                                        (_E59785998_)))
                                  (_E59785998_)))
                            (_E59785998_))
                        (_E59785998_))))
              (_E59785998_))))))
  (define std/net/wamp#wamp-send
    (lambda (_ws5968_ _msg5969_)
      (let ((_outp5971_ (open-output-u8vector)))
        (std/text/json#write-json-object _msg5969_ _outp5971_)
        (std/net/websocket#websocket-send
         _ws5968_
         (get-output-u8vector _outp5971_)
         'text))))
  (define std/net/wamp#wamp-recv
    (lambda (_ws5963_)
      (let ((_g14479_ (std/net/websocket#websocket-recv__0 _ws5963_)))
        (begin
          (let ((_g14480_
                 (let ()
                   (declare (not safe))
                   (if (##values? _g14479_) (##vector-length _g14479_) 1))))
            (if (not (let () (declare (not safe)) (##fx= _g14480_ 2)))
                (error "Context expects 2 values" _g14480_)))
          (let ((_bytes5965_
                 (let () (declare (not safe)) (##vector-ref _g14479_ 0)))
                (_type5966_
                 (let () (declare (not safe)) (##vector-ref _g14479_ 1))))
            (if (eq? _type5966_ 'text)
                (std/text/json#read-json__%
                 (open-input-u8vector
                  (cons 'char-encoding:
                        (cons 'UTF-8 (cons 'init: (cons _bytes5965_ '()))))))
                (begin
                  (std/logger#warning
                   '"wamp-recv: server sent binary data (~s)"
                   (u8vector-length _bytes5965_))
                  (std/error#raise-io-error
                   'wamp-recv
                   '"server sent binary data"
                   _bytes5965_)))))))))
