(declare (block) (standard-bindings) (extended-bindings))
(begin
  (declare (not safe))
  (define std/net/bio/output#output-buffer::t
    (make-struct-type
     'std/net/bio/output#output-buffer::t
     '#f
     '5
     'output-buffer
     '()
     '#f
     '(e wlo whi drain write)))
  (define std/net/bio/output#output-buffer?
    (make-struct-predicate std/net/bio/output#output-buffer::t))
  (define std/net/bio/output#make-output-buffer
    (lambda _$args119219_
      (apply make-struct-instance
             std/net/bio/output#output-buffer::t
             _$args119219_)))
  (define std/net/bio/output#output-buffer-e
    (make-struct-field-accessor std/net/bio/output#output-buffer::t '0))
  (define std/net/bio/output#output-buffer-wlo
    (make-struct-field-accessor std/net/bio/output#output-buffer::t '1))
  (define std/net/bio/output#output-buffer-whi
    (make-struct-field-accessor std/net/bio/output#output-buffer::t '2))
  (define std/net/bio/output#output-buffer-drain
    (make-struct-field-accessor std/net/bio/output#output-buffer::t '3))
  (define std/net/bio/output#output-buffer-write
    (make-struct-field-accessor std/net/bio/output#output-buffer::t '4))
  (define std/net/bio/output#output-buffer-e-set!
    (make-struct-field-mutator std/net/bio/output#output-buffer::t '0))
  (define std/net/bio/output#output-buffer-wlo-set!
    (make-struct-field-mutator std/net/bio/output#output-buffer::t '1))
  (define std/net/bio/output#output-buffer-whi-set!
    (make-struct-field-mutator std/net/bio/output#output-buffer::t '2))
  (define std/net/bio/output#output-buffer-drain-set!
    (make-struct-field-mutator std/net/bio/output#output-buffer::t '3))
  (define std/net/bio/output#output-buffer-write-set!
    (make-struct-field-mutator std/net/bio/output#output-buffer::t '4))
  (define std/net/bio/output#&output-buffer-e
    (make-struct-field-unchecked-accessor
     std/net/bio/output#output-buffer::t
     '0))
  (define std/net/bio/output#&output-buffer-wlo
    (make-struct-field-unchecked-accessor
     std/net/bio/output#output-buffer::t
     '1))
  (define std/net/bio/output#&output-buffer-whi
    (make-struct-field-unchecked-accessor
     std/net/bio/output#output-buffer::t
     '2))
  (define std/net/bio/output#&output-buffer-drain
    (make-struct-field-unchecked-accessor
     std/net/bio/output#output-buffer::t
     '3))
  (define std/net/bio/output#&output-buffer-write
    (make-struct-field-unchecked-accessor
     std/net/bio/output#output-buffer::t
     '4))
  (define std/net/bio/output#&output-buffer-e-set!
    (make-struct-field-unchecked-mutator
     std/net/bio/output#output-buffer::t
     '0))
  (define std/net/bio/output#&output-buffer-wlo-set!
    (make-struct-field-unchecked-mutator
     std/net/bio/output#output-buffer::t
     '1))
  (define std/net/bio/output#&output-buffer-whi-set!
    (make-struct-field-unchecked-mutator
     std/net/bio/output#output-buffer::t
     '2))
  (define std/net/bio/output#&output-buffer-drain-set!
    (make-struct-field-unchecked-mutator
     std/net/bio/output#output-buffer::t
     '3))
  (define std/net/bio/output#&output-buffer-write-set!
    (make-struct-field-unchecked-mutator
     std/net/bio/output#output-buffer::t
     '4))
  (define std/net/bio/output#bio-output-drain!
    (lambda (_buf119216_ _need119217_)
      ((##unchecked-structure-ref
        _buf119216_
        '4
        std/net/bio/output#output-buffer::t
        '#f)
       _buf119216_
       _need119217_)))
  (define std/net/bio/output#bio-output-write
    (lambda (_bytes119211_ _start119212_ _end119213_ _buf119214_)
      ((##unchecked-structure-ref
        _buf119214_
        '5
        std/net/bio/output#output-buffer::t
        '#f)
       _bytes119211_
       _start119212_
       _end119213_
       _buf119214_)))
  (define std/net/bio/output#bio-write-u8
    (lambda (_u8119205_ _buf119206_)
      (let ((_wlo119208_
             (##unchecked-structure-ref
              _buf119206_
              '2
              std/net/bio/output#output-buffer::t
              '#f))
            (_whi119209_
             (##unchecked-structure-ref
              _buf119206_
              '3
              std/net/bio/output#output-buffer::t
              '#f)))
        (if (##fx< _wlo119208_ _whi119209_)
            (begin
              (##u8vector-set!
               (##unchecked-structure-ref
                _buf119206_
                '1
                std/net/bio/output#output-buffer::t
                '#f)
               _wlo119208_
               _u8119205_)
              (##unchecked-structure-set!
               _buf119206_
               (##fx+ _wlo119208_ '1)
               '2
               std/net/bio/output#output-buffer::t
               '#f))
            (begin
              (std/net/bio/output#bio-output-drain! _buf119206_ '1)
              (std/net/bio/output#bio-write-u8 _u8119205_ _buf119206_))))))
  (define std/net/bio/output#bio-write-subu8vector
    (lambda (_bytes119186_ _start119187_ _end119188_ _buf119189_)
      (let* ((_wlo119191_
              (##unchecked-structure-ref
               _buf119189_
               '2
               std/net/bio/output#output-buffer::t
               '#f))
             (_whi119193_
              (##unchecked-structure-ref
               _buf119189_
               '3
               std/net/bio/output#output-buffer::t
               '#f))
             (_need119195_ (##fx- _end119188_ _start119187_))
             (_wlo+need119197_ (##fx+ _wlo119191_ _need119195_)))
        (if (##fx<= _wlo+need119197_ _whi119193_)
            (begin
              (##subu8vector-move!
               _bytes119186_
               _start119187_
               _end119188_
               (##unchecked-structure-ref
                _buf119189_
                '1
                std/net/bio/output#output-buffer::t
                '#f)
               _wlo119191_)
              (##unchecked-structure-set!
               _buf119189_
               _wlo+need119197_
               '2
               std/net/bio/output#output-buffer::t
               '#f))
            (if (##fx< _need119195_ _whi119193_)
                (if (##fx< _wlo119191_ _whi119193_)
                    (let* ((_have119200_ (##fx- _whi119193_ _wlo119191_))
                           (_start+have119202_
                            (##fx+ _start119187_ _have119200_)))
                      (##subu8vector-move!
                       _bytes119186_
                       _start119187_
                       _start+have119202_
                       (##unchecked-structure-ref
                        _buf119189_
                        '1
                        std/net/bio/output#output-buffer::t
                        '#f)
                       _wlo119191_)
                      (##unchecked-structure-set!
                       _buf119189_
                       _whi119193_
                       '2
                       std/net/bio/output#output-buffer::t
                       '#f)
                      (std/net/bio/output#bio-output-drain!
                       _buf119189_
                       (##fx- _need119195_ _have119200_))
                      (if (##fx< _start+have119202_ _end119188_)
                          (std/net/bio/output#bio-write-subu8vector
                           _bytes119186_
                           _start+have119202_
                           _end119188_
                           _buf119189_)
                          '#!void))
                    (begin
                      (std/net/bio/output#bio-output-drain!
                       _buf119189_
                       _need119195_)
                      (std/net/bio/output#bio-write-subu8vector
                       _bytes119186_
                       _start119187_
                       _end119188_
                       _buf119189_)))
                (begin
                  (if (##fx> _wlo119191_ '0)
                      (std/net/bio/output#bio-output-drain!
                       _buf119189_
                       _need119195_)
                      '#!void)
                  (std/net/bio/output#bio-output-write
                   _bytes119186_
                   _start119187_
                   _end119188_
                   _buf119189_)))))))
  (define std/net/bio/output#bio-write-subu8vector-unbuffered
    (lambda (_bytes119177_ _start119178_ _end119179_ _buf119180_)
      (let ((_wlo119182_
             (##unchecked-structure-ref
              _buf119180_
              '2
              std/net/bio/output#output-buffer::t
              '#f)))
        (if (##fx> _wlo119182_ '0)
            (let ((_need119184_ (##fx- _end119179_ _start119178_)))
              (std/net/bio/output#bio-output-drain! _buf119180_ _need119184_))
            '#!void)
        (std/net/bio/output#bio-output-write
         _bytes119177_
         _start119178_
         _end119179_
         _buf119180_))))
  (define std/net/bio/output#bio-write-bytes
    (lambda (_bytes119174_ _buf119175_)
      (std/net/bio/output#bio-write-subu8vector
       _bytes119174_
       '0
       (u8vector-length _bytes119174_)
       _buf119175_)))
  (define std/net/bio/output#bio-write-bytes-unbuffered
    (lambda (_bytes119171_ _buf119172_)
      (std/net/bio/output#bio-write-subu8vector-unbuffered
       _bytes119171_
       '0
       (u8vector-length _bytes119171_)
       _buf119172_)))
  (define std/net/bio/output#bio-write-u32
    (lambda (_u32119161_ _buf119162_)
      (let* ((_wlo119164_
              (##unchecked-structure-ref
               _buf119162_
               '2
               std/net/bio/output#output-buffer::t
               '#f))
             (_whi119166_
              (##unchecked-structure-ref
               _buf119162_
               '3
               std/net/bio/output#output-buffer::t
               '#f))
             (_wlo+4119168_ (##fx+ _wlo119164_ '4)))
        (if (##fx<= _wlo+4119168_ _whi119166_)
            (begin
              (std/net/bio/output#bio-put-u32
               _u32119161_
               (##unchecked-structure-ref
                _buf119162_
                '1
                std/net/bio/output#output-buffer::t
                '#f)
               _wlo119164_)
              (##unchecked-structure-set!
               _buf119162_
               _wlo+4119168_
               '2
               std/net/bio/output#output-buffer::t
               '#f))
            (begin
              (std/net/bio/output#bio-output-drain! _buf119162_ '4)
              (std/net/bio/output#bio-write-u32 _u32119161_ _buf119162_))))))
  (define std/net/bio/output#bio-put-u32
    (lambda (_u32119154_ _u8v119155_ _start119156_)
      (if (fixnum? _u32119154_)
          (begin
            (##u8vector-set!
             _u8v119155_
             _start119156_
             (##fxand (##fxarithmetic-shift-right _u32119154_ '24) '255))
            (##u8vector-set!
             _u8v119155_
             (##fx+ _start119156_ '1)
             (##fxand (##fxarithmetic-shift-right _u32119154_ '16) '255))
            (##u8vector-set!
             _u8v119155_
             (##fx+ _start119156_ '2)
             (##fxand (##fxarithmetic-shift-right _u32119154_ '8) '255))
            (##u8vector-set!
             _u8v119155_
             (##fx+ _start119156_ '3)
             (##fxand _u32119154_ '255)))
          (let ((_b0119158_ (bitwise-and _u32119154_ '255))
                (_bits119159_ (arithmetic-shift _u32119154_ '-8)))
            (##u8vector-set!
             _u8v119155_
             _start119156_
             (##fxand (##fxarithmetic-shift-right _bits119159_ '16) '255))
            (##u8vector-set!
             _u8v119155_
             (##fx+ _start119156_ '1)
             (##fxand (##fxarithmetic-shift-right _bits119159_ '8) '255))
            (##u8vector-set!
             _u8v119155_
             (##fx+ _start119156_ '2)
             (##fxand _bits119159_ '255))
            (##u8vector-set!
             _u8v119155_
             (##fx+ _start119156_ '3)
             _b0119158_)))))
  (define std/net/bio/output#2^32 (expt '2 '32))
  (define std/net/bio/output#bio-write-s32
    (lambda (_s32119149_ _buf119150_)
      (let ((_u32119152_
             (if (< _s32119149_ '0)
                 (+ std/net/bio/output#2^32 _s32119149_)
                 _s32119149_)))
        (std/net/bio/output#bio-write-u32 _u32119152_ _buf119150_))))
  (define std/net/bio/output#bio-write-u16
    (lambda (_u16119139_ _buf119140_)
      (let* ((_wlo119142_
              (##unchecked-structure-ref
               _buf119140_
               '2
               std/net/bio/output#output-buffer::t
               '#f))
             (_whi119144_
              (##unchecked-structure-ref
               _buf119140_
               '3
               std/net/bio/output#output-buffer::t
               '#f))
             (_wlo+2119146_ (##fx+ _wlo119142_ '2)))
        (if (##fx<= _wlo+2119146_ _whi119144_)
            (begin
              (std/net/bio/output#bio-put-u16
               _u16119139_
               (##unchecked-structure-ref
                _buf119140_
                '1
                std/net/bio/output#output-buffer::t
                '#f)
               _wlo119142_)
              (##unchecked-structure-set!
               _buf119140_
               _wlo+2119146_
               '2
               std/net/bio/output#output-buffer::t
               '#f))
            (begin
              (std/net/bio/output#bio-output-drain! _buf119140_ '2)
              (std/net/bio/output#bio-write-u16 _u16119139_ _buf119140_))))))
  (define std/net/bio/output#bio-put-u16
    (lambda (_u16119135_ _u8v119136_ _start119137_)
      (##u8vector-set!
       _u8v119136_
       _start119137_
       (##fxand (##fxarithmetic-shift-right _u16119135_ '8) '255))
      (##u8vector-set!
       _u8v119136_
       (##fx+ _start119137_ '1)
       (##fxand _u16119135_ '255))))
  (define std/net/bio/output#2^16 (expt '2 '16))
  (define std/net/bio/output#bio-write-s16
    (lambda (_s16119130_ _buf119131_)
      (let ((_u16119133_
             (if (##fx< _s16119130_ '0)
                 (##fx+ std/net/bio/output#2^16 _s16119130_)
                 _s16119130_)))
        (std/net/bio/output#bio-write-u16 _u16119133_ _buf119131_))))
  (define std/net/bio/output#bio-write-char
    (lambda (_char119125_ _buf119126_)
      (let ((_c119128_ (##char->integer _char119125_)))
        (if (##fx<= _c119128_ '127)
            (std/net/bio/output#bio-write-u8 _c119128_ _buf119126_)
            (if (##fx<= _c119128_ '2047)
                (begin
                  (std/net/bio/output#bio-write-u8
                   (##fxior '192 (##fxarithmetic-shift-right _c119128_ '6))
                   _buf119126_)
                  (std/net/bio/output#bio-write-u8
                   (##fxior '128 (##fxand _c119128_ '63))
                   _buf119126_))
                (if (##fx<= _c119128_ '65535)
                    (begin
                      (std/net/bio/output#bio-write-u8
                       (##fxior '224
                                (##fxarithmetic-shift-right _c119128_ '12))
                       _buf119126_)
                      (std/net/bio/output#bio-write-u8
                       (##fxior '128
                                (##fxand (##fxarithmetic-shift-right
                                          _c119128_
                                          '6)
                                         '63))
                       _buf119126_)
                      (std/net/bio/output#bio-write-u8
                       (##fxior '128 (##fxand _c119128_ '63))
                       _buf119126_))
                    (begin
                      (std/net/bio/output#bio-write-u8
                       (##fxior '240
                                (##fxarithmetic-shift-right _c119128_ '18))
                       _buf119126_)
                      (std/net/bio/output#bio-write-u8
                       (##fxior '128
                                (##fxand (##fxarithmetic-shift-right
                                          _c119128_
                                          '12)
                                         '63))
                       _buf119126_)
                      (std/net/bio/output#bio-write-u8
                       (##fxior '128
                                (##fxand (##fxarithmetic-shift-right
                                          _c119128_
                                          '6)
                                         '63))
                       _buf119126_)
                      (std/net/bio/output#bio-write-u8
                       (##fxior '128 (##fxand _c119128_ '63))
                       _buf119126_))))))))
  (define std/net/bio/output#bio-write-substring
    (lambda (_str119116_ _start119117_ _end119118_ _buf119119_)
      (let _lp119121_ ((_i119123_ _start119117_))
        (if (##fx< _i119123_ _end119118_)
            (begin
              (std/net/bio/output#bio-write-char
               (##string-ref _str119116_ _i119123_)
               _buf119119_)
              (_lp119121_ (##fx+ _i119123_ '1)))
            '#!void))))
  (define std/net/bio/output#bio-write-string
    (lambda (_str119113_ _buf119114_)
      (std/net/bio/output#bio-write-substring
       _str119113_
       '0
       (string-length _str119113_)
       _buf119114_)))
  (define std/net/bio/output#bio-force-output
    (lambda (_buf119109_)
      (let ((_wlo119111_
             (##unchecked-structure-ref
              _buf119109_
              '2
              std/net/bio/output#output-buffer::t
              '#f)))
        (if (##fx> _wlo119111_ '0)
            (std/net/bio/output#bio-output-drain! _buf119109_ '0)
            '#!void)))))
