(declare (block) (standard-bindings) (extended-bindings))
(begin
  (declare (not safe))
  (define std/actor/rpc/proto/null#rpc-proto-accept-e
    (lambda (_ibuf472_ _obuf473_ _proto-t474_ _K475_)
      (letrec ((_connection-closed477_
                (lambda ()
                  (std/actor/proto#raise-rpc-io-error
                   'rpc-proto-accept
                   '"connection closed")))
               (_bad-hello478_
                (lambda (_e484_)
                  (std/actor/proto#raise-rpc-io-error
                   'rpc-proto-accept
                   '"bad hello"
                   _e484_))))
        (let ((_e480_ (std/net/bio/input#bio-read-u8 _ibuf472_)))
          (if (eof-object? _e480_)
              (_connection-closed477_)
              (if (eq? _e480_
                       std/actor/rpc/proto/message#rpc-proto-connect-hello)
                  (let ((_e482_ (std/net/bio/input#bio-read-u8 _ibuf472_)))
                    (if (eof-object? _e482_)
                        (_connection-closed477_)
                        (if (eq? _e482_ _proto-t474_)
                            (begin
                              (std/net/bio/output#bio-write-u8
                               std/actor/rpc/proto/message#rpc-proto-connect-accept
                               _obuf473_)
                              (_K475_ _ibuf472_ _obuf473_))
                            (begin
                              (std/net/bio/output#bio-write-u8
                               std/actor/rpc/proto/message#rpc-proto-connect-reject
                               _obuf473_)
                              (std/net/bio/output#bio-force-output _obuf473_)
                              (_bad-hello478_ _e482_)))))
                  (_bad-hello478_ _e480_)))))))
  (define std/actor/rpc/proto/null#rpc-proto-connect-e
    (lambda (_ibuf458_ _obuf459_ _proto-t460_ _K461_)
      (letrec ((_connection-rejected463_
                (lambda ()
                  (std/actor/proto#raise-rpc-io-error
                   'rpc-proto-connect
                   '"Connection hello rejected by peer")))
               (_connection-closed464_
                (lambda ()
                  (std/actor/proto#raise-rpc-io-error
                   'rpc-proto-connect
                   '"connection closed")))
               (_bad-hello465_
                (lambda ()
                  (std/actor/proto#raise-rpc-io-error
                   'rpc-proto-connect
                   '"bad hello"))))
        (std/net/bio/output#bio-write-u8
         std/actor/rpc/proto/message#rpc-proto-connect-hello
         _obuf459_)
        (std/net/bio/output#bio-write-u8 _proto-t460_ _obuf459_)
        (std/net/bio/output#bio-force-output _obuf459_)
        (let ((_e467_ (std/net/bio/input#bio-read-u8 _ibuf458_)))
          (if (eof-object? _e467_)
              (_connection-closed464_)
              (if (eq? _e467_
                       std/actor/rpc/proto/message#rpc-proto-connect-accept)
                  (_K461_ _ibuf458_ _obuf459_)
                  (if (eq? _e467_
                           std/actor/rpc/proto/message#rpc-proto-connect-reject)
                      (_connection-rejected463_)
                      (_bad-hello465_))))))))
  (define std/actor/rpc/proto/null#rpc-null-proto-accept
    (lambda (_ibuf452_ _obuf453_)
      (std/actor/rpc/proto/null#rpc-proto-accept-e
       _ibuf452_
       _obuf453_
       std/actor/rpc/proto/message#rpc-proto-null
       (lambda (_ibuf455_ _obuf456_)
         (std/net/bio/output#bio-force-output _obuf456_)
         (values std/actor/rpc/proto/null#rpc-null-proto-read
                 std/actor/rpc/proto/null#rpc-null-proto-write)))))
  (define std/actor/rpc/proto/null#rpc-null-proto-connect
    (lambda (_ibuf446_ _obuf447_)
      (std/actor/rpc/proto/null#rpc-proto-connect-e
       _ibuf446_
       _obuf447_
       std/actor/rpc/proto/message#rpc-proto-null
       (lambda (_ibuf449_ _obuf450_)
         (values std/actor/rpc/proto/null#rpc-null-proto-read
                 std/actor/rpc/proto/null#rpc-null-proto-write)))))
  (define std/actor/rpc/proto/null#rpc-null-proto-read
    (lambda (_ibuf437_ _bytes438_)
      (let ((_e440_ (std/net/bio/input#bio-read-u8 _ibuf437_)))
        (if (eq? _e440_ std/actor/rpc/proto/message#rpc-proto-keep-alive)
            '#!void
            (if (eq? _e440_ std/actor/rpc/proto/message#rpc-proto-message)
                (let ((_len442_ (std/net/bio/input#bio-read-u32 _ibuf437_)))
                  (if (fx<= _len442_
                            std/actor/rpc/proto/message#rpc-proto-message-max-length)
                      (let ((_bytes444_
                             (if (fx< (u8vector-length _bytes438_) _len442_)
                                 (make-u8vector _len442_)
                                 _bytes438_)))
                        (std/net/bio/input#bio-read-subu8vector-unbuffered
                         _bytes444_
                         '0
                         _len442_
                         _ibuf437_)
                        (values _bytes444_ _len442_))
                      (std/actor/proto#raise-rpc-io-error
                       'rpc-proto-read
                       '"message too long"
                       _len442_)))
                (if (eof-object? _e440_)
                    _e440_
                    (std/actor/proto#raise-rpc-io-error
                     'rpc-proto-read
                     '"bad message"
                     _e440_)))))))
  (define std/actor/rpc/proto/null#rpc-null-proto-write
    (lambda (_obuf425_ _obj426_)
      (if (eq? _obj426_ '#!void)
          (begin
            (std/net/bio/output#bio-write-u8
             std/actor/rpc/proto/message#rpc-proto-keep-alive
             _obuf425_)
            (std/net/bio/output#bio-force-output _obuf425_))
          (if (u8vector? _obj426_)
              (begin
                (std/net/bio/output#bio-write-u8
                 std/actor/rpc/proto/message#rpc-proto-message
                 _obuf425_)
                (std/net/bio/output#bio-write-u32
                 (u8vector-length _obj426_)
                 _obuf425_)
                (std/net/bio/output#bio-write-bytes _obj426_ _obuf425_)
                (std/net/bio/output#bio-force-output _obuf425_))
              (if (##structure-instance-of?
                   _obj426_
                   'std/net/bio/buffer#chunked-output-buffer::t)
                  (let* ((_len428_
                          (std/net/bio/buffer#chunked-output-length _obj426_))
                         (_chunks430_
                          (std/net/bio/buffer#chunked-output-chunks _obj426_)))
                    (std/net/bio/output#bio-write-u8
                     std/actor/rpc/proto/message#rpc-proto-message
                     _obuf425_)
                    (std/net/bio/output#bio-write-u32 _len428_ _obuf425_)
                    (for-each
                     (lambda (_g432434_)
                       (std/net/bio/output#bio-write-bytes
                        _g432434_
                        _obuf425_))
                     _chunks430_)
                    (std/net/bio/output#bio-force-output _obuf425_))
                  (std/actor/proto#raise-rpc-io-error
                   'rpc-proto-write
                   '"unexpected object"
                   _obj426_))))))
  (define std/actor/rpc/proto/null#rpc-null-proto
    (lambda ()
      (##structure
       std/actor/rpc/base#!rpc-protocol::t
       std/actor/rpc/proto/null#rpc-null-proto-connect
       std/actor/rpc/proto/null#rpc-null-proto-accept))))
