(declare (block) (standard-bindings) (extended-bindings))
(begin
  (declare (not safe))
  (define std/net/socket/buffer#default-buffer-size '4096)
  (define std/net/socket/buffer#ssocket-input-buffer::t
    (make-struct-type
     'std/net/socket/buffer#ssocket-input-buffer::t
     std/net/bio/input#input-buffer::t
     '2
     'ssocket-input-buffer
     '()
     '#f
     '(sock timeo)))
  (define std/net/socket/buffer#ssocket-input-buffer?
    (make-struct-predicate std/net/socket/buffer#ssocket-input-buffer::t))
  (define std/net/socket/buffer#make-ssocket-input-buffer
    (lambda _$args148714_
      (apply make-struct-instance
             std/net/socket/buffer#ssocket-input-buffer::t
             _$args148714_)))
  (define std/net/socket/buffer#ssocket-input-buffer-sock
    (make-struct-field-accessor
     std/net/socket/buffer#ssocket-input-buffer::t
     '0))
  (define std/net/socket/buffer#ssocket-input-buffer-timeo
    (make-struct-field-accessor
     std/net/socket/buffer#ssocket-input-buffer::t
     '1))
  (define std/net/socket/buffer#ssocket-input-buffer-sock-set!
    (make-struct-field-mutator
     std/net/socket/buffer#ssocket-input-buffer::t
     '0))
  (define std/net/socket/buffer#ssocket-input-buffer-timeo-set!
    (make-struct-field-mutator
     std/net/socket/buffer#ssocket-input-buffer::t
     '1))
  (define std/net/socket/buffer#&ssocket-input-buffer-sock
    (make-struct-field-unchecked-accessor
     std/net/socket/buffer#ssocket-input-buffer::t
     '0))
  (define std/net/socket/buffer#&ssocket-input-buffer-timeo
    (make-struct-field-unchecked-accessor
     std/net/socket/buffer#ssocket-input-buffer::t
     '1))
  (define std/net/socket/buffer#&ssocket-input-buffer-sock-set!
    (make-struct-field-unchecked-mutator
     std/net/socket/buffer#ssocket-input-buffer::t
     '0))
  (define std/net/socket/buffer#&ssocket-input-buffer-timeo-set!
    (make-struct-field-unchecked-mutator
     std/net/socket/buffer#ssocket-input-buffer::t
     '1))
  (define std/net/socket/buffer#open-ssocket-input-buffer__%
    (lambda (_ssock148701_ _size148702_)
      (##structure
       std/net/socket/buffer#ssocket-input-buffer::t
       (make-u8vector _size148702_)
       '0
       '0
       std/net/socket/buffer#ssocket-input-fill!
       std/net/socket/buffer#ssocket-input-read
       _ssock148701_
       '#f)))
  (define std/net/socket/buffer#open-ssocket-input-buffer__0
    (lambda (_ssock148707_)
      (let ((_size148709_ std/net/socket/buffer#default-buffer-size))
        (std/net/socket/buffer#open-ssocket-input-buffer__%
         _ssock148707_
         _size148709_))))
  (define std/net/socket/buffer#open-ssocket-input-buffer
    (lambda _g148717_
      (let ((_g148716_ (length _g148717_)))
        (cond ((##fx= _g148716_ 1)
               (apply std/net/socket/buffer#open-ssocket-input-buffer__0
                      _g148717_))
              ((##fx= _g148716_ 2)
               (apply std/net/socket/buffer#open-ssocket-input-buffer__%
                      _g148717_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/net/socket/buffer#open-ssocket-input-buffer
                _g148717_))))))
  (define std/net/socket/buffer#ssocket-input-fill!
    (lambda (_buf148679_ _need148680_)
      (let ((_bytes148682_
             (##unchecked-structure-ref
              _buf148679_
              '1
              std/net/bio/input#input-buffer::t
              '#f))
            (_rlo148683_
             (##unchecked-structure-ref
              _buf148679_
              '2
              std/net/bio/input#input-buffer::t
              '#f))
            (_rhi148684_
             (##unchecked-structure-ref
              _buf148679_
              '3
              std/net/bio/input#input-buffer::t
              '#f)))
        (if (##fx> _rlo148683_ '0)
            (if (##fx= _rlo148683_ _rhi148684_)
                (begin
                  (##unchecked-structure-set!
                   _buf148679_
                   '0
                   '2
                   std/net/bio/input#input-buffer::t
                   '#f)
                  (##unchecked-structure-set!
                   _buf148679_
                   '0
                   '3
                   std/net/bio/input#input-buffer::t
                   '#f)
                  (std/net/socket/buffer#ssocket-input-fill!
                   _buf148679_
                   _need148680_))
                (begin
                  (##subu8vector-move!
                   _bytes148682_
                   _rlo148683_
                   _rhi148684_
                   _bytes148682_
                   '0)
                  (##unchecked-structure-set!
                   _buf148679_
                   '0
                   '2
                   std/net/bio/input#input-buffer::t
                   '#f)
                  (##unchecked-structure-set!
                   _buf148679_
                   (##fx- _rhi148684_ _rlo148683_)
                   '3
                   std/net/bio/input#input-buffer::t
                   '#f)
                  (std/net/socket/buffer#ssocket-input-fill!
                   _buf148679_
                   _need148680_)))
            (let ((_sock148686_
                   (##unchecked-structure-ref
                    _buf148679_
                    '6
                    std/net/socket/buffer#ssocket-input-buffer::t
                    '#f))
                  (_timeo148687_
                   (##unchecked-structure-ref
                    _buf148679_
                    '7
                    std/net/socket/buffer#ssocket-input-buffer::t
                    '#f)))
              (let _lp148689_ ((_rhi148691_ _rhi148684_)
                               (_want148692_ (##fx- _need148680_ _rhi148684_))
                               (_count148693_ '0))
                (let* ((_rd148695_
                        (std/net/socket/api#ssocket-recv__%
                         _sock148686_
                         _bytes148682_
                         _rhi148691_
                         (##u8vector-length _bytes148682_)
                         _timeo148687_))
                       (_rhi+rd148697_ (##fx+ _rhi148691_ _rd148695_)))
                  (##unchecked-structure-set!
                   _buf148679_
                   _rhi+rd148697_
                   '3
                   std/net/bio/input#input-buffer::t
                   '#f)
                  (if (##fx< _rd148695_ _want148692_)
                      (if (##fx> _rd148695_ '0)
                          (_lp148689_
                           _rhi+rd148697_
                           (##fx- _want148692_ _rd148695_)
                           (##fx+ _count148693_ _rd148695_))
                          _count148693_)
                      (##fx+ _count148693_ _rd148695_)))))))))
  (define std/net/socket/buffer#ssocket-input-read
    (lambda (_bytes148674_ _start148675_ _end148676_ _buf148677_)
      (std/net/socket/api#ssocket-recv-all__%
       (##unchecked-structure-ref
        _buf148677_
        '6
        std/net/socket/buffer#ssocket-input-buffer::t
        '#f)
       _bytes148674_
       _start148675_
       _end148676_
       (##unchecked-structure-ref
        _buf148677_
        '7
        std/net/socket/buffer#ssocket-input-buffer::t
        '#f))))
  (define std/net/socket/buffer#ssocket-input-buffer-timeout-set!
    (lambda (_buf148669_ _timeo148670_)
      (let ((_timeo148672_ (std/net/socket/base#abs-timeout _timeo148670_)))
        (##structure-set!
         _buf148669_
         _timeo148672_
         '7
         std/net/socket/buffer#ssocket-input-buffer::t
         '#f))))
  (define std/net/socket/buffer#ssocket-output-buffer::t
    (make-struct-type
     'std/net/socket/buffer#ssocket-output-buffer::t
     std/net/bio/output#output-buffer::t
     '2
     'ssocket-output-buffer
     '((final: . #t))
     '#f
     '(sock timeo)))
  (define std/net/socket/buffer#ssocket-output-buffer?
    (make-struct-predicate std/net/socket/buffer#ssocket-output-buffer::t))
  (define std/net/socket/buffer#make-ssocket-output-buffer
    (lambda _$args148666_
      (apply make-struct-instance
             std/net/socket/buffer#ssocket-output-buffer::t
             _$args148666_)))
  (define std/net/socket/buffer#ssocket-output-buffer-sock
    (make-struct-field-accessor
     std/net/socket/buffer#ssocket-output-buffer::t
     '0))
  (define std/net/socket/buffer#ssocket-output-buffer-timeo
    (make-struct-field-accessor
     std/net/socket/buffer#ssocket-output-buffer::t
     '1))
  (define std/net/socket/buffer#ssocket-output-buffer-sock-set!
    (make-struct-field-mutator
     std/net/socket/buffer#ssocket-output-buffer::t
     '0))
  (define std/net/socket/buffer#ssocket-output-buffer-timeo-set!
    (make-struct-field-mutator
     std/net/socket/buffer#ssocket-output-buffer::t
     '1))
  (define std/net/socket/buffer#&ssocket-output-buffer-sock
    (make-struct-field-unchecked-accessor
     std/net/socket/buffer#ssocket-output-buffer::t
     '0))
  (define std/net/socket/buffer#&ssocket-output-buffer-timeo
    (make-struct-field-unchecked-accessor
     std/net/socket/buffer#ssocket-output-buffer::t
     '1))
  (define std/net/socket/buffer#&ssocket-output-buffer-sock-set!
    (make-struct-field-unchecked-mutator
     std/net/socket/buffer#ssocket-output-buffer::t
     '0))
  (define std/net/socket/buffer#&ssocket-output-buffer-timeo-set!
    (make-struct-field-unchecked-mutator
     std/net/socket/buffer#ssocket-output-buffer::t
     '1))
  (define std/net/socket/buffer#open-ssocket-output-buffer__%
    (lambda (_ssock148653_ _size148654_)
      (##structure
       std/net/socket/buffer#ssocket-output-buffer::t
       (make-u8vector _size148654_)
       '0
       _size148654_
       std/net/socket/buffer#ssocket-output-drain!
       std/net/socket/buffer#ssocket-output-write
       _ssock148653_
       '#f)))
  (define std/net/socket/buffer#open-ssocket-output-buffer__0
    (lambda (_ssock148659_)
      (let ((_size148661_ std/net/socket/buffer#default-buffer-size))
        (std/net/socket/buffer#open-ssocket-output-buffer__%
         _ssock148659_
         _size148661_))))
  (define std/net/socket/buffer#open-ssocket-output-buffer
    (lambda _g148719_
      (let ((_g148718_ (length _g148719_)))
        (cond ((##fx= _g148718_ 1)
               (apply std/net/socket/buffer#open-ssocket-output-buffer__0
                      _g148719_))
              ((##fx= _g148718_ 2)
               (apply std/net/socket/buffer#open-ssocket-output-buffer__%
                      _g148719_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/net/socket/buffer#open-ssocket-output-buffer
                _g148719_))))))
  (define std/net/socket/buffer#ssocket-output-drain!
    (lambda (_buf148649_ _need148650_)
      (std/net/socket/api#ssocket-send-all__%
       (##unchecked-structure-ref
        _buf148649_
        '6
        std/net/socket/buffer#ssocket-output-buffer::t
        '#f)
       (##unchecked-structure-ref
        _buf148649_
        '1
        std/net/bio/output#output-buffer::t
        '#f)
       '0
       (##unchecked-structure-ref
        _buf148649_
        '2
        std/net/bio/output#output-buffer::t
        '#f)
       (##unchecked-structure-ref
        _buf148649_
        '7
        std/net/socket/buffer#ssocket-output-buffer::t
        '#f))
      (##unchecked-structure-set!
       _buf148649_
       '0
       '2
       std/net/bio/output#output-buffer::t
       '#f)))
  (define std/net/socket/buffer#ssocket-output-write
    (lambda (_bytes148644_ _start148645_ _end148646_ _buf148647_)
      (std/net/socket/api#ssocket-send-all__%
       (##unchecked-structure-ref
        _buf148647_
        '6
        std/net/socket/buffer#ssocket-output-buffer::t
        '#f)
       _bytes148644_
       _start148645_
       _end148646_
       (##unchecked-structure-ref
        _buf148647_
        '7
        std/net/socket/buffer#ssocket-output-buffer::t
        '#f))))
  (define std/net/socket/buffer#ssocket-output-buffer-timeout-set!
    (lambda (_buf148639_ _timeo148640_)
      (let ((_timeo148642_ (std/net/socket/base#abs-timeout _timeo148640_)))
        (##direct-structure-set!
         _buf148639_
         _timeo148642_
         '7
         std/net/socket/buffer#ssocket-output-buffer::t
         '#f)))))
