(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 _$args500_
      (apply make-struct-instance
             std/net/bio/output#output-buffer::t
             _$args500_)))
  (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 (_buf497_ _need498_)
      ((##unchecked-structure-ref
        _buf497_
        '4
        std/net/bio/output#output-buffer::t
        '#f)
       _buf497_
       _need498_)))
  (define std/net/bio/output#bio-output-write
    (lambda (_bytes492_ _start493_ _end494_ _buf495_)
      ((##unchecked-structure-ref
        _buf495_
        '5
        std/net/bio/output#output-buffer::t
        '#f)
       _bytes492_
       _start493_
       _end494_
       _buf495_)))
  (define std/net/bio/output#bio-write-u8
    (lambda (_u8486_ _buf487_)
      (let ((_wlo489_
             (##unchecked-structure-ref
              _buf487_
              '2
              std/net/bio/output#output-buffer::t
              '#f))
            (_whi490_
             (##unchecked-structure-ref
              _buf487_
              '3
              std/net/bio/output#output-buffer::t
              '#f)))
        (if (##fx< _wlo489_ _whi490_)
            (begin
              (##u8vector-set!
               (##unchecked-structure-ref
                _buf487_
                '1
                std/net/bio/output#output-buffer::t
                '#f)
               _wlo489_
               _u8486_)
              (##unchecked-structure-set!
               _buf487_
               (##fx+ _wlo489_ '1)
               '2
               std/net/bio/output#output-buffer::t
               '#f))
            (begin
              (std/net/bio/output#bio-output-drain! _buf487_ '1)
              (std/net/bio/output#bio-write-u8 _u8486_ _buf487_))))))
  (define std/net/bio/output#bio-write-subu8vector
    (lambda (_bytes467_ _start468_ _end469_ _buf470_)
      (let* ((_wlo472_
              (##unchecked-structure-ref
               _buf470_
               '2
               std/net/bio/output#output-buffer::t
               '#f))
             (_whi474_
              (##unchecked-structure-ref
               _buf470_
               '3
               std/net/bio/output#output-buffer::t
               '#f))
             (_need476_ (##fx- _end469_ _start468_))
             (_wlo+need478_ (##fx+ _wlo472_ _need476_)))
        (if (##fx<= _wlo+need478_ _whi474_)
            (begin
              (##subu8vector-move!
               _bytes467_
               _start468_
               _end469_
               (##unchecked-structure-ref
                _buf470_
                '1
                std/net/bio/output#output-buffer::t
                '#f)
               _wlo472_)
              (##unchecked-structure-set!
               _buf470_
               _wlo+need478_
               '2
               std/net/bio/output#output-buffer::t
               '#f))
            (if (##fx< _need476_ _whi474_)
                (if (##fx< _wlo472_ _whi474_)
                    (let* ((_have481_ (##fx- _whi474_ _wlo472_))
                           (_start+have483_ (##fx+ _start468_ _have481_)))
                      (##subu8vector-move!
                       _bytes467_
                       _start468_
                       _start+have483_
                       (##unchecked-structure-ref
                        _buf470_
                        '1
                        std/net/bio/output#output-buffer::t
                        '#f)
                       _wlo472_)
                      (##unchecked-structure-set!
                       _buf470_
                       _whi474_
                       '2
                       std/net/bio/output#output-buffer::t
                       '#f)
                      (std/net/bio/output#bio-output-drain!
                       _buf470_
                       (##fx- _need476_ _have481_))
                      (if (##fx< _start+have483_ _end469_)
                          (std/net/bio/output#bio-write-subu8vector
                           _bytes467_
                           _start+have483_
                           _end469_
                           _buf470_)
                          '#!void))
                    (begin
                      (std/net/bio/output#bio-output-drain! _buf470_ _need476_)
                      (std/net/bio/output#bio-write-subu8vector
                       _bytes467_
                       _start468_
                       _end469_
                       _buf470_)))
                (begin
                  (if (##fx> _wlo472_ '0)
                      (std/net/bio/output#bio-output-drain! _buf470_ _need476_)
                      '#!void)
                  (std/net/bio/output#bio-output-write
                   _bytes467_
                   _start468_
                   _end469_
                   _buf470_)))))))
  (define std/net/bio/output#bio-write-subu8vector-unbuffered
    (lambda (_bytes458_ _start459_ _end460_ _buf461_)
      (let ((_wlo463_
             (##unchecked-structure-ref
              _buf461_
              '2
              std/net/bio/output#output-buffer::t
              '#f)))
        (if (##fx> _wlo463_ '0)
            (let ((_need465_ (##fx- _end460_ _start459_)))
              (std/net/bio/output#bio-output-drain! _buf461_ _need465_))
            '#!void)
        (std/net/bio/output#bio-output-write
         _bytes458_
         _start459_
         _end460_
         _buf461_))))
  (define std/net/bio/output#bio-write-bytes
    (lambda (_bytes455_ _buf456_)
      (std/net/bio/output#bio-write-subu8vector
       _bytes455_
       '0
       (u8vector-length _bytes455_)
       _buf456_)))
  (define std/net/bio/output#bio-write-bytes-unbuffered
    (lambda (_bytes452_ _buf453_)
      (std/net/bio/output#bio-write-subu8vector-unbuffered
       _bytes452_
       '0
       (u8vector-length _bytes452_)
       _buf453_)))
  (define std/net/bio/output#bio-write-u32
    (lambda (_u32442_ _buf443_)
      (let* ((_wlo445_
              (##unchecked-structure-ref
               _buf443_
               '2
               std/net/bio/output#output-buffer::t
               '#f))
             (_whi447_
              (##unchecked-structure-ref
               _buf443_
               '3
               std/net/bio/output#output-buffer::t
               '#f))
             (_wlo+4449_ (##fx+ _wlo445_ '4)))
        (if (##fx<= _wlo+4449_ _whi447_)
            (begin
              (std/net/bio/output#bio-put-u32
               _u32442_
               (##unchecked-structure-ref
                _buf443_
                '1
                std/net/bio/output#output-buffer::t
                '#f)
               _wlo445_)
              (##unchecked-structure-set!
               _buf443_
               _wlo+4449_
               '2
               std/net/bio/output#output-buffer::t
               '#f))
            (begin
              (std/net/bio/output#bio-output-drain! _buf443_ '4)
              (std/net/bio/output#bio-write-u32 _u32442_ _buf443_))))))
  (define std/net/bio/output#bio-put-u32
    (lambda (_u32435_ _u8v436_ _start437_)
      (if (fixnum? _u32435_)
          (begin
            (##u8vector-set!
             _u8v436_
             _start437_
             (##fxand (##fxarithmetic-shift-right _u32435_ '24) '255))
            (##u8vector-set!
             _u8v436_
             (##fx+ _start437_ '1)
             (##fxand (##fxarithmetic-shift-right _u32435_ '16) '255))
            (##u8vector-set!
             _u8v436_
             (##fx+ _start437_ '2)
             (##fxand (##fxarithmetic-shift-right _u32435_ '8) '255))
            (##u8vector-set!
             _u8v436_
             (##fx+ _start437_ '3)
             (##fxand _u32435_ '255)))
          (let ((_b0439_ (bitwise-and _u32435_ '255))
                (_bits440_ (arithmetic-shift _u32435_ '-8)))
            (##u8vector-set!
             _u8v436_
             _start437_
             (##fxand (##fxarithmetic-shift-right _bits440_ '16) '255))
            (##u8vector-set!
             _u8v436_
             (##fx+ _start437_ '1)
             (##fxand (##fxarithmetic-shift-right _bits440_ '8) '255))
            (##u8vector-set!
             _u8v436_
             (##fx+ _start437_ '2)
             (##fxand _bits440_ '255))
            (##u8vector-set! _u8v436_ (##fx+ _start437_ '3) _b0439_)))))
  (define std/net/bio/output#2^32 (expt '2 '32))
  (define std/net/bio/output#bio-write-s32
    (lambda (_s32430_ _buf431_)
      (let ((_u32433_
             (if (< _s32430_ '0)
                 (+ std/net/bio/output#2^32 _s32430_)
                 _s32430_)))
        (std/net/bio/output#bio-write-u32 _u32433_ _buf431_))))
  (define std/net/bio/output#bio-write-u16
    (lambda (_u16420_ _buf421_)
      (let* ((_wlo423_
              (##unchecked-structure-ref
               _buf421_
               '2
               std/net/bio/output#output-buffer::t
               '#f))
             (_whi425_
              (##unchecked-structure-ref
               _buf421_
               '3
               std/net/bio/output#output-buffer::t
               '#f))
             (_wlo+2427_ (##fx+ _wlo423_ '2)))
        (if (##fx<= _wlo+2427_ _whi425_)
            (begin
              (std/net/bio/output#bio-put-u16
               _u16420_
               (##unchecked-structure-ref
                _buf421_
                '1
                std/net/bio/output#output-buffer::t
                '#f)
               _wlo423_)
              (##unchecked-structure-set!
               _buf421_
               _wlo+2427_
               '2
               std/net/bio/output#output-buffer::t
               '#f))
            (begin
              (std/net/bio/output#bio-output-drain! _buf421_ '2)
              (std/net/bio/output#bio-write-u16 _u16420_ _buf421_))))))
  (define std/net/bio/output#bio-put-u16
    (lambda (_u16416_ _u8v417_ _start418_)
      (##u8vector-set!
       _u8v417_
       _start418_
       (##fxand (##fxarithmetic-shift-right _u16416_ '8) '255))
      (##u8vector-set!
       _u8v417_
       (##fx+ _start418_ '1)
       (##fxand _u16416_ '255))))
  (define std/net/bio/output#2^16 (expt '2 '16))
  (define std/net/bio/output#bio-write-s16
    (lambda (_s16411_ _buf412_)
      (let ((_u16414_
             (if (##fx< _s16411_ '0)
                 (##fx+ std/net/bio/output#2^16 _s16411_)
                 _s16411_)))
        (std/net/bio/output#bio-write-u16 _u16414_ _buf412_))))
  (define std/net/bio/output#bio-write-char
    (lambda (_char406_ _buf407_)
      (let ((_c409_ (##char->integer _char406_)))
        (if (##fx<= _c409_ '127)
            (std/net/bio/output#bio-write-u8 _c409_ _buf407_)
            (if (##fx<= _c409_ '2047)
                (begin
                  (std/net/bio/output#bio-write-u8
                   (##fxior '192 (##fxarithmetic-shift-right _c409_ '6))
                   _buf407_)
                  (std/net/bio/output#bio-write-u8
                   (##fxior '128 (##fxand _c409_ '63))
                   _buf407_))
                (if (##fx<= _c409_ '65535)
                    (begin
                      (std/net/bio/output#bio-write-u8
                       (##fxior '224 (##fxarithmetic-shift-right _c409_ '12))
                       _buf407_)
                      (std/net/bio/output#bio-write-u8
                       (##fxior '128
                                (##fxand (##fxarithmetic-shift-right _c409_ '6)
                                         '63))
                       _buf407_)
                      (std/net/bio/output#bio-write-u8
                       (##fxior '128 (##fxand _c409_ '63))
                       _buf407_))
                    (begin
                      (std/net/bio/output#bio-write-u8
                       (##fxior '240 (##fxarithmetic-shift-right _c409_ '18))
                       _buf407_)
                      (std/net/bio/output#bio-write-u8
                       (##fxior '128
                                (##fxand (##fxarithmetic-shift-right
                                          _c409_
                                          '12)
                                         '63))
                       _buf407_)
                      (std/net/bio/output#bio-write-u8
                       (##fxior '128
                                (##fxand (##fxarithmetic-shift-right _c409_ '6)
                                         '63))
                       _buf407_)
                      (std/net/bio/output#bio-write-u8
                       (##fxior '128 (##fxand _c409_ '63))
                       _buf407_))))))))
  (define std/net/bio/output#bio-write-substring
    (lambda (_str397_ _start398_ _end399_ _buf400_)
      (let _lp402_ ((_i404_ _start398_))
        (if (##fx< _i404_ _end399_)
            (begin
              (std/net/bio/output#bio-write-char
               (##string-ref _str397_ _i404_)
               _buf400_)
              (_lp402_ (##fx+ _i404_ '1)))
            '#!void))))
  (define std/net/bio/output#bio-write-string
    (lambda (_str394_ _buf395_)
      (std/net/bio/output#bio-write-substring
       _str394_
       '0
       (string-length _str394_)
       _buf395_)))
  (define std/net/bio/output#bio-force-output
    (lambda (_buf390_)
      (let ((_wlo392_
             (##unchecked-structure-ref
              _buf390_
              '2
              std/net/bio/output#output-buffer::t
              '#f)))
        (if (##fx> _wlo392_ '0)
            (std/net/bio/output#bio-output-drain! _buf390_ '0)
            '#!void)))))
