(declare (block) (standard-bindings) (extended-bindings))
(begin
  (declare (not safe))
  (define std/net/bio/buffer#open-input-buffer__%
    (lambda (_bytes119375_ _rlo119376_ _rhi119377_)
      (##structure
       std/net/bio/input#input-buffer::t
       _bytes119375_
       _rlo119376_
       _rhi119377_
       std/net/bio/buffer#fixed-buffer-fill!
       std/net/bio/buffer#fixed-buffer-read)))
  (define std/net/bio/buffer#open-input-buffer__0
    (lambda (_bytes119382_)
      (let* ((_rlo119384_ '0) (_rhi119386_ (u8vector-length _bytes119382_)))
        (std/net/bio/buffer#open-input-buffer__%
         _bytes119382_
         _rlo119384_
         _rhi119386_))))
  (define std/net/bio/buffer#open-input-buffer__1
    (lambda (_bytes119388_ _rlo119389_)
      (let ((_rhi119391_ (u8vector-length _bytes119388_)))
        (std/net/bio/buffer#open-input-buffer__%
         _bytes119388_
         _rlo119389_
         _rhi119391_))))
  (define std/net/bio/buffer#open-input-buffer
    (lambda _g119397_
      (let ((_g119396_ (length _g119397_)))
        (cond ((##fx= _g119396_ 1)
               (apply std/net/bio/buffer#open-input-buffer__0 _g119397_))
              ((##fx= _g119396_ 2)
               (apply std/net/bio/buffer#open-input-buffer__1 _g119397_))
              ((##fx= _g119396_ 3)
               (apply std/net/bio/buffer#open-input-buffer__% _g119397_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/net/bio/buffer#open-input-buffer
                _g119397_))))))
  (define std/net/bio/buffer#fixed-buffer-fill!
    (lambda (_buf119371_ _need119372_) '0))
  (define std/net/bio/buffer#fixed-buffer-read
    (lambda (_bytes119366_ _start119367_ _end119368_ _buf119369_) '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 _$args119363_
      (apply make-struct-instance
             std/net/bio/buffer#delimited-input-buffer::t
             _$args119363_)))
  (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 (_buf119353_ _limit119354_)
      (let* ((_rlo119356_
              (##unchecked-structure-ref
               _buf119353_
               '2
               std/net/bio/input#input-buffer::t
               '#f))
             (_rhi119358_
              (##unchecked-structure-ref
               _buf119353_
               '3
               std/net/bio/input#input-buffer::t
               '#f))
             (_have119360_ (fx- _rhi119358_ _rlo119356_)))
        (if (fx> _have119360_ _limit119354_)
            (begin
              (set! _rhi119358_ (fx+ _rlo119356_ _limit119354_))
              (set! _limit119354_ '0))
            (set! _limit119354_ (fx- _limit119354_ _have119360_)))
        (##unchecked-structure-set!
         _buf119353_
         _rhi119358_
         '2
         std/net/bio/input#input-buffer::t
         '#f)
        (##structure
         std/net/bio/buffer#delimited-input-buffer::t
         (##unchecked-structure-ref
          _buf119353_
          '1
          std/net/bio/input#input-buffer::t
          '#f)
         _rlo119356_
         _rhi119358_
         std/net/bio/buffer#delimited-buffer-fill!
         std/net/bio/buffer#delimited-buffer-read
         _buf119353_
         _limit119354_))))
  (define std/net/bio/buffer#delimited-buffer-fill!
    (lambda (_buf119339_ _need119340_)
      (let* ((_limit119342_
              (##unchecked-structure-ref
               _buf119339_
               '7
               std/net/bio/buffer#delimited-input-buffer::t
               '#f))
             (_have119344_
              (fx- (##unchecked-structure-ref
                    _buf119339_
                    '3
                    std/net/bio/input#input-buffer::t
                    '#f)
                   (##unchecked-structure-ref
                    _buf119339_
                    '2
                    std/net/bio/input#input-buffer::t
                    '#f)))
             (_need119346_
              (fxmin _need119340_ (fx+ _have119344_ _limit119342_))))
        (if (fx= _limit119342_ '0)
            '0
            (let ((_xbuf119349_
                   (##unchecked-structure-ref
                    _buf119339_
                    '6
                    std/net/bio/buffer#delimited-input-buffer::t
                    '#f)))
              (##unchecked-structure-set!
               _xbuf119349_
               (##unchecked-structure-ref
                _buf119339_
                '2
                std/net/bio/input#input-buffer::t
                '#f)
               '2
               std/net/bio/input#input-buffer::t
               '#f)
              (##unchecked-structure-set!
               _xbuf119349_
               (##unchecked-structure-ref
                _buf119339_
                '3
                std/net/bio/input#input-buffer::t
                '#f)
               '3
               std/net/bio/input#input-buffer::t
               '#f)
              (let ((_rd119351_
                     (std/net/bio/input#bio-input-fill!
                      _xbuf119349_
                      _need119346_)))
                (if (fx= _rd119351_ '0)
                    '0
                    (if (fx<= _rd119351_ _limit119342_)
                        (begin
                          (##unchecked-structure-set!
                           _buf119339_
                           (##unchecked-structure-ref
                            _xbuf119349_
                            '2
                            std/net/bio/input#input-buffer::t
                            '#f)
                           '2
                           std/net/bio/input#input-buffer::t
                           '#f)
                          (##unchecked-structure-set!
                           _buf119339_
                           (##unchecked-structure-ref
                            _xbuf119349_
                            '3
                            std/net/bio/input#input-buffer::t
                            '#f)
                           '3
                           std/net/bio/input#input-buffer::t
                           '#f)
                          (##unchecked-structure-set!
                           _buf119339_
                           (fx- _limit119342_ _rd119351_)
                           '7
                           std/net/bio/buffer#delimited-input-buffer::t
                           '#f)
                          (##unchecked-structure-set!
                           _xbuf119349_
                           (##unchecked-structure-ref
                            _buf119339_
                            '3
                            std/net/bio/input#input-buffer::t
                            '#f)
                           '2
                           std/net/bio/input#input-buffer::t
                           '#f)
                          _rd119351_)
                        (begin
                          (##unchecked-structure-set!
                           _buf119339_
                           (##unchecked-structure-ref
                            _xbuf119349_
                            '2
                            std/net/bio/input#input-buffer::t
                            '#f)
                           '2
                           std/net/bio/input#input-buffer::t
                           '#f)
                          (##unchecked-structure-set!
                           _buf119339_
                           (fx+ (##unchecked-structure-ref
                                 _buf119339_
                                 '2
                                 std/net/bio/input#input-buffer::t
                                 '#f)
                                _have119344_
                                _limit119342_)
                           '3
                           std/net/bio/input#input-buffer::t
                           '#f)
                          (##unchecked-structure-set!
                           _buf119339_
                           '0
                           '7
                           std/net/bio/buffer#delimited-input-buffer::t
                           '#f)
                          (##unchecked-structure-set!
                           _xbuf119349_
                           (##unchecked-structure-ref
                            _buf119339_
                            '3
                            std/net/bio/input#input-buffer::t
                            '#f)
                           '2
                           std/net/bio/input#input-buffer::t
                           '#f)
                          _limit119342_)))))))))
  (define std/net/bio/buffer#delimited-buffer-read
    (lambda (_bytes119323_ _start119324_ _end119325_ _buf119326_)
      (let* ((_limit119328_
              (##unchecked-structure-ref
               _buf119326_
               '7
               std/net/bio/buffer#delimited-input-buffer::t
               '#f))
             (_want119330_ (fx- _end119325_ _start119324_))
             (_need119332_ (fxmin _want119330_ _limit119328_))
             (_end119334_ (fx+ _start119324_ _need119332_))
             (_rd119336_
              (std/net/bio/input#bio-input-read
               _bytes119323_
               _start119324_
               _end119334_
               (##unchecked-structure-ref
                _buf119326_
                '6
                std/net/bio/buffer#delimited-input-buffer::t
                '#f))))
        (##unchecked-structure-set!
         _buf119326_
         (fx- _limit119328_ _rd119336_)
         '7
         std/net/bio/buffer#delimited-input-buffer::t
         '#f)
        _rd119336_)))
  (define std/net/bio/buffer#open-fixed-output-buffer
    (lambda (_size119321_)
      (std/net/bio/buffer#make-fixed-output-buffer
       (make-u8vector _size119321_)
       '0
       _size119321_)))
  (define std/net/bio/buffer#make-fixed-output-buffer
    (lambda (_bytes119317_ _wlo119318_ _whi119319_)
      (##structure
       std/net/bio/output#output-buffer::t
       _bytes119317_
       _wlo119318_
       _whi119319_
       std/net/bio/buffer#fixed-buffer-drain!
       std/net/bio/buffer#fixed-buffer-write)))
  (define std/net/bio/buffer#fixed-buffer-drain!
    (lambda (_buf119314_ _need119315_)
      (std/error#raise-io-error
       'fixed-buffer-drain!
       '"insufficient buffer space"
       _buf119314_
       _need119315_)))
  (define std/net/bio/buffer#fixed-buffer-write
    (lambda (_bytes119309_ _start119310_ _end119311_ _buf119312_)
      (std/error#raise-io-error
       'fixed-buffer-write
       '"insufficient buffer space"
       _buf119312_)))
  (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 _$args119306_
      (apply make-struct-instance
             std/net/bio/buffer#chunked-output-buffer::t
             _$args119306_)))
  (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 (_chunksz119296_)
      (##structure
       std/net/bio/buffer#chunked-output-buffer::t
       (make-u8vector _chunksz119296_)
       '0
       _chunksz119296_
       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 ((_chunksz119302_ '1024))
        (std/net/bio/buffer#open-chunked-output-buffer__% _chunksz119302_))))
  (define std/net/bio/buffer#open-chunked-output-buffer
    (lambda _g119399_
      (let ((_g119398_ (length _g119399_)))
        (cond ((##fx= _g119398_ 0)
               (apply std/net/bio/buffer#open-chunked-output-buffer__0
                      _g119399_))
              ((##fx= _g119398_ 1)
               (apply std/net/bio/buffer#open-chunked-output-buffer__%
                      _g119399_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/net/bio/buffer#open-chunked-output-buffer
                _g119399_))))))
  (define std/net/bio/buffer#open-serializer-output-buffer__%
    (lambda (_chunksz119285_)
      (##structure
       std/net/bio/buffer#chunked-output-buffer::t
       (make-u8vector _chunksz119285_)
       '0
       _chunksz119285_
       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 ((_chunksz119291_ '256))
        (std/net/bio/buffer#open-serializer-output-buffer__%
         _chunksz119291_))))
  (define std/net/bio/buffer#open-serializer-output-buffer
    (lambda _g119401_
      (let ((_g119400_ (length _g119401_)))
        (cond ((##fx= _g119400_ 0)
               (apply std/net/bio/buffer#open-serializer-output-buffer__0
                      _g119401_))
              ((##fx= _g119400_ 1)
               (apply std/net/bio/buffer#open-serializer-output-buffer__%
                      _g119401_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/net/bio/buffer#open-serializer-output-buffer
                _g119401_))))))
  (define std/net/bio/buffer#chunked-buffer-drain!
    (lambda (_buf119276_ _need119277_)
      (let ((_wlo119279_
             (##unchecked-structure-ref
              _buf119276_
              '2
              std/net/bio/output#output-buffer::t
              '#f))
            (_whi119280_
             (##unchecked-structure-ref
              _buf119276_
              '3
              std/net/bio/output#output-buffer::t
              '#f))
            (_chunk119281_
             (##unchecked-structure-ref
              _buf119276_
              '1
              std/net/bio/output#output-buffer::t
              '#f))
            (_chunks119282_
             (##unchecked-structure-ref
              _buf119276_
              '6
              std/net/bio/buffer#chunked-output-buffer::t
              '#f)))
        (if (##fx< _wlo119279_ _whi119280_)
            (##u8vector-shrink! _chunk119281_ _wlo119279_)
            '#!void)
        (##unchecked-structure-set!
         _buf119276_
         (cons _chunk119281_ _chunks119282_)
         '6
         std/net/bio/buffer#chunked-output-buffer::t
         '#f)
        (##unchecked-structure-set!
         _buf119276_
         (make-u8vector _whi119280_)
         '1
         std/net/bio/output#output-buffer::t
         '#f)
        (##unchecked-structure-set!
         _buf119276_
         '0
         '2
         std/net/bio/output#output-buffer::t
         '#f))))
  (define std/net/bio/buffer#chunked-buffer-write
    (lambda (_bytes119269_ _start119270_ _end119271_ _buf119272_)
      (let ((_chunks119274_
             (##unchecked-structure-ref
              _buf119272_
              '6
              std/net/bio/buffer#chunked-output-buffer::t
              '#f)))
        (##unchecked-structure-set!
         _buf119272_
         (cons (##subu8vector _bytes119269_ _start119270_ _end119271_)
               _chunks119274_)
         '6
         std/net/bio/buffer#chunked-output-buffer::t
         '#f))))
  (define std/net/bio/buffer#chunked-buffer-push
    (lambda (_bytes119259_ _start119260_ _end119261_ _buf119262_)
      (let* ((_bytes119264_
              (if (and (##fx= _start119260_ '0)
                       (##fx= _end119261_ (##u8vector-length _bytes119259_)))
                  _bytes119259_
                  (##subu8vector _bytes119259_ _start119260_ _end119261_)))
             (_chunks119266_
              (##unchecked-structure-ref
               _buf119262_
               '6
               std/net/bio/buffer#chunked-output-buffer::t
               '#f)))
        (##unchecked-structure-set!
         _buf119262_
         (cons _bytes119264_ _chunks119266_)
         '6
         std/net/bio/buffer#chunked-output-buffer::t
         '#f))))
  (define std/net/bio/buffer#chunked-output-u8vector
    (lambda (_buf119255_)
      (let ((_chunks119257_
             (std/net/bio/buffer#chunked-output-chunks _buf119255_)))
        (if (null? (##cdr _chunks119257_))
            (##car _chunks119257_)
            (##append-u8vectors _chunks119257_)))))
  (define std/net/bio/buffer#chunked-output-chunks
    (lambda (_buf119246_)
      (let* ((_wlo119248_
              (##unchecked-structure-ref
               _buf119246_
               '2
               std/net/bio/output#output-buffer::t
               '#f))
             (_chunk119250_
              (##unchecked-structure-ref
               _buf119246_
               '1
               std/net/bio/output#output-buffer::t
               '#f))
             (_chunks119252_
              (##unchecked-structure-ref
               _buf119246_
               '6
               std/net/bio/buffer#chunked-output-buffer::t
               '#f)))
        (if (##fx> _wlo119248_ '0)
            (begin
              (##u8vector-shrink! _chunk119250_ _wlo119248_)
              (if (null? _chunks119252_)
                  (cons _chunk119250_ '())
                  (std/srfi/1#reverse! (cons _chunk119250_ _chunks119252_))))
            (std/srfi/1#reverse! _chunks119252_)))))
  (define std/net/bio/buffer#chunked-output-length
    (lambda (_buf119238_)
      (let ((_wlo119240_
             (##unchecked-structure-ref
              _buf119238_
              '2
              std/net/bio/output#output-buffer::t
              '#f))
            (_chunks119241_
             (##unchecked-structure-ref
              _buf119238_
              '6
              std/net/bio/buffer#chunked-output-buffer::t
              '#f)))
        (if (null? _chunks119241_)
            _wlo119240_
            (foldl1 (lambda (_chunk119243_ _r119244_)
                      (##fx+ (##u8vector-length _chunk119243_) _r119244_))
                    _wlo119240_
                    _chunks119241_))))))
