(declare (block) (standard-bindings) (extended-bindings))
(begin
  (declare (not safe))
  (define std/actor/rpc/proto/null#rpc-proto-accept-e
    (lambda (_ibuf203563_ _obuf203564_ _proto-t203565_ _K203566_)
      (letrec ((_connection-closed203568_
                (lambda ()
                  (std/actor/proto#raise-rpc-io-error
                   'rpc-proto-accept
                   '"connection closed")))
               (_bad-hello203569_
                (lambda (_e203575_)
                  (std/actor/proto#raise-rpc-io-error
                   'rpc-proto-accept
                   '"bad hello"
                   _e203575_))))
        (let ((_e203571_ (std/net/bio/input#bio-read-u8 _ibuf203563_)))
          (if (eof-object? _e203571_)
              (_connection-closed203568_)
              (if (eq? _e203571_
                       std/actor/rpc/proto/message#rpc-proto-connect-hello)
                  (let ((_e203573_
                         (std/net/bio/input#bio-read-u8 _ibuf203563_)))
                    (if (eof-object? _e203573_)
                        (_connection-closed203568_)
                        (if (eq? _e203573_ _proto-t203565_)
                            (begin
                              (std/net/bio/output#bio-write-u8
                               std/actor/rpc/proto/message#rpc-proto-connect-accept
                               _obuf203564_)
                              (_K203566_ _ibuf203563_ _obuf203564_))
                            (begin
                              (std/net/bio/output#bio-write-u8
                               std/actor/rpc/proto/message#rpc-proto-connect-reject
                               _obuf203564_)
                              (std/net/bio/output#bio-force-output
                               _obuf203564_)
                              (_bad-hello203569_ _e203573_)))))
                  (_bad-hello203569_ _e203571_)))))))
  (define std/actor/rpc/proto/null#rpc-proto-connect-e
    (lambda (_ibuf203549_ _obuf203550_ _proto-t203551_ _K203552_)
      (letrec ((_connection-rejected203554_
                (lambda ()
                  (std/actor/proto#raise-rpc-io-error
                   'rpc-proto-connect
                   '"Connection hello rejected by peer")))
               (_connection-closed203555_
                (lambda ()
                  (std/actor/proto#raise-rpc-io-error
                   'rpc-proto-connect
                   '"connection closed")))
               (_bad-hello203556_
                (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
         _obuf203550_)
        (std/net/bio/output#bio-write-u8 _proto-t203551_ _obuf203550_)
        (std/net/bio/output#bio-force-output _obuf203550_)
        (let ((_e203558_ (std/net/bio/input#bio-read-u8 _ibuf203549_)))
          (if (eof-object? _e203558_)
              (_connection-closed203555_)
              (if (eq? _e203558_
                       std/actor/rpc/proto/message#rpc-proto-connect-accept)
                  (_K203552_ _ibuf203549_ _obuf203550_)
                  (if (eq? _e203558_
                           std/actor/rpc/proto/message#rpc-proto-connect-reject)
                      (_connection-rejected203554_)
                      (_bad-hello203556_))))))))
  (define std/actor/rpc/proto/null#rpc-null-proto-accept
    (lambda (_ibuf203543_ _obuf203544_)
      (std/actor/rpc/proto/null#rpc-proto-accept-e
       _ibuf203543_
       _obuf203544_
       std/actor/rpc/proto/message#rpc-proto-null
       (lambda (_ibuf203546_ _obuf203547_)
         (std/net/bio/output#bio-force-output _obuf203547_)
         (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 (_ibuf203537_ _obuf203538_)
      (std/actor/rpc/proto/null#rpc-proto-connect-e
       _ibuf203537_
       _obuf203538_
       std/actor/rpc/proto/message#rpc-proto-null
       (lambda (_ibuf203540_ _obuf203541_)
         (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 (_ibuf203528_ _bytes203529_)
      (let ((_e203531_ (std/net/bio/input#bio-read-u8 _ibuf203528_)))
        (if (eq? _e203531_ std/actor/rpc/proto/message#rpc-proto-keep-alive)
            '#!void
            (if (eq? _e203531_ std/actor/rpc/proto/message#rpc-proto-message)
                (let ((_len203533_
                       (std/net/bio/input#bio-read-u32 _ibuf203528_)))
                  (if (fx<= _len203533_
                            std/actor/rpc/proto/message#rpc-proto-message-max-length)
                      (let ((_bytes203535_
                             (if (fx< (u8vector-length _bytes203529_)
                                      _len203533_)
                                 (make-u8vector _len203533_)
                                 _bytes203529_)))
                        (std/net/bio/input#bio-read-subu8vector-unbuffered
                         _bytes203535_
                         '0
                         _len203533_
                         _ibuf203528_)
                        (values _bytes203535_ _len203533_))
                      (std/actor/proto#raise-rpc-io-error
                       'rpc-proto-read
                       '"message too long"
                       _len203533_)))
                (if (eof-object? _e203531_)
                    _e203531_
                    (std/actor/proto#raise-rpc-io-error
                     'rpc-proto-read
                     '"bad message"
                     _e203531_)))))))
  (define std/actor/rpc/proto/null#rpc-null-proto-write
    (lambda (_obuf203516_ _obj203517_)
      (if (eq? _obj203517_ '#!void)
          (begin
            (std/net/bio/output#bio-write-u8
             std/actor/rpc/proto/message#rpc-proto-keep-alive
             _obuf203516_)
            (std/net/bio/output#bio-force-output _obuf203516_))
          (if (u8vector? _obj203517_)
              (begin
                (std/net/bio/output#bio-write-u8
                 std/actor/rpc/proto/message#rpc-proto-message
                 _obuf203516_)
                (std/net/bio/output#bio-write-u32
                 (u8vector-length _obj203517_)
                 _obuf203516_)
                (std/net/bio/output#bio-write-bytes _obj203517_ _obuf203516_)
                (std/net/bio/output#bio-force-output _obuf203516_))
              (if (##structure-instance-of?
                   _obj203517_
                   'std/net/bio/buffer#chunked-output-buffer::t)
                  (let* ((_len203519_
                          (std/net/bio/buffer#chunked-output-length
                           _obj203517_))
                         (_chunks203521_
                          (std/net/bio/buffer#chunked-output-chunks
                           _obj203517_)))
                    (std/net/bio/output#bio-write-u8
                     std/actor/rpc/proto/message#rpc-proto-message
                     _obuf203516_)
                    (std/net/bio/output#bio-write-u32 _len203519_ _obuf203516_)
                    (for-each
                     (lambda (_g203523203525_)
                       (std/net/bio/output#bio-write-bytes
                        _g203523203525_
                        _obuf203516_))
                     _chunks203521_)
                    (std/net/bio/output#bio-force-output _obuf203516_))
                  (std/actor/proto#raise-rpc-io-error
                   'rpc-proto-write
                   '"unexpected object"
                   _obj203517_))))))
  (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))))
