(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/os/fd#open-raw-device
    (lambda (_direction143570_ _id143571_ _fd143572_)
      (letrec ((_fail143574_
                (lambda ()
                  (##fail-check-settings
                   '1
                   std/os/fd#open-raw-device
                   _direction143570_
                   _id143571_
                   _fd143572_))))
        (##make-psettings
         _direction143570_
         '()
         '()
         _fail143574_
         (lambda (_psettings143576_)
           (let ((_device143578_
                  (##os-device-open-raw-from-fd
                   _fd143572_
                   (##psettings->device-flags _psettings143576_))))
             (if (##fixnum? _device143578_)
                 (##raise-os-exception
                  '#f
                  _device143578_
                  std/os/fd#open-raw-device
                  _direction143570_
                  _id143571_
                  _fd143572_)
                 (##make-raw-device-port
                  _direction143570_
                  _device143578_
                  _id143571_
                  (cons _id143571_ (cons _fd143572_ '()))
                  _fd143572_))))))))
  (define std/os/fd#fdopen
    (lambda (_fd143561_ _dir143562_ _t143563_)
      (let ((_dirx143568_
             (let ((_$e143565_ _dir143562_))
               (if (eq? 'in _$e143565_)
                   (macro-direction-in)
                   (if (eq? 'out _$e143565_)
                       (macro-direction-out)
                       (if (eq? 'inout _$e143565_)
                           (macro-direction-inout)
                           (error '"Bad direction; must be in, out, or inout"
                                  _dir143562_)))))))
        (std/os/fd#open-raw-device _dirx143568_ _t143563_ _fd143561_))))
  (define std/os/fd#fd-e
    (lambda (_raw143559_)
      (values (macro-raw-device-port-specific _raw143559_))))
  (define std/os/fd#fd-io-in
    (lambda (_raw143557_)
      (values (macro-raw-device-port-rdevice-condvar _raw143557_))))
  (define std/os/fd#fd-io-out
    (lambda (_raw143555_)
      (values (macro-raw-device-port-wdevice-condvar _raw143555_))))
  (define std/os/fd#fd-type
    (lambda (_raw143553_) (values (macro-raw-device-port-type _raw143553_))))
  (define std/os/fd#fd?
    (lambda (_obj143551_) (values (macro-raw-device-port? _obj143551_))))
  (define std/os/fd#fd-type?
    (lambda (_obj143548_ _t143549_)
      (if (macro-raw-device-port? _obj143548_)
          (eq? (std/os/fd#fd-type _obj143548_) _t143549_)
          '#f))))
