(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define gerbil/gambit/ports#write-string__%
    (lambda (_str64358_ _port64359_)
      (write-substring _str64358_ '0 (string-length _str64358_) _port64359_)))
  (define gerbil/gambit/ports#write-string__0
    (lambda (_str64364_)
      (let ((_port64366_ (current-output-port)))
        (gerbil/gambit/ports#write-string__% _str64364_ _port64366_))))
  (define gerbil/gambit/ports#write-string
    (lambda _g64371_
      (let ((_g64370_ (length _g64371_)))
        (cond ((##fx= _g64370_ 1)
               (apply gerbil/gambit/ports#write-string__0 _g64371_))
              ((##fx= _g64370_ 2)
               (apply gerbil/gambit/ports#write-string__% _g64371_))
              (else
               (##raise-wrong-number-of-arguments-exception
                gerbil/gambit/ports#write-string
                _g64371_))))))
  (define gerbil/gambit/ports#read-string__%
    (lambda (_obj64339_ _port64340_)
      (if (fixnum? _obj64339_)
          (begin
            (if (##fx> _obj64339_ '0)
                '#!void
                (error '"Bad argument; expected positive fixnum" _obj64339_))
            (let* ((_str64342_ (make-string _obj64339_))
                   (_rd64344_
                    (read-substring _str64342_ '0 _obj64339_ _port64340_)))
              (if (##fxzero? _rd64344_)
                  (eof-object)
                  (if (##fx< _rd64344_ _obj64339_)
                      (begin (string-shrink! _str64342_ _rd64344_) _str64342_)
                      _str64342_))))
          (if (string? _obj64339_)
              (read-substring
               _obj64339_
               '0
               (##string-length _obj64339_)
               _port64340_)
              (error '"Bad argument; expected string or positive fixnum"
                     _obj64339_)))))
  (define gerbil/gambit/ports#read-string__0
    (lambda (_obj64350_)
      (let ((_port64352_ (current-input-port)))
        (gerbil/gambit/ports#read-string__% _obj64350_ _port64352_))))
  (define gerbil/gambit/ports#read-string
    (lambda _g64373_
      (let ((_g64372_ (length _g64373_)))
        (cond ((##fx= _g64372_ 1)
               (apply gerbil/gambit/ports#read-string__0 _g64373_))
              ((##fx= _g64372_ 2)
               (apply gerbil/gambit/ports#read-string__% _g64373_))
              (else
               (##raise-wrong-number-of-arguments-exception
                gerbil/gambit/ports#read-string
                _g64373_))))))
  (define gerbil/gambit/ports#write-u8vector__%
    (lambda (_bytes64325_ _port64326_)
      (write-subu8vector
       _bytes64325_
       '0
       (u8vector-length _bytes64325_)
       _port64326_)))
  (define gerbil/gambit/ports#write-u8vector__0
    (lambda (_bytes64331_)
      (let ((_port64333_ (current-output-port)))
        (gerbil/gambit/ports#write-u8vector__% _bytes64331_ _port64333_))))
  (define gerbil/gambit/ports#write-u8vector
    (lambda _g64375_
      (let ((_g64374_ (length _g64375_)))
        (cond ((##fx= _g64374_ 1)
               (apply gerbil/gambit/ports#write-u8vector__0 _g64375_))
              ((##fx= _g64374_ 2)
               (apply gerbil/gambit/ports#write-u8vector__% _g64375_))
              (else
               (##raise-wrong-number-of-arguments-exception
                gerbil/gambit/ports#write-u8vector
                _g64375_))))))
  (define gerbil/gambit/ports#read-u8vector__%
    (lambda (_obj64306_ _port64307_)
      (if (fixnum? _obj64306_)
          (begin
            (if (##fx> _obj64306_ '0)
                '#!void
                (error '"Bad argument; expected positive fixnum" _obj64306_))
            (let* ((_bytes64309_ (make-u8vector _obj64306_))
                   (_rd64311_
                    (read-subu8vector _bytes64309_ '0 _obj64306_ _port64307_)))
              (if (##fxzero? _rd64311_)
                  (eof-object)
                  (if (##fx< _rd64311_ _obj64306_)
                      (begin
                        (u8vector-shrink! _bytes64309_ _rd64311_)
                        _bytes64309_)
                      _bytes64309_))))
          (if (u8vector? _obj64306_)
              (read-subu8vector
               _obj64306_
               '0
               (##u8vector-length _obj64306_)
               _port64307_)
              (error '"Bad argument; expected u8vector or positive fixnum"
                     _obj64306_)))))
  (define gerbil/gambit/ports#read-u8vector__0
    (lambda (_obj64317_)
      (let ((_port64319_ (current-input-port)))
        (gerbil/gambit/ports#read-u8vector__% _obj64317_ _port64319_))))
  (define gerbil/gambit/ports#read-u8vector
    (lambda _g64377_
      (let ((_g64376_ (length _g64377_)))
        (cond ((##fx= _g64376_ 1)
               (apply gerbil/gambit/ports#read-u8vector__0 _g64377_))
              ((##fx= _g64376_ 2)
               (apply gerbil/gambit/ports#read-u8vector__% _g64377_))
              (else
               (##raise-wrong-number-of-arguments-exception
                gerbil/gambit/ports#read-u8vector
                _g64377_)))))))
