(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define gerbil/gambit/ports#write-string__%
    (lambda (_str65539_ _port65540_)
      (write-substring _str65539_ '0 (string-length _str65539_) _port65540_)))
  (define gerbil/gambit/ports#write-string__0
    (lambda (_str65545_)
      (let ((_port65547_ (current-output-port)))
        (gerbil/gambit/ports#write-string__% _str65545_ _port65547_))))
  (define gerbil/gambit/ports#write-string
    (lambda _g65552_
      (let ((_g65551_ (length _g65552_)))
        (cond ((##fx= _g65551_ 1)
               (apply gerbil/gambit/ports#write-string__0 _g65552_))
              ((##fx= _g65551_ 2)
               (apply gerbil/gambit/ports#write-string__% _g65552_))
              (else
               (##raise-wrong-number-of-arguments-exception
                gerbil/gambit/ports#write-string
                _g65552_))))))
  (define gerbil/gambit/ports#read-string__%
    (lambda (_obj65520_ _port65521_)
      (if (fixnum? _obj65520_)
          (begin
            (if (##fx> _obj65520_ '0)
                '#!void
                (error '"Bad argument; expected positive fixnum" _obj65520_))
            (let* ((_str65523_ (make-string _obj65520_))
                   (_rd65525_
                    (read-substring _str65523_ '0 _obj65520_ _port65521_)))
              (if (##fxzero? _rd65525_)
                  (eof-object)
                  (if (##fx< _rd65525_ _obj65520_)
                      (begin (string-shrink! _str65523_ _rd65525_) _str65523_)
                      _str65523_))))
          (if (string? _obj65520_)
              (read-substring
               _obj65520_
               '0
               (##string-length _obj65520_)
               _port65521_)
              (error '"Bad argument; expected string or positive fixnum"
                     _obj65520_)))))
  (define gerbil/gambit/ports#read-string__0
    (lambda (_obj65531_)
      (let ((_port65533_ (current-input-port)))
        (gerbil/gambit/ports#read-string__% _obj65531_ _port65533_))))
  (define gerbil/gambit/ports#read-string
    (lambda _g65554_
      (let ((_g65553_ (length _g65554_)))
        (cond ((##fx= _g65553_ 1)
               (apply gerbil/gambit/ports#read-string__0 _g65554_))
              ((##fx= _g65553_ 2)
               (apply gerbil/gambit/ports#read-string__% _g65554_))
              (else
               (##raise-wrong-number-of-arguments-exception
                gerbil/gambit/ports#read-string
                _g65554_))))))
  (define gerbil/gambit/ports#write-u8vector__%
    (lambda (_bytes65506_ _port65507_)
      (write-subu8vector
       _bytes65506_
       '0
       (u8vector-length _bytes65506_)
       _port65507_)))
  (define gerbil/gambit/ports#write-u8vector__0
    (lambda (_bytes65512_)
      (let ((_port65514_ (current-output-port)))
        (gerbil/gambit/ports#write-u8vector__% _bytes65512_ _port65514_))))
  (define gerbil/gambit/ports#write-u8vector
    (lambda _g65556_
      (let ((_g65555_ (length _g65556_)))
        (cond ((##fx= _g65555_ 1)
               (apply gerbil/gambit/ports#write-u8vector__0 _g65556_))
              ((##fx= _g65555_ 2)
               (apply gerbil/gambit/ports#write-u8vector__% _g65556_))
              (else
               (##raise-wrong-number-of-arguments-exception
                gerbil/gambit/ports#write-u8vector
                _g65556_))))))
  (define gerbil/gambit/ports#read-u8vector__%
    (lambda (_obj65487_ _port65488_)
      (if (fixnum? _obj65487_)
          (begin
            (if (##fx> _obj65487_ '0)
                '#!void
                (error '"Bad argument; expected positive fixnum" _obj65487_))
            (let* ((_bytes65490_ (make-u8vector _obj65487_))
                   (_rd65492_
                    (read-subu8vector _bytes65490_ '0 _obj65487_ _port65488_)))
              (if (##fxzero? _rd65492_)
                  (eof-object)
                  (if (##fx< _rd65492_ _obj65487_)
                      (begin
                        (u8vector-shrink! _bytes65490_ _rd65492_)
                        _bytes65490_)
                      _bytes65490_))))
          (if (u8vector? _obj65487_)
              (read-subu8vector
               _obj65487_
               '0
               (##u8vector-length _obj65487_)
               _port65488_)
              (error '"Bad argument; expected u8vector or positive fixnum"
                     _obj65487_)))))
  (define gerbil/gambit/ports#read-u8vector__0
    (lambda (_obj65498_)
      (let ((_port65500_ (current-input-port)))
        (gerbil/gambit/ports#read-u8vector__% _obj65498_ _port65500_))))
  (define gerbil/gambit/ports#read-u8vector
    (lambda _g65558_
      (let ((_g65557_ (length _g65558_)))
        (cond ((##fx= _g65557_ 1)
               (apply gerbil/gambit/ports#read-u8vector__0 _g65558_))
              ((##fx= _g65557_ 2)
               (apply gerbil/gambit/ports#read-u8vector__% _g65558_))
              (else
               (##raise-wrong-number-of-arguments-exception
                gerbil/gambit/ports#read-u8vector
                _g65558_)))))))
