(declare (block) (standard-bindings) (extended-bindings))
(begin
  (declare (not safe))
  (define std/net/bio/buffer#open-input-buffer__%
    (lambda (_bytes531_ _rlo532_ _rhi533_)
      (##structure
       std/net/bio/input#input-buffer::t
       _bytes531_
       _rlo532_
       _rhi533_
       std/net/bio/buffer#fixed-buffer-fill!
       std/net/bio/buffer#fixed-buffer-read)))
  (define std/net/bio/buffer#open-input-buffer__0
    (lambda (_bytes538_)
      (let* ((_rlo540_ '0) (_rhi542_ (u8vector-length _bytes538_)))
        (std/net/bio/buffer#open-input-buffer__%
         _bytes538_
         _rlo540_
         _rhi542_))))
  (define std/net/bio/buffer#open-input-buffer__1
    (lambda (_bytes544_ _rlo545_)
      (let ((_rhi547_ (u8vector-length _bytes544_)))
        (std/net/bio/buffer#open-input-buffer__%
         _bytes544_
         _rlo545_
         _rhi547_))))
  (define std/net/bio/buffer#open-input-buffer
    (lambda _g4190_
      (let ((_g4189_ (##length _g4190_)))
        (cond ((##fx= _g4189_ 1)
               (apply std/net/bio/buffer#open-input-buffer__0 _g4190_))
              ((##fx= _g4189_ 2)
               (apply std/net/bio/buffer#open-input-buffer__1 _g4190_))
              ((##fx= _g4189_ 3)
               (apply std/net/bio/buffer#open-input-buffer__% _g4190_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/net/bio/buffer#open-input-buffer
                _g4190_))))))
  (define std/net/bio/buffer#fixed-buffer-fill!
    (lambda (_buf527_ _need528_) '0))
  (define std/net/bio/buffer#fixed-buffer-read
    (lambda (_bytes522_ _start523_ _end524_ _buf525_) '0))
  (define std/net/bio/buffer#delimited-input-buffer::t
    (make-struct-type
     'std/net/bio/buffer#delimited-input-buffer::t
     std/net/bio/input#input-buffer::t
     '2
     'delimited-input-buffer
     '()
     '#f
     '(buf limit)))
  (define std/net/bio/buffer#delimited-input-buffer?
    (make-struct-predicate std/net/bio/buffer#delimited-input-buffer::t))
  (define std/net/bio/buffer#make-delimited-input-buffer
    (lambda _$args519_
      (apply make-struct-instance
             std/net/bio/buffer#delimited-input-buffer::t
             _$args519_)))
  (define std/net/bio/buffer#delimited-input-buffer-buf
    (make-struct-field-accessor
     std/net/bio/buffer#delimited-input-buffer::t
     '0))
  (define std/net/bio/buffer#delimited-input-buffer-limit
    (make-struct-field-accessor
     std/net/bio/buffer#delimited-input-buffer::t
     '1))
  (define std/net/bio/buffer#delimited-input-buffer-buf-set!
    (make-struct-field-mutator
     std/net/bio/buffer#delimited-input-buffer::t
     '0))
  (define std/net/bio/buffer#delimited-input-buffer-limit-set!
    (make-struct-field-mutator
     std/net/bio/buffer#delimited-input-buffer::t
     '1))
  (define std/net/bio/buffer#&delimited-input-buffer-buf
    (make-struct-field-unchecked-accessor
     std/net/bio/buffer#delimited-input-buffer::t
     '0))
  (define std/net/bio/buffer#&delimited-input-buffer-limit
    (make-struct-field-unchecked-accessor
     std/net/bio/buffer#delimited-input-buffer::t
     '1))
  (define std/net/bio/buffer#&delimited-input-buffer-buf-set!
    (make-struct-field-unchecked-mutator
     std/net/bio/buffer#delimited-input-buffer::t
     '0))
  (define std/net/bio/buffer#&delimited-input-buffer-limit-set!
    (make-struct-field-unchecked-mutator
     std/net/bio/buffer#delimited-input-buffer::t
     '1))
  (define std/net/bio/buffer#open-delimited-input-buffer
    (lambda (_buf509_ _limit510_)
      (let* ((_rlo512_
              (##unchecked-structure-ref
               _buf509_
               '2
               std/net/bio/input#input-buffer::t
               '#f))
             (_rhi514_
              (##unchecked-structure-ref
               _buf509_
               '3
               std/net/bio/input#input-buffer::t
               '#f))
             (_have516_ (fx- _rhi514_ _rlo512_)))
        (if (fx> _have516_ _limit510_)
            (begin
              (set! _rhi514_ (fx+ _rlo512_ _limit510_))
              (set! _limit510_ '0))
            (set! _limit510_ (fx- _limit510_ _have516_)))
        (##unchecked-structure-set!
         _buf509_
         _rhi514_
         '2
         std/net/bio/input#input-buffer::t
         '#f)
        (##structure
         std/net/bio/buffer#delimited-input-buffer::t
         (##unchecked-structure-ref
          _buf509_
          '1
          std/net/bio/input#input-buffer::t
          '#f)
         _rlo512_
         _rhi514_
         std/net/bio/buffer#delimited-buffer-fill!
         std/net/bio/buffer#delimited-buffer-read
         _buf509_
         _limit510_))))
  (define std/net/bio/buffer#delimited-buffer-fill!
    (lambda (_buf495_ _need496_)
      (let* ((_limit498_
              (##unchecked-structure-ref
               _buf495_
               '7
               std/net/bio/buffer#delimited-input-buffer::t
               '#f))
             (_have500_
              (fx- (##unchecked-structure-ref
                    _buf495_
                    '3
                    std/net/bio/input#input-buffer::t
                    '#f)
                   (##unchecked-structure-ref
                    _buf495_
                    '2
                    std/net/bio/input#input-buffer::t
                    '#f)))
             (_need502_ (fxmin _need496_ (fx+ _have500_ _limit498_))))
        (if (fx= _limit498_ '0)
            '0
            (let ((_xbuf505_
                   (##unchecked-structure-ref
                    _buf495_
                    '6
                    std/net/bio/buffer#delimited-input-buffer::t
                    '#f)))
              (##unchecked-structure-set!
               _xbuf505_
               (##unchecked-structure-ref
                _buf495_
                '2
                std/net/bio/input#input-buffer::t
                '#f)
               '2
               std/net/bio/input#input-buffer::t
               '#f)
              (##unchecked-structure-set!
               _xbuf505_
               (##unchecked-structure-ref
                _buf495_
                '3
                std/net/bio/input#input-buffer::t
                '#f)
               '3
               std/net/bio/input#input-buffer::t
               '#f)
              (let ((_rd507_ (std/net/bio/input#bio-input-fill!
                              _xbuf505_
                              _need502_)))
                (if (fx= _rd507_ '0)
                    '0
                    (if (fx<= _rd507_ _limit498_)
                        (begin
                          (##unchecked-structure-set!
                           _buf495_
                           (##unchecked-structure-ref
                            _xbuf505_
                            '2
                            std/net/bio/input#input-buffer::t
                            '#f)
                           '2
                           std/net/bio/input#input-buffer::t
                           '#f)
                          (##unchecked-structure-set!
                           _buf495_
                           (##unchecked-structure-ref
                            _xbuf505_
                            '3
                            std/net/bio/input#input-buffer::t
                            '#f)
                           '3
                           std/net/bio/input#input-buffer::t
                           '#f)
                          (##unchecked-structure-set!
                           _buf495_
                           (fx- _limit498_ _rd507_)
                           '7
                           std/net/bio/buffer#delimited-input-buffer::t
                           '#f)
                          (##unchecked-structure-set!
                           _xbuf505_
                           (##unchecked-structure-ref
                            _buf495_
                            '3
                            std/net/bio/input#input-buffer::t
                            '#f)
                           '2
                           std/net/bio/input#input-buffer::t
                           '#f)
                          _rd507_)
                        (begin
                          (##unchecked-structure-set!
                           _buf495_
                           (##unchecked-structure-ref
                            _xbuf505_
                            '2
                            std/net/bio/input#input-buffer::t
                            '#f)
                           '2
                           std/net/bio/input#input-buffer::t
                           '#f)
                          (##unchecked-structure-set!
                           _buf495_
                           (fx+ (##unchecked-structure-ref
                                 _buf495_
                                 '2
                                 std/net/bio/input#input-buffer::t
                                 '#f)
                                _have500_
                                _limit498_)
                           '3
                           std/net/bio/input#input-buffer::t
                           '#f)
                          (##unchecked-structure-set!
                           _buf495_
                           '0
                           '7
                           std/net/bio/buffer#delimited-input-buffer::t
                           '#f)
                          (##unchecked-structure-set!
                           _xbuf505_
                           (##unchecked-structure-ref
                            _buf495_
                            '3
                            std/net/bio/input#input-buffer::t
                            '#f)
                           '2
                           std/net/bio/input#input-buffer::t
                           '#f)
                          _limit498_)))))))))
  (define std/net/bio/buffer#delimited-buffer-read
    (lambda (_bytes479_ _start480_ _end481_ _buf482_)
      (let* ((_limit484_
              (##unchecked-structure-ref
               _buf482_
               '7
               std/net/bio/buffer#delimited-input-buffer::t
               '#f))
             (_want486_ (fx- _end481_ _start480_))
             (_need488_ (fxmin _want486_ _limit484_))
             (_end490_ (fx+ _start480_ _need488_))
             (_rd492_ (std/net/bio/input#bio-input-read
                       _bytes479_
                       _start480_
                       _end490_
                       (##unchecked-structure-ref
                        _buf482_
                        '6
                        std/net/bio/buffer#delimited-input-buffer::t
                        '#f))))
        (##unchecked-structure-set!
         _buf482_
         (fx- _limit484_ _rd492_)
         '7
         std/net/bio/buffer#delimited-input-buffer::t
         '#f)
        _rd492_)))
  (define std/net/bio/buffer#open-fixed-output-buffer
    (lambda (_size477_)
      (std/net/bio/buffer#make-fixed-output-buffer
       (make-u8vector _size477_)
       '0
       _size477_)))
  (define std/net/bio/buffer#make-fixed-output-buffer
    (lambda (_bytes473_ _wlo474_ _whi475_)
      (##structure
       std/net/bio/output#output-buffer::t
       _bytes473_
       _wlo474_
       _whi475_
       std/net/bio/buffer#fixed-buffer-drain!
       std/net/bio/buffer#fixed-buffer-write)))
  (define std/net/bio/buffer#fixed-buffer-drain!
    (lambda (_buf470_ _need471_)
      (std/error#raise-io-error
       'fixed-buffer-drain!
       '"insufficient buffer space"
       _buf470_
       _need471_)))
  (define std/net/bio/buffer#fixed-buffer-write
    (lambda (_bytes465_ _start466_ _end467_ _buf468_)
      (std/error#raise-io-error
       'fixed-buffer-write
       '"insufficient buffer space"
       _buf468_)))
  (define std/net/bio/buffer#chunked-output-buffer::t
    (make-struct-type
     'std/net/bio/buffer#chunked-output-buffer::t
     std/net/bio/output#output-buffer::t
     '1
     'chunked-output-buffer
     '()
     '#f
     '(chunks)))
  (define std/net/bio/buffer#chunked-output-buffer?
    (make-struct-predicate std/net/bio/buffer#chunked-output-buffer::t))
  (define std/net/bio/buffer#make-chunked-output-buffer
    (lambda _$args462_
      (apply make-struct-instance
             std/net/bio/buffer#chunked-output-buffer::t
             _$args462_)))
  (define std/net/bio/buffer#chunked-output-buffer-chunks
    (make-struct-field-accessor
     std/net/bio/buffer#chunked-output-buffer::t
     '0))
  (define std/net/bio/buffer#chunked-output-buffer-chunks-set!
    (make-struct-field-mutator std/net/bio/buffer#chunked-output-buffer::t '0))
  (define std/net/bio/buffer#&chunked-output-buffer-chunks
    (make-struct-field-unchecked-accessor
     std/net/bio/buffer#chunked-output-buffer::t
     '0))
  (define std/net/bio/buffer#&chunked-output-buffer-chunks-set!
    (make-struct-field-unchecked-mutator
     std/net/bio/buffer#chunked-output-buffer::t
     '0))
  (define std/net/bio/buffer#open-chunked-output-buffer__%
    (lambda (_chunksz452_)
      (##structure
       std/net/bio/buffer#chunked-output-buffer::t
       (make-u8vector _chunksz452_)
       '0
       _chunksz452_
       std/net/bio/buffer#chunked-buffer-drain!
       std/net/bio/buffer#chunked-buffer-write
       '())))
  (define std/net/bio/buffer#open-chunked-output-buffer__0
    (lambda ()
      (let ((_chunksz458_ '1024))
        (std/net/bio/buffer#open-chunked-output-buffer__% _chunksz458_))))
  (define std/net/bio/buffer#open-chunked-output-buffer
    (lambda _g4192_
      (let ((_g4191_ (##length _g4192_)))
        (cond ((##fx= _g4191_ 0)
               (apply std/net/bio/buffer#open-chunked-output-buffer__0
                      _g4192_))
              ((##fx= _g4191_ 1)
               (apply std/net/bio/buffer#open-chunked-output-buffer__%
                      _g4192_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/net/bio/buffer#open-chunked-output-buffer
                _g4192_))))))
  (define std/net/bio/buffer#open-serializer-output-buffer__%
    (lambda (_chunksz441_)
      (##structure
       std/net/bio/buffer#chunked-output-buffer::t
       (make-u8vector _chunksz441_)
       '0
       _chunksz441_
       std/net/bio/buffer#chunked-buffer-drain!
       std/net/bio/buffer#chunked-buffer-push
       '())))
  (define std/net/bio/buffer#open-serializer-output-buffer__0
    (lambda ()
      (let ((_chunksz447_ '256))
        (std/net/bio/buffer#open-serializer-output-buffer__% _chunksz447_))))
  (define std/net/bio/buffer#open-serializer-output-buffer
    (lambda _g4194_
      (let ((_g4193_ (##length _g4194_)))
        (cond ((##fx= _g4193_ 0)
               (apply std/net/bio/buffer#open-serializer-output-buffer__0
                      _g4194_))
              ((##fx= _g4193_ 1)
               (apply std/net/bio/buffer#open-serializer-output-buffer__%
                      _g4194_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/net/bio/buffer#open-serializer-output-buffer
                _g4194_))))))
  (define std/net/bio/buffer#chunked-buffer-drain!
    (lambda (_buf432_ _need433_)
      (let ((_wlo435_
             (##unchecked-structure-ref
              _buf432_
              '2
              std/net/bio/output#output-buffer::t
              '#f))
            (_whi436_
             (##unchecked-structure-ref
              _buf432_
              '3
              std/net/bio/output#output-buffer::t
              '#f))
            (_chunk437_
             (##unchecked-structure-ref
              _buf432_
              '1
              std/net/bio/output#output-buffer::t
              '#f))
            (_chunks438_
             (##unchecked-structure-ref
              _buf432_
              '6
              std/net/bio/buffer#chunked-output-buffer::t
              '#f)))
        (if (##fx< _wlo435_ _whi436_)
            (##u8vector-shrink! _chunk437_ _wlo435_)
            '#!void)
        (##unchecked-structure-set!
         _buf432_
         (cons _chunk437_ _chunks438_)
         '6
         std/net/bio/buffer#chunked-output-buffer::t
         '#f)
        (##unchecked-structure-set!
         _buf432_
         (make-u8vector _whi436_)
         '1
         std/net/bio/output#output-buffer::t
         '#f)
        (##unchecked-structure-set!
         _buf432_
         '0
         '2
         std/net/bio/output#output-buffer::t
         '#f))))
  (define std/net/bio/buffer#chunked-buffer-write
    (lambda (_bytes425_ _start426_ _end427_ _buf428_)
      (let ((_chunks430_
             (##unchecked-structure-ref
              _buf428_
              '6
              std/net/bio/buffer#chunked-output-buffer::t
              '#f)))
        (##unchecked-structure-set!
         _buf428_
         (cons (##subu8vector _bytes425_ _start426_ _end427_) _chunks430_)
         '6
         std/net/bio/buffer#chunked-output-buffer::t
         '#f))))
  (define std/net/bio/buffer#chunked-buffer-push
    (lambda (_bytes415_ _start416_ _end417_ _buf418_)
      (let* ((_bytes420_
              (if (and (##fx= _start416_ '0)
                       (##fx= _end417_ (##u8vector-length _bytes415_)))
                  _bytes415_
                  (##subu8vector _bytes415_ _start416_ _end417_)))
             (_chunks422_
              (##unchecked-structure-ref
               _buf418_
               '6
               std/net/bio/buffer#chunked-output-buffer::t
               '#f)))
        (##unchecked-structure-set!
         _buf418_
         (cons _bytes420_ _chunks422_)
         '6
         std/net/bio/buffer#chunked-output-buffer::t
         '#f))))
  (define std/net/bio/buffer#chunked-output-u8vector
    (lambda (_buf411_)
      (let ((_chunks413_ (std/net/bio/buffer#chunked-output-chunks _buf411_)))
        (if (null? (##cdr _chunks413_))
            (##car _chunks413_)
            (##append-u8vectors _chunks413_)))))
  (define std/net/bio/buffer#chunked-output-chunks
    (lambda (_buf402_)
      (let* ((_wlo404_
              (##unchecked-structure-ref
               _buf402_
               '2
               std/net/bio/output#output-buffer::t
               '#f))
             (_chunk406_
              (##unchecked-structure-ref
               _buf402_
               '1
               std/net/bio/output#output-buffer::t
               '#f))
             (_chunks408_
              (##unchecked-structure-ref
               _buf402_
               '6
               std/net/bio/buffer#chunked-output-buffer::t
               '#f)))
        (if (##fx> _wlo404_ '0)
            (begin
              (##u8vector-shrink! _chunk406_ _wlo404_)
              (if (null? _chunks408_)
                  (cons _chunk406_ '())
                  (std/srfi/1#reverse! (cons _chunk406_ _chunks408_))))
            (std/srfi/1#reverse! _chunks408_)))))
  (define std/net/bio/buffer#chunked-output-length
    (lambda (_buf394_)
      (let ((_wlo396_
             (##unchecked-structure-ref
              _buf394_
              '2
              std/net/bio/output#output-buffer::t
              '#f))
            (_chunks397_
             (##unchecked-structure-ref
              _buf394_
              '6
              std/net/bio/buffer#chunked-output-buffer::t
              '#f)))
        (if (null? _chunks397_)
            _wlo396_
            (foldl1 (lambda (_chunk399_ _r400_)
                      (##fx+ (##u8vector-length _chunk399_) _r400_))
                    _wlo396_
                    _chunks397_))))))
