(export (rename (1/_path _path)
                (1/absolute-path? absolute-path?)
                (add-stderr-log-receiver! add-stderr-log-receiver!)
                (add-stdout-log-receiver! add-stdout-log-receiver!)
                (add-syslog-log-receiver! add-syslog-log-receiver!)
                (1/build-path build-path)
                (1/build-path/convention-type build-path/convention-type)
                (1/byte-ready? byte-ready?)
                (1/bytes->path bytes->path)
                (1/bytes->path-element bytes->path-element)
                (1/bytes->string/latin-1 bytes->string/latin-1)
                (1/bytes->string/locale bytes->string/locale)
                (1/bytes->string/utf-8 bytes->string/utf-8)
                (1/bytes-close-converter bytes-close-converter)
                (1/bytes-convert bytes-convert)
                (1/bytes-convert-end bytes-convert-end)
                (1/bytes-converter? bytes-converter?)
                (1/bytes-open-converter bytes-open-converter)
                (1/bytes-utf-8-index bytes-utf-8-index)
                (1/bytes-utf-8-length bytes-utf-8-length)
                (1/bytes-utf-8-ref bytes-utf-8-ref)
                (1/cache-configuration cache-configuration)
                (1/call-with-input-file call-with-input-file)
                (1/call-with-output-file call-with-output-file)
                (1/char-ready? char-ready?)
                (1/char-utf-8-length char-utf-8-length)
                (1/cleanse-path cleanse-path)
                (1/close-input-port close-input-port)
                (1/close-output-port close-output-port)
                (1/complete-path? complete-path?)
                (1/copy-file copy-file)
                (1/current-command-line-arguments
                 current-command-line-arguments)
                (1/current-directory current-directory)
                (1/current-directory-for-user current-directory-for-user)
                (1/current-drive current-drive)
                (1/current-environment-variables current-environment-variables)
                (1/current-error-port current-error-port)
                (1/current-force-delete-permissions
                 current-force-delete-permissions)
                (1/current-get-interaction-evt current-get-interaction-evt)
                (1/current-get-interaction-input-port
                 current-get-interaction-input-port)
                (1/current-input-port current-input-port)
                (1/current-load-extension current-load-extension)
                (1/current-load-relative-directory
                 current-load-relative-directory)
                (1/current-locale current-locale)
                (1/current-logger current-logger)
                (1/current-output-port current-output-port)
                (1/current-print current-print)
                (1/current-prompt-read current-prompt-read)
                (1/current-read-interaction current-read-interaction)
                (1/current-security-guard current-security-guard)
                (1/current-subprocess-custodian-mode
                 current-subprocess-custodian-mode)
                (1/current-subprocess-keep-file-descriptors
                 current-subprocess-keep-file-descriptors)
                (1/current-write-relative-directory
                 current-write-relative-directory)
                (1/custom-print-quotable-accessor
                 custom-print-quotable-accessor)
                (1/custom-print-quotable? custom-print-quotable?)
                (1/custom-write-accessor custom-write-accessor)
                (1/custom-write? custom-write?)
                (1/default-global-port-print-handler
                 default-global-port-print-handler)
                (1/delete-directory delete-directory)
                (1/delete-file delete-file)
                (1/directory-exists? directory-exists?)
                (1/directory-list directory-list)
                (1/display display)
                (1/environment-variables-copy environment-variables-copy)
                (1/environment-variables-names environment-variables-names)
                (1/environment-variables-ref environment-variables-ref)
                (1/environment-variables-set! environment-variables-set!)
                (1/environment-variables? environment-variables?)
                (1/eprintf eprintf)
                (1/error error)
                (1/error-print-source-location error-print-source-location)
                (error-value->string error-value->string)
                (1/executable-yield-handler executable-yield-handler)
                (1/expand-user-path expand-user-path)
                (1/explode-path explode-path)
                (ffi-get-lib ffi-get-lib)
                (ffi-get-obj ffi-get-obj)
                (ffi-unload-lib ffi-unload-lib)
                (1/file-exists? file-exists?)
                (1/file-or-directory-identity file-or-directory-identity)
                (1/file-or-directory-modify-seconds
                 file-or-directory-modify-seconds)
                (1/file-or-directory-permissions file-or-directory-permissions)
                (1/file-or-directory-stat file-or-directory-stat)
                (1/file-or-directory-type file-or-directory-type)
                (1/file-position file-position)
                (1/file-position* file-position*)
                (1/file-size file-size)
                (1/file-stream-buffer-mode file-stream-buffer-mode)
                (1/file-stream-port? file-stream-port?)
                (1/file-truncate file-truncate)
                (1/filesystem-change-evt filesystem-change-evt)
                (1/filesystem-change-evt-cancel filesystem-change-evt-cancel)
                (1/filesystem-change-evt? filesystem-change-evt?)
                (1/filesystem-root-list filesystem-root-list)
                (1/find-system-path find-system-path)
                (1/flush-output flush-output)
                (1/format format)
                (1/fprintf fprintf)
                (get-machine-info get-machine-info)
                (get-original-error-port get-original-error-port)
                (1/get-output-bytes get-output-bytes)
                (1/get-output-string get-output-string)
                (1/global-port-print-handler global-port-print-handler)
                (1/input-port? input-port?)
                (install-reader! install-reader!)
                (io-place-destroy! io-place-destroy!)
                (io-place-init! io-place-init!)
                (1/link-exists? link-exists?)
                (1/locale-string-encoding locale-string-encoding)
                (1/log-all-levels log-all-levels)
                (log-future-event log-future-event)
                (1/log-level-evt log-level-evt)
                (1/log-level? log-level?)
                (log-level?* log-level?*)
                (1/log-max-level log-max-level)
                (1/log-message log-message)
                (log-message* log-message*)
                (log-place-event log-place-event)
                (1/log-receiver? log-receiver?)
                (logger-init! logger-init!)
                (1/logger-name logger-name)
                (1/logger? logger?)
                (logging-future-events? logging-future-events?)
                (logging-place-events? logging-place-events?)
                (1/make-directory make-directory)
                (1/make-environment-variables make-environment-variables)
                (1/make-file-or-directory-link make-file-or-directory-link)
                (1/make-input-port make-input-port)
                (1/make-log-receiver make-log-receiver)
                (1/make-logger make-logger)
                (1/make-output-port make-output-port)
                (1/make-pipe make-pipe)
                (make-place-ports+fds make-place-ports+fds)
                (1/make-security-guard make-security-guard)
                (1/newline newline)
                (1/open-input-bytes open-input-bytes)
                (1/open-input-file open-input-file)
                (1/open-input-output-file open-input-output-file)
                (1/open-input-string open-input-string)
                (1/open-output-bytes open-output-bytes)
                (1/open-output-file open-output-file)
                (1/open-output-string open-output-string)
                (1/output-port? output-port?)
                (1/path->bytes path->bytes)
                (1/path->complete-path path->complete-path)
                (1/path->directory-path path->directory-path)
                (1/path->string path->string)
                (1/path-convention-type path-convention-type)
                (1/path-element->bytes path-element->bytes)
                (1/path-element->string path-element->string)
                (1/path-for-some-system? path-for-some-system?)
                (1/path<? path<?)
                (is-path? path?)
                (1/peek-byte peek-byte)
                (1/peek-byte-or-special peek-byte-or-special)
                (1/peek-bytes peek-bytes)
                (1/peek-bytes! peek-bytes!)
                (1/peek-bytes-avail! peek-bytes-avail!)
                (1/peek-bytes-avail!* peek-bytes-avail!*)
                (1/peek-bytes-avail!/enable-break
                 peek-bytes-avail!/enable-break)
                (1/peek-char peek-char)
                (1/peek-char-or-special peek-char-or-special)
                (1/peek-string peek-string)
                (1/peek-string! peek-string!)
                (1/pipe-content-length pipe-content-length)
                (pipe-input-port?* pipe-input-port?)
                (pipe-output-port?* pipe-output-port?)
                (1/pipe-port? pipe-port?)
                (1/port-closed-evt port-closed-evt)
                (1/port-closed? port-closed?)
                (1/port-commit-peeked port-commit-peeked)
                (1/port-count-lines! port-count-lines!)
                (1/port-count-lines-enabled port-count-lines-enabled)
                (1/port-counts-lines? port-counts-lines?)
                (1/port-display-handler port-display-handler)
                (1/port-file-identity port-file-identity)
                (1/port-file-stat port-file-stat)
                (1/port-file-unlock port-file-unlock)
                (1/port-next-location port-next-location)
                (1/port-print-handler port-print-handler)
                (1/port-progress-evt port-progress-evt)
                (1/port-provides-progress-evts? port-provides-progress-evts?)
                (1/port-read-handler port-read-handler)
                (1/port-try-file-lock? port-try-file-lock?)
                (1/port-waiting-peer? port-waiting-peer?)
                (1/port-write-handler port-write-handler)
                (1/port-writes-atomic? port-writes-atomic?)
                (1/port-writes-special? port-writes-special?)
                (1/print print)
                (1/print-as-expression print-as-expression)
                (1/print-boolean-long-form print-boolean-long-form)
                (1/print-box print-box)
                (1/print-graph print-graph)
                (1/print-hash-table print-hash-table)
                (1/print-mpair-curly-braces print-mpair-curly-braces)
                (1/print-pair-curly-braces print-pair-curly-braces)
                (1/print-reader-abbreviations print-reader-abbreviations)
                (1/print-struct print-struct)
                (1/print-syntax-width print-syntax-width)
                (1/print-unreadable print-unreadable)
                (1/print-vector-length print-vector-length)
                (1/printf printf)
                (1/processor-count processor-count)
                (progress-evt?* progress-evt?)
                (1/prop:custom-print-quotable prop:custom-print-quotable)
                (1/prop:custom-write prop:custom-write)
                (1/prop:input-port prop:input-port)
                (1/prop:output-port prop:output-port)
                (1/raise-user-error raise-user-error)
                (1/read-accept-bar-quote read-accept-bar-quote)
                (1/read-byte read-byte)
                (1/read-byte-or-special read-byte-or-special)
                (1/read-bytes read-bytes)
                (1/read-bytes! read-bytes!)
                (1/read-bytes-avail! read-bytes-avail!)
                (1/read-bytes-avail!* read-bytes-avail!*)
                (1/read-bytes-avail!/enable-break
                 read-bytes-avail!/enable-break)
                (1/read-bytes-line read-bytes-line)
                (1/read-case-sensitive read-case-sensitive)
                (1/read-char read-char)
                (1/read-char-or-special read-char-or-special)
                (1/read-line read-line)
                (1/read-string read-string)
                (1/read-string! read-string!)
                (1/relative-path? relative-path?)
                (1/rename-file-or-directory rename-file-or-directory)
                (1/resolve-path resolve-path)
                (1/seconds->date seconds->date)
                (1/security-guard-check-file security-guard-check-file)
                (1/security-guard-check-file-link
                 security-guard-check-file-link)
                (1/security-guard-check-network security-guard-check-network)
                (1/security-guard? security-guard?)
                (set-addon-dir! set-addon-dir!)
                (set-collects-dir! set-collects-dir!)
                (set-config-dir! set-config-dir!)
                (set-exec-file! set-exec-file!)
                (set-host-collects-dir! set-host-collects-dir!)
                (set-host-config-dir! set-host-config-dir!)
                (set-maybe-raise-missing-module!
                 set-maybe-raise-missing-module!)
                (1/set-port-next-location! set-port-next-location!)
                (set-printable-regexp?! set-printable-regexp?!)
                (set-run-file! set-run-file!)
                (set-simplify-path-for-directory-list!
                 set-simplify-path-for-directory-list!)
                (set-string->number?! set-string->number?!)
                (1/sha1-bytes sha1-bytes)
                (1/sha224-bytes sha224-bytes)
                (1/sha256-bytes sha256-bytes)
                (1/shell-execute shell-execute)
                (1/simplify-path simplify-path)
                (1/split-path split-path)
                (1/srcloc->string srcloc->string)
                (1/string->bytes/latin-1 string->bytes/latin-1)
                (1/string->bytes/locale string->bytes/locale)
                (1/string->bytes/utf-8 string->bytes/utf-8)
                (1/string->path string->path)
                (1/string->path-element string->path-element)
                (1/string-locale-ci<? string-locale-ci<?)
                (1/string-locale-ci=? string-locale-ci=?)
                (1/string-locale-ci>? string-locale-ci>?)
                (1/string-locale-downcase string-locale-downcase)
                (1/string-locale-upcase string-locale-upcase)
                (1/string-locale<? string-locale<?)
                (1/string-locale=? string-locale=?)
                (1/string-locale>? string-locale>?)
                (1/string-port? string-port?)
                (1/string-utf-8-length string-utf-8-length)
                (do-subprocess subprocess)
                (1/subprocess-group-enabled subprocess-group-enabled)
                (1/subprocess-kill subprocess-kill)
                (1/subprocess-pid subprocess-pid)
                (1/subprocess-status subprocess-status)
                (1/subprocess-wait subprocess-wait)
                (1/subprocess? subprocess?)
                (1/system-language+country system-language+country)
                (1/tcp-abandon-port tcp-abandon-port)
                (1/tcp-accept tcp-accept)
                (1/tcp-accept-evt tcp-accept-evt)
                (1/tcp-accept-ready? tcp-accept-ready?)
                (1/tcp-accept/enable-break tcp-accept/enable-break)
                (1/tcp-addresses tcp-addresses)
                (1/tcp-close tcp-close)
                (1/tcp-connect tcp-connect)
                (1/tcp-connect/enable-break tcp-connect/enable-break)
                (1/tcp-listen tcp-listen)
                (1/tcp-listener? tcp-listener?)
                (1/tcp-port? tcp-port?)
                (1/terminal-port? terminal-port?)
                (1/udp-bind! udp-bind!)
                (1/udp-bound? udp-bound?)
                (1/udp-close udp-close)
                (1/udp-connect! udp-connect!)
                (1/udp-connected? udp-connected?)
                (1/udp-multicast-interface udp-multicast-interface)
                (1/udp-multicast-join-group! udp-multicast-join-group!)
                (1/udp-multicast-leave-group! udp-multicast-leave-group!)
                (1/udp-multicast-loopback? udp-multicast-loopback?)
                (1/udp-multicast-set-interface! udp-multicast-set-interface!)
                (1/udp-multicast-set-loopback! udp-multicast-set-loopback!)
                (1/udp-multicast-set-ttl! udp-multicast-set-ttl!)
                (1/udp-multicast-ttl udp-multicast-ttl)
                (1/udp-open-socket udp-open-socket)
                (1/udp-receive! udp-receive!)
                (1/udp-receive!* udp-receive!*)
                (1/udp-receive!-evt udp-receive!-evt)
                (1/udp-receive!/enable-break udp-receive!/enable-break)
                (1/udp-receive-ready-evt udp-receive-ready-evt)
                (1/udp-send udp-send)
                (1/udp-send* udp-send*)
                (1/udp-send-evt udp-send-evt)
                (1/udp-send-ready-evt udp-send-ready-evt)
                (1/udp-send-to udp-send-to)
                (1/udp-send-to* udp-send-to*)
                (1/udp-send-to-evt udp-send-to-evt)
                (1/udp-send-to/enable-break udp-send-to/enable-break)
                (1/udp-send/enable-break udp-send/enable-break)
                (1/udp-set-receive-buffer-size! udp-set-receive-buffer-size!)
                (1/udp-set-ttl! udp-set-ttl!)
                (1/udp-ttl udp-ttl)
                (1/udp? udp?)
                (1/unsafe-file-descriptor->port unsafe-file-descriptor->port)
                (1/unsafe-file-descriptor->semaphore
                 unsafe-file-descriptor->semaphore)
                (1/unsafe-make-security-guard-at-root
                 unsafe-make-security-guard-at-root)
                (1/unsafe-make-signal-received unsafe-make-signal-received)
                (1/unsafe-poll-ctx-eventmask-wakeup
                 unsafe-poll-ctx-eventmask-wakeup)
                (1/unsafe-poll-ctx-fd-wakeup unsafe-poll-ctx-fd-wakeup)
                (1/unsafe-poll-ctx-milliseconds-wakeup
                 unsafe-poll-ctx-milliseconds-wakeup)
                (1/unsafe-poll-fd unsafe-poll-fd)
                (1/unsafe-poller unsafe-poller)
                (1/unsafe-port->file-descriptor unsafe-port->file-descriptor)
                (1/unsafe-port->socket unsafe-port->socket)
                (unsafe-root-logger unsafe-root-logger)
                (1/unsafe-set-sleep-in-thread! unsafe-set-sleep-in-thread!)
                (1/unsafe-signal-received unsafe-signal-received)
                (1/unsafe-socket->port unsafe-socket->port)
                (1/unsafe-socket->semaphore unsafe-socket->semaphore)
                (1/with-input-from-file with-input-from-file)
                (1/with-output-to-file with-output-to-file)
                (1/write write)
                (1/write-byte write-byte)
                (1/write-bytes write-bytes)
                (1/write-bytes-avail write-bytes-avail)
                (1/write-bytes-avail* write-bytes-avail*)
                (1/write-bytes-avail-evt write-bytes-avail-evt)
                (1/write-bytes-avail/enable-break
                 write-bytes-avail/enable-break)
                (1/write-char write-char)
                (1/write-special write-special)
                (1/write-special-avail* write-special-avail*)
                (1/write-special-evt write-special-evt)
                (1/write-string write-string)))
(define hash2725 (hash))
(define hash2702
  (hasheq
   'addon-dir
   '12
   'cache-dir
   '13
   'collects-dir
   '4
   'config-dir
   '3
   'desk-dir
   '15
   'doc-dir
   '16
   'exec-file
   '1
   'home-dir
   '14
   'host-collects-dir
   '6
   'host-config-dir
   '5
   'init-dir
   '17
   'init-file
   '18
   'orig-dir
   '7
   'pref-dir
   '10
   'pref-file
   '11
   'run-file
   '2
   'sys-dir
   '9
   'temp-dir
   '8))
(define hash2610 (hasheq))
(define hash3229
  (hasheq
   'SW_HIDE
   '1
   'SW_MAXIMIZE
   '2
   'SW_MINIMIZE
   '3
   'SW_RESTORE
   '4
   'SW_SHOW
   '5
   'SW_SHOWDEFAULT
   '6
   'SW_SHOWMAXIMIZED
   '7
   'SW_SHOWMINIMIZED
   '8
   'SW_SHOWMINNOACTIVE
   '9
   'SW_SHOWNA
   '10
   'SW_SHOWNOACTIVATE
   '11
   'SW_SHOWNORMAL
   '12
   'sw_hide
   '1
   'sw_maximize
   '2
   'sw_minimize
   '3
   'sw_restore
   '4
   'sw_show
   '5
   'sw_showdefault
   '6
   'sw_showmaximized
   '7
   'sw_showminimized
   '8
   'sw_showminnoactive
   '9
   'sw_showna
   '10
   'sw_shownoactivate
   '11
   'sw_shownormal
   '12))
(define-values
 (prop:keyword-impersonator keyword-impersonator? keyword-impersonator-ref)
 (make-struct-type-property 'keyword-impersonator))
(define keyword-procedure-impersonator-of
  (lambda (v_0)
    (if (keyword-impersonator? v_0)
      (|#%app| (keyword-impersonator-ref v_0) v_0)
      #f)))
(define-values
 (struct:keyword-procedure
  mk-kw-proc
  keyword-procedure?
  keyword-procedure-ref
  keyword-procedure-set!)
 (let ((app_0
        (list
         (cons prop:checked-procedure #t)
         (cons prop:impersonator-of keyword-procedure-impersonator-of))))
   (make-struct-type
    'keyword-procedure
    #f
    4
    0
    #f
    app_0
    (current-inspector)
    #f
    '(0 1 2 3))))
(define keyword-procedure-required
  (make-struct-field-accessor keyword-procedure-ref 2))
(define keyword-procedure-allowed
  (make-struct-field-accessor keyword-procedure-ref 3))
(define-values
 (prop:procedure-accessor procedure-accessor? procedure-accessor-ref)
 (make-struct-type-property
  'procedure
  (lambda (v_0 info-l_0)
    (if (exact-integer? v_0)
      (make-struct-field-accessor (list-ref info-l_0 3) v_0)
      #f))))
(define-values
 (new-prop:procedure new-procedure? new-procedure-ref)
 (make-struct-type-property
  'procedure
  #f
  (list (cons prop:procedure values) (cons prop:procedure-accessor values))
  #t))
(define procedure-keywords
  (lambda (p_0)
    (if (keyword-procedure? p_0)
      (let ((app_0 (keyword-procedure-required p_0)))
        (values app_0 (keyword-procedure-allowed p_0)))
      (if (procedure? p_0)
        (if (new-procedure? p_0)
          (let ((v_0 (new-procedure-ref p_0)))
            (if (procedure? v_0)
              (procedure-keywords v_0)
              (let ((a_0 (procedure-accessor-ref p_0)))
                (if a_0
                  (procedure-keywords (|#%app| a_0 p_0))
                  (values null null)))))
          (values null null))
        (raise-argument-error*
         'procedure-keywords
         'racket/primitive
         "procedure?"
         p_0)))))
(define 1/reverse
  (|#%name|
   reverse
   (lambda (l_0)
     (letrec*
      ((loop_0
        (|#%name|
         loop
         (lambda (a_0 l_1)
           (if (null? l_1)
             a_0
             (let ((app_0 (cons (car l_1) a_0))) (loop_0 app_0 (cdr l_1))))))))
      (loop_0 null l_0)))))
(define-values
 (sort vector-sort vector-sort!)
 (let ((generic-sort_0
        (|#%name|
         generic-sort
         (lambda (A_0 less-than?_0 n_0)
           (let ((n/2-_0 (unsafe-fxrshift n_0 1)))
             (let ((n/2+_0 (unsafe-fx- n_0 n/2-_0)))
               (letrec*
                ((copying-mergesort_0
                  (|#%name|
                   copying-mergesort
                   (lambda (Alo_0 Blo_0 n_1)
                     (if (unsafe-fx= n_1 1)
                       (unsafe-vector-set!
                        A_0
                        Blo_0
                        (unsafe-vector-ref A_0 Alo_0))
                       (if (unsafe-fx= n_1 2)
                         (let ((x_0 (unsafe-vector-ref A_0 Alo_0)))
                           (let ((y_0
                                  (unsafe-vector-ref
                                   A_0
                                   (unsafe-fx+ Alo_0 1))))
                             (let ((x_1 x_0))
                               (if (|#%app| less-than?_0 y_0 x_1)
                                 (begin
                                   (unsafe-vector-set! A_0 Blo_0 y_0)
                                   (unsafe-vector-set!
                                    A_0
                                    (unsafe-fx+ Blo_0 1)
                                    x_1))
                                 (begin
                                   (unsafe-vector-set! A_0 Blo_0 x_1)
                                   (unsafe-vector-set!
                                    A_0
                                    (unsafe-fx+ Blo_0 1)
                                    y_0))))))
                         (if (unsafe-fx< n_1 16)
                           (begin
                             (unsafe-vector-set!
                              A_0
                              Blo_0
                              (unsafe-vector-ref A_0 Alo_0))
                             (letrec*
                              ((iloop_0
                                (|#%name|
                                 iloop
                                 (lambda (i_0)
                                   (if (unsafe-fx< i_0 n_1)
                                     (let ((ref-i_0
                                            (unsafe-vector-ref
                                             A_0
                                             (unsafe-fx+ Alo_0 i_0))))
                                       (letrec*
                                        ((jloop_0
                                          (|#%name|
                                           jloop
                                           (lambda (j_0)
                                             (let ((ref-j-1_0
                                                    (unsafe-vector-ref
                                                     A_0
                                                     (unsafe-fx- j_0 1))))
                                               (if (if (unsafe-fx< Blo_0 j_0)
                                                     (|#%app|
                                                      less-than?_0
                                                      ref-i_0
                                                      ref-j-1_0)
                                                     #f)
                                                 (begin
                                                   (unsafe-vector-set!
                                                    A_0
                                                    j_0
                                                    ref-j-1_0)
                                                   (jloop_0
                                                    (unsafe-fx- j_0 1)))
                                                 (begin
                                                   (unsafe-vector-set!
                                                    A_0
                                                    j_0
                                                    ref-i_0)
                                                   (iloop_0
                                                    (unsafe-fx+ i_0 1)))))))))
                                        (jloop_0 (unsafe-fx+ Blo_0 i_0))))
                                     (void))))))
                              (iloop_0 1)))
                           (let ((n/2-_1 (unsafe-fxrshift n_1 1)))
                             (let ((n/2+_1 (unsafe-fx- n_1 n/2-_1)))
                               (let ((Amid1_0 (unsafe-fx+ Alo_0 n/2-_1)))
                                 (let ((Amid2_0 (unsafe-fx+ Alo_0 n/2+_1)))
                                   (let ((Bmid1_0 (unsafe-fx+ Blo_0 n/2-_1)))
                                     (begin
                                       (copying-mergesort_0
                                        Amid1_0
                                        Bmid1_0
                                        n/2+_1)
                                       (copying-mergesort_0
                                        Alo_0
                                        Amid2_0
                                        n/2-_1)
                                       (let ((b2_0 (unsafe-fx+ Blo_0 n_1)))
                                         (letrec*
                                          ((loop_0
                                            (|#%name|
                                             loop
                                             (lambda (a1_0 b1_0 c1_0)
                                               (let ((x_0
                                                      (unsafe-vector-ref
                                                       A_0
                                                       a1_0)))
                                                 (let ((y_0
                                                        (unsafe-vector-ref
                                                         A_0
                                                         b1_0)))
                                                   (let ((x_1 x_0))
                                                     (if (not
                                                          (|#%app|
                                                           less-than?_0
                                                           y_0
                                                           x_1))
                                                       (begin
                                                         (unsafe-vector-set!
                                                          A_0
                                                          c1_0
                                                          x_1)
                                                         (let ((a1_1
                                                                (unsafe-fx+
                                                                 a1_0
                                                                 1)))
                                                           (let ((c1_1
                                                                  (unsafe-fx+
                                                                   c1_0
                                                                   1)))
                                                             (if (unsafe-fx<
                                                                  c1_1
                                                                  b1_0)
                                                               (loop_0
                                                                a1_1
                                                                b1_0
                                                                c1_1)
                                                               (void)))))
                                                       (begin
                                                         (unsafe-vector-set!
                                                          A_0
                                                          c1_0
                                                          y_0)
                                                         (let ((b1_1
                                                                (unsafe-fx+
                                                                 b1_0
                                                                 1)))
                                                           (let ((c1_1
                                                                  (unsafe-fx+
                                                                   c1_0
                                                                   1)))
                                                             (if (unsafe-fx<=
                                                                  b2_0
                                                                  b1_1)
                                                               (letrec*
                                                                ((loop_1
                                                                  (|#%name|
                                                                   loop
                                                                   (lambda (a1_1
                                                                            c1_2)
                                                                     (if (unsafe-fx<
                                                                          c1_2
                                                                          b1_1)
                                                                       (begin
                                                                         (unsafe-vector-set!
                                                                          A_0
                                                                          c1_2
                                                                          (unsafe-vector-ref
                                                                           A_0
                                                                           a1_1))
                                                                         (loop_1
                                                                          (unsafe-fx+
                                                                           a1_1
                                                                           1)
                                                                          (unsafe-fx+
                                                                           c1_2
                                                                           1)))
                                                                       (void))))))
                                                                (loop_1
                                                                 a1_0
                                                                 c1_1))
                                                               (loop_0
                                                                a1_0
                                                                b1_1
                                                                c1_1)))))))))))))
                                          (loop_0
                                           Amid2_0
                                           Bmid1_0
                                           Blo_0))))))))))))))))
                (begin
                  (copying-mergesort_0 n/2-_0 n_0 n/2+_0)
                  (if (zero? n/2-_0)
                    (void)
                    (copying-mergesort_0 0 n/2+_0 n/2-_0))
                  (letrec*
                   ((loop_0
                     (|#%name|
                      loop
                      (lambda (a1_0 b1_0 c1_0)
                        (let ((x_0 (unsafe-vector-ref A_0 a1_0)))
                          (let ((y_0 (unsafe-vector-ref A_0 b1_0)))
                            (let ((x_1 x_0))
                              (if (|#%app| less-than?_0 x_1 y_0)
                                (begin
                                  (unsafe-vector-set! A_0 c1_0 x_1)
                                  (let ((a1_1 (unsafe-fx+ a1_0 1)))
                                    (let ((c1_1 (unsafe-fx+ c1_0 1)))
                                      (if (unsafe-fx< c1_1 b1_0)
                                        (loop_0 a1_1 b1_0 c1_1)
                                        (void)))))
                                (begin
                                  (unsafe-vector-set! A_0 c1_0 y_0)
                                  (let ((b1_1 (unsafe-fx+ b1_0 1)))
                                    (let ((c1_1 (unsafe-fx+ c1_0 1)))
                                      (if (unsafe-fx<= n_0 b1_1)
                                        (letrec*
                                         ((loop_1
                                           (|#%name|
                                            loop
                                            (lambda (a1_1 c1_2)
                                              (if (unsafe-fx< c1_2 b1_1)
                                                (begin
                                                  (unsafe-vector-set!
                                                   A_0
                                                   c1_2
                                                   (unsafe-vector-ref
                                                    A_0
                                                    a1_1))
                                                  (loop_1
                                                   (unsafe-fx+ a1_1 1)
                                                   (unsafe-fx+ c1_2 1)))
                                                (void))))))
                                         (loop_1 a1_0 c1_1))
                                        (loop_0 a1_0 b1_1 c1_1)))))))))))))
                   (loop_0 n_0 n/2+_0 0))))))))))
   (let ((generic-sort/key_0
          (|#%name|
           generic-sort/key
           (lambda (A_0 less-than?_0 n_0 key_0)
             (let ((n/2-_0 (unsafe-fxrshift n_0 1)))
               (let ((n/2+_0 (unsafe-fx- n_0 n/2-_0)))
                 (letrec*
                  ((copying-mergesort_0
                    (|#%name|
                     copying-mergesort
                     (lambda (Alo_0 Blo_0 n_1)
                       (if (unsafe-fx= n_1 1)
                         (unsafe-vector-set!
                          A_0
                          Blo_0
                          (unsafe-vector-ref A_0 Alo_0))
                         (if (unsafe-fx= n_1 2)
                           (let ((x_0 (unsafe-vector-ref A_0 Alo_0)))
                             (let ((y_0
                                    (unsafe-vector-ref
                                     A_0
                                     (unsafe-fx+ Alo_0 1))))
                               (let ((x_1 x_0))
                                 (if (if key_0
                                       (let ((app_0 (|#%app| key_0 y_0)))
                                         (|#%app|
                                          less-than?_0
                                          app_0
                                          (|#%app| key_0 x_1)))
                                       (|#%app| less-than?_0 y_0 x_1))
                                   (begin
                                     (unsafe-vector-set! A_0 Blo_0 y_0)
                                     (unsafe-vector-set!
                                      A_0
                                      (unsafe-fx+ Blo_0 1)
                                      x_1))
                                   (begin
                                     (unsafe-vector-set! A_0 Blo_0 x_1)
                                     (unsafe-vector-set!
                                      A_0
                                      (unsafe-fx+ Blo_0 1)
                                      y_0))))))
                           (if (unsafe-fx< n_1 16)
                             (begin
                               (unsafe-vector-set!
                                A_0
                                Blo_0
                                (unsafe-vector-ref A_0 Alo_0))
                               (letrec*
                                ((iloop_0
                                  (|#%name|
                                   iloop
                                   (lambda (i_0)
                                     (if (unsafe-fx< i_0 n_1)
                                       (let ((ref-i_0
                                              (unsafe-vector-ref
                                               A_0
                                               (unsafe-fx+ Alo_0 i_0))))
                                         (letrec*
                                          ((jloop_0
                                            (|#%name|
                                             jloop
                                             (lambda (j_0)
                                               (let ((ref-j-1_0
                                                      (unsafe-vector-ref
                                                       A_0
                                                       (unsafe-fx- j_0 1))))
                                                 (if (if (unsafe-fx< Blo_0 j_0)
                                                       (if key_0
                                                         (let ((app_0
                                                                (|#%app|
                                                                 key_0
                                                                 ref-i_0)))
                                                           (|#%app|
                                                            less-than?_0
                                                            app_0
                                                            (|#%app|
                                                             key_0
                                                             ref-j-1_0)))
                                                         (|#%app|
                                                          less-than?_0
                                                          ref-i_0
                                                          ref-j-1_0))
                                                       #f)
                                                   (begin
                                                     (unsafe-vector-set!
                                                      A_0
                                                      j_0
                                                      ref-j-1_0)
                                                     (jloop_0
                                                      (unsafe-fx- j_0 1)))
                                                   (begin
                                                     (unsafe-vector-set!
                                                      A_0
                                                      j_0
                                                      ref-i_0)
                                                     (iloop_0
                                                      (unsafe-fx+
                                                       i_0
                                                       1)))))))))
                                          (jloop_0 (unsafe-fx+ Blo_0 i_0))))
                                       (void))))))
                                (iloop_0 1)))
                             (let ((n/2-_1 (unsafe-fxrshift n_1 1)))
                               (let ((n/2+_1 (unsafe-fx- n_1 n/2-_1)))
                                 (let ((Amid1_0 (unsafe-fx+ Alo_0 n/2-_1)))
                                   (let ((Amid2_0 (unsafe-fx+ Alo_0 n/2+_1)))
                                     (let ((Bmid1_0 (unsafe-fx+ Blo_0 n/2-_1)))
                                       (begin
                                         (copying-mergesort_0
                                          Amid1_0
                                          Bmid1_0
                                          n/2+_1)
                                         (copying-mergesort_0
                                          Alo_0
                                          Amid2_0
                                          n/2-_1)
                                         (let ((b2_0 (unsafe-fx+ Blo_0 n_1)))
                                           (letrec*
                                            ((loop_0
                                              (|#%name|
                                               loop
                                               (lambda (a1_0 b1_0 c1_0)
                                                 (let ((x_0
                                                        (unsafe-vector-ref
                                                         A_0
                                                         a1_0)))
                                                   (let ((y_0
                                                          (unsafe-vector-ref
                                                           A_0
                                                           b1_0)))
                                                     (let ((x_1 x_0))
                                                       (if (not
                                                            (if key_0
                                                              (let ((app_0
                                                                     (|#%app|
                                                                      key_0
                                                                      y_0)))
                                                                (|#%app|
                                                                 less-than?_0
                                                                 app_0
                                                                 (|#%app|
                                                                  key_0
                                                                  x_1)))
                                                              (|#%app|
                                                               less-than?_0
                                                               y_0
                                                               x_1)))
                                                         (begin
                                                           (unsafe-vector-set!
                                                            A_0
                                                            c1_0
                                                            x_1)
                                                           (let ((a1_1
                                                                  (unsafe-fx+
                                                                   a1_0
                                                                   1)))
                                                             (let ((c1_1
                                                                    (unsafe-fx+
                                                                     c1_0
                                                                     1)))
                                                               (if (unsafe-fx<
                                                                    c1_1
                                                                    b1_0)
                                                                 (loop_0
                                                                  a1_1
                                                                  b1_0
                                                                  c1_1)
                                                                 (void)))))
                                                         (begin
                                                           (unsafe-vector-set!
                                                            A_0
                                                            c1_0
                                                            y_0)
                                                           (let ((b1_1
                                                                  (unsafe-fx+
                                                                   b1_0
                                                                   1)))
                                                             (let ((c1_1
                                                                    (unsafe-fx+
                                                                     c1_0
                                                                     1)))
                                                               (if (unsafe-fx<=
                                                                    b2_0
                                                                    b1_1)
                                                                 (letrec*
                                                                  ((loop_1
                                                                    (|#%name|
                                                                     loop
                                                                     (lambda (a1_1
                                                                              c1_2)
                                                                       (if (unsafe-fx<
                                                                            c1_2
                                                                            b1_1)
                                                                         (begin
                                                                           (unsafe-vector-set!
                                                                            A_0
                                                                            c1_2
                                                                            (unsafe-vector-ref
                                                                             A_0
                                                                             a1_1))
                                                                           (loop_1
                                                                            (unsafe-fx+
                                                                             a1_1
                                                                             1)
                                                                            (unsafe-fx+
                                                                             c1_2
                                                                             1)))
                                                                         (void))))))
                                                                  (loop_1
                                                                   a1_0
                                                                   c1_1))
                                                                 (loop_0
                                                                  a1_0
                                                                  b1_1
                                                                  c1_1)))))))))))))
                                            (loop_0
                                             Amid2_0
                                             Bmid1_0
                                             Blo_0))))))))))))))))
                  (begin
                    (copying-mergesort_0 n/2-_0 n_0 n/2+_0)
                    (if (zero? n/2-_0)
                      (void)
                      (copying-mergesort_0 0 n/2+_0 n/2-_0))
                    (letrec*
                     ((loop_0
                       (|#%name|
                        loop
                        (lambda (a1_0 b1_0 c1_0)
                          (let ((x_0 (unsafe-vector-ref A_0 a1_0)))
                            (let ((y_0 (unsafe-vector-ref A_0 b1_0)))
                              (let ((x_1 x_0))
                                (if (if key_0
                                      (let ((app_0 (|#%app| key_0 x_1)))
                                        (|#%app|
                                         less-than?_0
                                         app_0
                                         (|#%app| key_0 y_0)))
                                      (|#%app| less-than?_0 x_1 y_0))
                                  (begin
                                    (unsafe-vector-set! A_0 c1_0 x_1)
                                    (let ((a1_1 (unsafe-fx+ a1_0 1)))
                                      (let ((c1_1 (unsafe-fx+ c1_0 1)))
                                        (if (unsafe-fx< c1_1 b1_0)
                                          (loop_0 a1_1 b1_0 c1_1)
                                          (void)))))
                                  (begin
                                    (unsafe-vector-set! A_0 c1_0 y_0)
                                    (let ((b1_1 (unsafe-fx+ b1_0 1)))
                                      (let ((c1_1 (unsafe-fx+ c1_0 1)))
                                        (if (unsafe-fx<= n_0 b1_1)
                                          (letrec*
                                           ((loop_1
                                             (|#%name|
                                              loop
                                              (lambda (a1_1 c1_2)
                                                (if (unsafe-fx< c1_2 b1_1)
                                                  (begin
                                                    (unsafe-vector-set!
                                                     A_0
                                                     c1_2
                                                     (unsafe-vector-ref
                                                      A_0
                                                      a1_1))
                                                    (loop_1
                                                     (unsafe-fx+ a1_1 1)
                                                     (unsafe-fx+ c1_2 1)))
                                                  (void))))))
                                           (loop_1 a1_0 c1_1))
                                          (loop_0 a1_0 b1_1 c1_1)))))))))))))
                     (loop_0 n_0 n/2+_0 0))))))))))
     (values
      (case-lambda
       ((lst_0 less-than?_0)
        (let ((n_0 (length lst_0)))
          (if (unsafe-fx= n_0 0)
            lst_0
            (if (letrec*
                 ((loop_0
                   (|#%name|
                    loop
                    (lambda (last_0 next_0)
                      (let ((or-part_0 (null? next_0)))
                        (if or-part_0
                          or-part_0
                          (if (not
                               (|#%app|
                                less-than?_0
                                (unsafe-car next_0)
                                last_0))
                            (loop_0 (unsafe-car next_0) (unsafe-cdr next_0))
                            #f)))))))
                 (let ((app_0 (car lst_0))) (loop_0 app_0 (cdr lst_0))))
              lst_0
              (if (unsafe-fx<= n_0 3)
                (if (unsafe-fx= n_0 1)
                  lst_0
                  (if (unsafe-fx= n_0 2)
                    (let ((app_0 (cadr lst_0))) (list app_0 (car lst_0)))
                    (let ((a_0 (car lst_0)))
                      (let ((b_0 (cadr lst_0)))
                        (let ((c_0 (caddr lst_0)))
                          (let ((b_1 b_0) (a_1 a_0))
                            (if (|#%app| less-than?_0 b_1 a_1)
                              (if (|#%app| less-than?_0 c_0 b_1)
                                (list c_0 b_1 a_1)
                                (if (|#%app| less-than?_0 c_0 a_1)
                                  (list b_1 c_0 a_1)
                                  (list b_1 a_1 c_0)))
                              (if (|#%app| less-than?_0 c_0 a_1)
                                (list c_0 a_1 b_1)
                                (list a_1 c_0 b_1)))))))))
                (let ((vec_0 (make-vector (+ n_0 (ceiling (/ n_0 2))))))
                  (begin
                    (letrec*
                     ((loop_0
                       (|#%name|
                        loop
                        (lambda (i_0 lst_1)
                          (if (pair? lst_1)
                            (begin
                              (vector-set! vec_0 i_0 (car lst_1))
                              (let ((app_0 (add1 i_0)))
                                (loop_0 app_0 (cdr lst_1))))
                            (void))))))
                     (loop_0 0 lst_0))
                    (generic-sort_0 vec_0 less-than?_0 n_0)
                    (letrec*
                     ((loop_0
                       (|#%name|
                        loop
                        (lambda (i_0 r_0)
                          (let ((i_1 (sub1 i_0)))
                            (if (< i_1 0)
                              r_0
                              (loop_0
                               i_1
                               (cons (vector-ref vec_0 i_1) r_0))))))))
                     (loop_0 n_0 '())))))))))
       ((lst_0 less-than?_0 getkey_0)
        (if (if getkey_0 (not (eq? values getkey_0)) #f)
          (|#%app| sort lst_0 less-than?_0 getkey_0 #f)
          (|#%app| sort lst_0 less-than?_0)))
       ((lst_0 less-than?_0 getkey_0 cache-keys?_0)
        (if (if getkey_0 (not (eq? values getkey_0)) #f)
          (let ((n_0 (length lst_0)))
            (if (unsafe-fx= n_0 0)
              lst_0
              (if cache-keys?_0
                (let ((vec_0 (make-vector (+ n_0 (ceiling (/ n_0 2))))))
                  (begin
                    (letrec*
                     ((loop_0
                       (|#%name|
                        loop
                        (lambda (i_0 lst_1)
                          (if (pair? lst_1)
                            (let ((x_0 (car lst_1)))
                              (begin
                                (unsafe-vector-set!
                                 vec_0
                                 i_0
                                 (cons (|#%app| getkey_0 x_0) x_0))
                                (loop_0 (unsafe-fx+ i_0 1) (cdr lst_1))))
                            (void))))))
                     (loop_0 0 lst_0))
                    (generic-sort/key_0 vec_0 less-than?_0 n_0 unsafe-car)
                    (letrec*
                     ((loop_0
                       (|#%name|
                        loop
                        (lambda (i_0 r_0)
                          (let ((i_1 (unsafe-fx- i_0 1)))
                            (if (unsafe-fx< i_1 0)
                              r_0
                              (loop_0
                               i_1
                               (cons
                                (unsafe-cdr (unsafe-vector-ref vec_0 i_1))
                                r_0))))))))
                     (loop_0 n_0 '()))))
                (if (letrec*
                     ((loop_0
                       (|#%name|
                        loop
                        (lambda (last_0 next_0)
                          (let ((or-part_0 (null? next_0)))
                            (if or-part_0
                              or-part_0
                              (if (not
                                   (if getkey_0
                                     (let ((app_0
                                            (|#%app|
                                             getkey_0
                                             (unsafe-car next_0))))
                                       (|#%app|
                                        less-than?_0
                                        app_0
                                        (|#%app| getkey_0 last_0)))
                                     (|#%app|
                                      less-than?_0
                                      (unsafe-car next_0)
                                      last_0)))
                                (loop_0
                                 (unsafe-car next_0)
                                 (unsafe-cdr next_0))
                                #f)))))))
                     (let ((app_0 (car lst_0))) (loop_0 app_0 (cdr lst_0))))
                  lst_0
                  (if (unsafe-fx<= n_0 3)
                    (if (unsafe-fx= n_0 1)
                      lst_0
                      (if (unsafe-fx= n_0 2)
                        (let ((app_0 (cadr lst_0))) (list app_0 (car lst_0)))
                        (let ((a_0 (car lst_0)))
                          (let ((b_0 (cadr lst_0)))
                            (let ((c_0 (caddr lst_0)))
                              (let ((b_1 b_0) (a_1 a_0))
                                (if (if getkey_0
                                      (let ((app_0 (|#%app| getkey_0 b_1)))
                                        (|#%app|
                                         less-than?_0
                                         app_0
                                         (|#%app| getkey_0 a_1)))
                                      (|#%app| less-than?_0 b_1 a_1))
                                  (if (if getkey_0
                                        (let ((app_0 (|#%app| getkey_0 c_0)))
                                          (|#%app|
                                           less-than?_0
                                           app_0
                                           (|#%app| getkey_0 b_1)))
                                        (|#%app| less-than?_0 c_0 b_1))
                                    (list c_0 b_1 a_1)
                                    (if (if getkey_0
                                          (let ((app_0 (|#%app| getkey_0 c_0)))
                                            (|#%app|
                                             less-than?_0
                                             app_0
                                             (|#%app| getkey_0 a_1)))
                                          (|#%app| less-than?_0 c_0 a_1))
                                      (list b_1 c_0 a_1)
                                      (list b_1 a_1 c_0)))
                                  (if (if getkey_0
                                        (let ((app_0 (|#%app| getkey_0 c_0)))
                                          (|#%app|
                                           less-than?_0
                                           app_0
                                           (|#%app| getkey_0 a_1)))
                                        (|#%app| less-than?_0 c_0 a_1))
                                    (list c_0 a_1 b_1)
                                    (list a_1 c_0 b_1)))))))))
                    (let ((vec_0 (make-vector (+ n_0 (ceiling (/ n_0 2))))))
                      (begin
                        (letrec*
                         ((loop_0
                           (|#%name|
                            loop
                            (lambda (i_0 lst_1)
                              (if (pair? lst_1)
                                (begin
                                  (vector-set! vec_0 i_0 (car lst_1))
                                  (let ((app_0 (add1 i_0)))
                                    (loop_0 app_0 (cdr lst_1))))
                                (void))))))
                         (loop_0 0 lst_0))
                        (generic-sort/key_0 vec_0 less-than?_0 n_0 getkey_0)
                        (letrec*
                         ((loop_0
                           (|#%name|
                            loop
                            (lambda (i_0 r_0)
                              (let ((i_1 (sub1 i_0)))
                                (if (< i_1 0)
                                  r_0
                                  (loop_0
                                   i_1
                                   (cons (vector-ref vec_0 i_1) r_0))))))))
                         (loop_0 n_0 '())))))))))
          (|#%app| sort lst_0 less-than?_0))))
      (case-lambda
       ((vec_0 less-than?_0 start_0 end_0)
        (let ((n_0 (- end_0 start_0)))
          (let ((dst-vec_0 (make-vector n_0)))
            (begin
              (if (unsafe-fx= n_0 0)
                (void)
                (if (letrec*
                     ((loop_0
                       (|#%name|
                        loop
                        (lambda (prev-val_0 next-index_0)
                          (let ((or-part_0 (unsafe-fx= next-index_0 end_0)))
                            (if or-part_0
                              or-part_0
                              (let ((next-val_0
                                     (unsafe-vector-ref vec_0 next-index_0)))
                                (if (not
                                     (|#%app|
                                      less-than?_0
                                      next-val_0
                                      prev-val_0))
                                  (loop_0
                                   next-val_0
                                   (unsafe-fx+ next-index_0 1))
                                  #f))))))))
                     (let ((app_0 (unsafe-vector-ref vec_0 start_0)))
                       (loop_0 app_0 (unsafe-fx+ start_0 1))))
                  (vector-copy! dst-vec_0 0 vec_0 start_0 end_0)
                  (if (unsafe-fx<= n_0 3)
                    (begin
                      (vector-copy! dst-vec_0 0 vec_0 start_0 end_0)
                      (if (unsafe-fx= n_0 1)
                        (void)
                        (if (unsafe-fx= n_0 2)
                          (let ((tmp_0 (unsafe-vector-ref dst-vec_0 0)))
                            (begin
                              (unsafe-vector-set!
                               dst-vec_0
                               0
                               (unsafe-vector-ref dst-vec_0 1))
                              (unsafe-vector-set! dst-vec_0 1 tmp_0)))
                          (let ((a_0 (unsafe-vector-ref dst-vec_0 0)))
                            (let ((b_0 (unsafe-vector-ref dst-vec_0 1)))
                              (let ((c_0 (unsafe-vector-ref dst-vec_0 2)))
                                (let ((b_1 b_0) (a_1 a_0))
                                  (if (|#%app| less-than?_0 b_1 a_1)
                                    (if (|#%app| less-than?_0 c_0 b_1)
                                      (begin
                                        (unsafe-vector-set! dst-vec_0 0 c_0)
                                        (unsafe-vector-set! dst-vec_0 2 a_1))
                                      (if (|#%app| less-than?_0 c_0 a_1)
                                        (begin
                                          (unsafe-vector-set! dst-vec_0 0 b_1)
                                          (unsafe-vector-set! dst-vec_0 1 c_0)
                                          (unsafe-vector-set! dst-vec_0 2 a_1))
                                        (begin
                                          (unsafe-vector-set! dst-vec_0 0 b_1)
                                          (unsafe-vector-set!
                                           dst-vec_0
                                           1
                                           a_1))))
                                    (if (|#%app| less-than?_0 c_0 a_1)
                                      (begin
                                        (unsafe-vector-set! dst-vec_0 0 c_0)
                                        (unsafe-vector-set! dst-vec_0 1 a_1)
                                        (unsafe-vector-set! dst-vec_0 2 b_1))
                                      (begin
                                        (unsafe-vector-set! dst-vec_0 1 c_0)
                                        (unsafe-vector-set!
                                         dst-vec_0
                                         2
                                         b_1)))))))))))
                    (let ((work-vec_0
                           (make-vector (+ n_0 (ceiling (/ n_0 2))) #f)))
                      (begin
                        (vector-copy! work-vec_0 0 vec_0 start_0 end_0)
                        (generic-sort_0 work-vec_0 less-than?_0 n_0)
                        (vector-copy! dst-vec_0 0 work-vec_0 0 n_0))))))
              dst-vec_0))))
       ((vec_0 less-than?_0 start_0 end_0 getkey_0 cache-keys?_0)
        (if (if getkey_0 (not (eq? values getkey_0)) #f)
          (let ((n_0 (- end_0 start_0)))
            (let ((dst-vec_0 (make-vector n_0)))
              (begin
                (if (unsafe-fx= n_0 0)
                  (void)
                  (if cache-keys?_0
                    (let ((work-vec_0
                           (make-vector (+ n_0 (ceiling (/ n_0 2))) #t)))
                      (begin
                        (letrec*
                         ((loop_0
                           (|#%name|
                            loop
                            (lambda (i_0)
                              (if (unsafe-fx< i_0 n_0)
                                (begin
                                  (let ((x_0
                                         (unsafe-vector-ref
                                          vec_0
                                          (unsafe-fx+ i_0 start_0))))
                                    (unsafe-vector-set!
                                     work-vec_0
                                     i_0
                                     (cons (|#%app| getkey_0 x_0) x_0)))
                                  (loop_0 (unsafe-fx+ i_0 1)))
                                (void))))))
                         (loop_0 0))
                        (generic-sort/key_0
                         work-vec_0
                         less-than?_0
                         n_0
                         unsafe-car)
                        (letrec*
                         ((loop_0
                           (|#%name|
                            loop
                            (lambda (i_0)
                              (if (unsafe-fx< i_0 n_0)
                                (begin
                                  (unsafe-vector-set!
                                   dst-vec_0
                                   (unsafe-fx+ i_0 0)
                                   (unsafe-cdr
                                    (unsafe-vector-ref work-vec_0 i_0)))
                                  (loop_0 (unsafe-fx+ i_0 1)))
                                (void))))))
                         (loop_0 0))))
                    (if (letrec*
                         ((loop_0
                           (|#%name|
                            loop
                            (lambda (prev-val_0 next-index_0)
                              (let ((or-part_0
                                     (unsafe-fx= next-index_0 end_0)))
                                (if or-part_0
                                  or-part_0
                                  (let ((next-val_0
                                         (unsafe-vector-ref
                                          vec_0
                                          next-index_0)))
                                    (if (not
                                         (if getkey_0
                                           (let ((app_0
                                                  (|#%app|
                                                   getkey_0
                                                   next-val_0)))
                                             (|#%app|
                                              less-than?_0
                                              app_0
                                              (|#%app| getkey_0 prev-val_0)))
                                           (|#%app|
                                            less-than?_0
                                            next-val_0
                                            prev-val_0)))
                                      (loop_0
                                       next-val_0
                                       (unsafe-fx+ next-index_0 1))
                                      #f))))))))
                         (let ((app_0 (unsafe-vector-ref vec_0 start_0)))
                           (loop_0 app_0 (unsafe-fx+ start_0 1))))
                      (vector-copy! dst-vec_0 0 vec_0 start_0 end_0)
                      (if (unsafe-fx<= n_0 3)
                        (begin
                          (vector-copy! dst-vec_0 0 vec_0 start_0 end_0)
                          (if (unsafe-fx= n_0 1)
                            (void)
                            (if (unsafe-fx= n_0 2)
                              (let ((tmp_0 (unsafe-vector-ref dst-vec_0 0)))
                                (begin
                                  (unsafe-vector-set!
                                   dst-vec_0
                                   0
                                   (unsafe-vector-ref dst-vec_0 1))
                                  (unsafe-vector-set! dst-vec_0 1 tmp_0)))
                              (let ((a_0 (unsafe-vector-ref dst-vec_0 0)))
                                (let ((b_0 (unsafe-vector-ref dst-vec_0 1)))
                                  (let ((c_0 (unsafe-vector-ref dst-vec_0 2)))
                                    (let ((b_1 b_0) (a_1 a_0))
                                      (if (if getkey_0
                                            (let ((app_0
                                                   (|#%app| getkey_0 b_1)))
                                              (|#%app|
                                               less-than?_0
                                               app_0
                                               (|#%app| getkey_0 a_1)))
                                            (|#%app| less-than?_0 b_1 a_1))
                                        (if (if getkey_0
                                              (let ((app_0
                                                     (|#%app| getkey_0 c_0)))
                                                (|#%app|
                                                 less-than?_0
                                                 app_0
                                                 (|#%app| getkey_0 b_1)))
                                              (|#%app| less-than?_0 c_0 b_1))
                                          (begin
                                            (unsafe-vector-set!
                                             dst-vec_0
                                             0
                                             c_0)
                                            (unsafe-vector-set!
                                             dst-vec_0
                                             2
                                             a_1))
                                          (if (if getkey_0
                                                (let ((app_0
                                                       (|#%app| getkey_0 c_0)))
                                                  (|#%app|
                                                   less-than?_0
                                                   app_0
                                                   (|#%app| getkey_0 a_1)))
                                                (|#%app| less-than?_0 c_0 a_1))
                                            (begin
                                              (unsafe-vector-set!
                                               dst-vec_0
                                               0
                                               b_1)
                                              (unsafe-vector-set!
                                               dst-vec_0
                                               1
                                               c_0)
                                              (unsafe-vector-set!
                                               dst-vec_0
                                               2
                                               a_1))
                                            (begin
                                              (unsafe-vector-set!
                                               dst-vec_0
                                               0
                                               b_1)
                                              (unsafe-vector-set!
                                               dst-vec_0
                                               1
                                               a_1))))
                                        (if (if getkey_0
                                              (let ((app_0
                                                     (|#%app| getkey_0 c_0)))
                                                (|#%app|
                                                 less-than?_0
                                                 app_0
                                                 (|#%app| getkey_0 a_1)))
                                              (|#%app| less-than?_0 c_0 a_1))
                                          (begin
                                            (unsafe-vector-set!
                                             dst-vec_0
                                             0
                                             c_0)
                                            (unsafe-vector-set!
                                             dst-vec_0
                                             1
                                             a_1)
                                            (unsafe-vector-set!
                                             dst-vec_0
                                             2
                                             b_1))
                                          (begin
                                            (unsafe-vector-set!
                                             dst-vec_0
                                             1
                                             c_0)
                                            (unsafe-vector-set!
                                             dst-vec_0
                                             2
                                             b_1)))))))))))
                        (let ((work-vec_0
                               (make-vector (+ n_0 (ceiling (/ n_0 2))) #f)))
                          (begin
                            (vector-copy! work-vec_0 0 vec_0 start_0 end_0)
                            (generic-sort/key_0
                             work-vec_0
                             less-than?_0
                             n_0
                             getkey_0)
                            (vector-copy! dst-vec_0 0 work-vec_0 0 n_0)))))))
                dst-vec_0)))
          (|#%app| vector-sort vec_0 less-than?_0 start_0 end_0))))
      (case-lambda
       ((vec_0 less-than?_0 start_0 end_0)
        (let ((n_0 (- end_0 start_0)))
          (begin
            (if (unsafe-fx= n_0 0)
              (void)
              (if (letrec*
                   ((loop_0
                     (|#%name|
                      loop
                      (lambda (prev-val_0 next-index_0)
                        (let ((or-part_0 (unsafe-fx= next-index_0 end_0)))
                          (if or-part_0
                            or-part_0
                            (let ((next-val_0
                                   (unsafe-vector-ref vec_0 next-index_0)))
                              (if (not
                                   (|#%app|
                                    less-than?_0
                                    next-val_0
                                    prev-val_0))
                                (loop_0 next-val_0 (unsafe-fx+ next-index_0 1))
                                #f))))))))
                   (let ((app_0 (unsafe-vector-ref vec_0 start_0)))
                     (loop_0 app_0 (unsafe-fx+ start_0 1))))
                (void)
                (if (unsafe-fx<= n_0 3)
                  (if (unsafe-fx= n_0 1)
                    (void)
                    (if (unsafe-fx= n_0 2)
                      (let ((tmp_0
                             (unsafe-vector-ref vec_0 (unsafe-fx+ start_0 0))))
                        (begin
                          (unsafe-vector-set!
                           vec_0
                           (unsafe-fx+ start_0 0)
                           (unsafe-vector-ref vec_0 (unsafe-fx+ start_0 1)))
                          (unsafe-vector-set!
                           vec_0
                           (unsafe-fx+ start_0 1)
                           tmp_0)))
                      (let ((a_0
                             (unsafe-vector-ref vec_0 (unsafe-fx+ start_0 0))))
                        (let ((b_0
                               (unsafe-vector-ref
                                vec_0
                                (unsafe-fx+ start_0 1))))
                          (let ((c_0
                                 (unsafe-vector-ref
                                  vec_0
                                  (unsafe-fx+ start_0 2))))
                            (let ((b_1 b_0) (a_1 a_0))
                              (if (|#%app| less-than?_0 b_1 a_1)
                                (if (|#%app| less-than?_0 c_0 b_1)
                                  (begin
                                    (unsafe-vector-set!
                                     vec_0
                                     (unsafe-fx+ start_0 0)
                                     c_0)
                                    (unsafe-vector-set!
                                     vec_0
                                     (unsafe-fx+ start_0 2)
                                     a_1))
                                  (if (|#%app| less-than?_0 c_0 a_1)
                                    (begin
                                      (unsafe-vector-set!
                                       vec_0
                                       (unsafe-fx+ start_0 0)
                                       b_1)
                                      (unsafe-vector-set!
                                       vec_0
                                       (unsafe-fx+ start_0 1)
                                       c_0)
                                      (unsafe-vector-set!
                                       vec_0
                                       (unsafe-fx+ start_0 2)
                                       a_1))
                                    (begin
                                      (unsafe-vector-set!
                                       vec_0
                                       (unsafe-fx+ start_0 0)
                                       b_1)
                                      (unsafe-vector-set!
                                       vec_0
                                       (unsafe-fx+ start_0 1)
                                       a_1))))
                                (if (|#%app| less-than?_0 c_0 a_1)
                                  (begin
                                    (unsafe-vector-set!
                                     vec_0
                                     (unsafe-fx+ start_0 0)
                                     c_0)
                                    (unsafe-vector-set!
                                     vec_0
                                     (unsafe-fx+ start_0 1)
                                     a_1)
                                    (unsafe-vector-set!
                                     vec_0
                                     (unsafe-fx+ start_0 2)
                                     b_1))
                                  (begin
                                    (unsafe-vector-set!
                                     vec_0
                                     (unsafe-fx+ start_0 1)
                                     c_0)
                                    (unsafe-vector-set!
                                     vec_0
                                     (unsafe-fx+ start_0 2)
                                     b_1))))))))))
                  (let ((work-vec_0
                         (make-vector (+ n_0 (ceiling (/ n_0 2))) #f)))
                    (begin
                      (vector-copy! work-vec_0 0 vec_0 start_0 end_0)
                      (generic-sort_0 work-vec_0 less-than?_0 n_0)
                      (vector-copy! vec_0 start_0 work-vec_0 0 n_0))))))
            (void))))
       ((vec_0 less-than?_0 start_0 end_0 getkey_0 cache-keys?_0)
        (if (if getkey_0 (not (eq? values getkey_0)) #f)
          (let ((n_0 (- end_0 start_0)))
            (begin
              (if (unsafe-fx= n_0 0)
                (void)
                (if cache-keys?_0
                  (let ((work-vec_0
                         (make-vector (+ n_0 (ceiling (/ n_0 2))) #t)))
                    (begin
                      (letrec*
                       ((loop_0
                         (|#%name|
                          loop
                          (lambda (i_0)
                            (if (unsafe-fx< i_0 n_0)
                              (begin
                                (let ((x_0
                                       (unsafe-vector-ref
                                        vec_0
                                        (unsafe-fx+ i_0 start_0))))
                                  (unsafe-vector-set!
                                   work-vec_0
                                   i_0
                                   (cons (|#%app| getkey_0 x_0) x_0)))
                                (loop_0 (unsafe-fx+ i_0 1)))
                              (void))))))
                       (loop_0 0))
                      (generic-sort/key_0
                       work-vec_0
                       less-than?_0
                       n_0
                       unsafe-car)
                      (letrec*
                       ((loop_0
                         (|#%name|
                          loop
                          (lambda (i_0)
                            (if (unsafe-fx< i_0 n_0)
                              (begin
                                (unsafe-vector-set!
                                 vec_0
                                 (unsafe-fx+ i_0 start_0)
                                 (unsafe-cdr
                                  (unsafe-vector-ref work-vec_0 i_0)))
                                (loop_0 (unsafe-fx+ i_0 1)))
                              (void))))))
                       (loop_0 0))))
                  (if (letrec*
                       ((loop_0
                         (|#%name|
                          loop
                          (lambda (prev-val_0 next-index_0)
                            (let ((or-part_0 (unsafe-fx= next-index_0 end_0)))
                              (if or-part_0
                                or-part_0
                                (let ((next-val_0
                                       (unsafe-vector-ref vec_0 next-index_0)))
                                  (if (not
                                       (if getkey_0
                                         (let ((app_0
                                                (|#%app| getkey_0 next-val_0)))
                                           (|#%app|
                                            less-than?_0
                                            app_0
                                            (|#%app| getkey_0 prev-val_0)))
                                         (|#%app|
                                          less-than?_0
                                          next-val_0
                                          prev-val_0)))
                                    (loop_0
                                     next-val_0
                                     (unsafe-fx+ next-index_0 1))
                                    #f))))))))
                       (let ((app_0 (unsafe-vector-ref vec_0 start_0)))
                         (loop_0 app_0 (unsafe-fx+ start_0 1))))
                    (void)
                    (if (unsafe-fx<= n_0 3)
                      (if (unsafe-fx= n_0 1)
                        (void)
                        (if (unsafe-fx= n_0 2)
                          (let ((tmp_0
                                 (unsafe-vector-ref
                                  vec_0
                                  (unsafe-fx+ start_0 0))))
                            (begin
                              (unsafe-vector-set!
                               vec_0
                               (unsafe-fx+ start_0 0)
                               (unsafe-vector-ref
                                vec_0
                                (unsafe-fx+ start_0 1)))
                              (unsafe-vector-set!
                               vec_0
                               (unsafe-fx+ start_0 1)
                               tmp_0)))
                          (let ((a_0
                                 (unsafe-vector-ref
                                  vec_0
                                  (unsafe-fx+ start_0 0))))
                            (let ((b_0
                                   (unsafe-vector-ref
                                    vec_0
                                    (unsafe-fx+ start_0 1))))
                              (let ((c_0
                                     (unsafe-vector-ref
                                      vec_0
                                      (unsafe-fx+ start_0 2))))
                                (let ((b_1 b_0) (a_1 a_0))
                                  (if (if getkey_0
                                        (let ((app_0 (|#%app| getkey_0 b_1)))
                                          (|#%app|
                                           less-than?_0
                                           app_0
                                           (|#%app| getkey_0 a_1)))
                                        (|#%app| less-than?_0 b_1 a_1))
                                    (if (if getkey_0
                                          (let ((app_0 (|#%app| getkey_0 c_0)))
                                            (|#%app|
                                             less-than?_0
                                             app_0
                                             (|#%app| getkey_0 b_1)))
                                          (|#%app| less-than?_0 c_0 b_1))
                                      (begin
                                        (unsafe-vector-set!
                                         vec_0
                                         (unsafe-fx+ start_0 0)
                                         c_0)
                                        (unsafe-vector-set!
                                         vec_0
                                         (unsafe-fx+ start_0 2)
                                         a_1))
                                      (if (if getkey_0
                                            (let ((app_0
                                                   (|#%app| getkey_0 c_0)))
                                              (|#%app|
                                               less-than?_0
                                               app_0
                                               (|#%app| getkey_0 a_1)))
                                            (|#%app| less-than?_0 c_0 a_1))
                                        (begin
                                          (unsafe-vector-set!
                                           vec_0
                                           (unsafe-fx+ start_0 0)
                                           b_1)
                                          (unsafe-vector-set!
                                           vec_0
                                           (unsafe-fx+ start_0 1)
                                           c_0)
                                          (unsafe-vector-set!
                                           vec_0
                                           (unsafe-fx+ start_0 2)
                                           a_1))
                                        (begin
                                          (unsafe-vector-set!
                                           vec_0
                                           (unsafe-fx+ start_0 0)
                                           b_1)
                                          (unsafe-vector-set!
                                           vec_0
                                           (unsafe-fx+ start_0 1)
                                           a_1))))
                                    (if (if getkey_0
                                          (let ((app_0 (|#%app| getkey_0 c_0)))
                                            (|#%app|
                                             less-than?_0
                                             app_0
                                             (|#%app| getkey_0 a_1)))
                                          (|#%app| less-than?_0 c_0 a_1))
                                      (begin
                                        (unsafe-vector-set!
                                         vec_0
                                         (unsafe-fx+ start_0 0)
                                         c_0)
                                        (unsafe-vector-set!
                                         vec_0
                                         (unsafe-fx+ start_0 1)
                                         a_1)
                                        (unsafe-vector-set!
                                         vec_0
                                         (unsafe-fx+ start_0 2)
                                         b_1))
                                      (begin
                                        (unsafe-vector-set!
                                         vec_0
                                         (unsafe-fx+ start_0 1)
                                         c_0)
                                        (unsafe-vector-set!
                                         vec_0
                                         (unsafe-fx+ start_0 2)
                                         b_1))))))))))
                      (let ((work-vec_0
                             (make-vector (+ n_0 (ceiling (/ n_0 2))) #f)))
                        (begin
                          (vector-copy! work-vec_0 0 vec_0 start_0 end_0)
                          (generic-sort/key_0
                           work-vec_0
                           less-than?_0
                           n_0
                           getkey_0)
                          (vector-copy! vec_0 start_0 work-vec_0 0 n_0)))))))
              (void)))
          (|#%app| vector-sort! vec_0 less-than?_0 start_0 end_0))))))))
(define raise-argument-error$1
  (|#%name|
   raise-argument-error
   (lambda (who_0 . args_0)
     (apply raise-argument-error* who_0 'racket/primitive args_0))))
(define 1/raise-arguments-error
  (|#%name|
   raise-arguments-error
   (lambda (who_0 . args_0)
     (apply raise-arguments-error* who_0 'racket/primitive args_0))))
(define 1/raise-range-error
  (|#%name|
   raise-range-error
   (lambda (who_0 . args_0)
     (apply raise-range-error* who_0 'racket/primitive args_0))))
(define-values
 (prop:stream stream-via-prop? stream-ref)
 (make-struct-type-property
  'stream
  (lambda (v_0 si_0)
    (begin
      (if (if (vector? v_0)
            (if (= 3 (vector-length v_0))
              (if (procedure? (vector-ref v_0 0))
                (if (procedure-arity-includes? (vector-ref v_0 0) 1)
                  (if (procedure? (vector-ref v_0 1))
                    (if (procedure-arity-includes? (vector-ref v_0 1) 1)
                      (if (procedure? (vector-ref v_0 2))
                        (procedure-arity-includes? (vector-ref v_0 2) 1)
                        #f)
                      #f)
                    #f)
                  #f)
                #f)
              #f)
            #f)
        (void)
        (raise-argument-error$1
         'guard-for-prop:stream
         (string-append
          "(vector/c (procedure-arity-includes/c 1)\n"
          "          (procedure-arity-includes/c 1)\n"
          "          (procedure-arity-includes/c 1))")
         v_0))
      (vector->immutable-vector v_0)))
  '()
  #t))
(define-values
 (prop:gen-sequence sequence-via-prop? sequence-ref)
 (make-struct-type-property
  'sequence
  (lambda (v_0 si_0)
    (begin
      (if (if (procedure? v_0) (procedure-arity-includes? v_0 1) #f)
        (void)
        (raise-argument-error$1
         'guard-for-prop:sequence
         "(procedure-arity-includes/c 1)"
         v_0))
      v_0))))
(define-values
 (struct:range make-range range? range-ref range-set!)
 (make-struct-type
  'stream
  #f
  3
  0
  #f
  (list
   (cons
    prop:stream
    (vector
     (lambda (v_0)
       (let ((cont?_0 (|#%app| range-ref v_0 2)))
         (if cont?_0 (not (|#%app| cont?_0 (|#%app| range-ref v_0 0))) #f)))
     (lambda (v_0) (|#%app| range-ref v_0 0))
     (lambda (v_0)
       (let ((app_0
              (let ((app_0 (|#%app| range-ref v_0 1)))
                (|#%app| app_0 (|#%app| range-ref v_0 0)))))
         (let ((app_1 (|#%app| range-ref v_0 1)))
           (make-range app_0 app_1 (|#%app| range-ref v_0 2)))))))
   (cons
    prop:gen-sequence
    (lambda (v_0)
      (let ((app_0 (|#%app| range-ref v_0 1)))
        (let ((app_1 (|#%app| range-ref v_0 0)))
          (values values #f app_0 app_1 (|#%app| range-ref v_0 2) #f #f))))))))
(define check-range
  (lambda (a_0 b_0 step_0) (check-range-generic 'in-range a_0 b_0 step_0)))
(define check-range-generic
  (lambda (who_0 a_0 b_0 step_0)
    (begin
      (if (real? a_0) (void) (raise-argument-error$1 who_0 "real?" a_0))
      (if (real? b_0) (void) (raise-argument-error$1 who_0 "real?" b_0))
      (if (real? step_0)
        (void)
        (raise-argument-error$1 who_0 "real?" step_0)))))
(define check-naturals
  (lambda (n_0)
    (if (if (integer? n_0) (if (exact? n_0) (>= n_0 0) #f) #f)
      (void)
      (raise-argument-error$1 'in-naturals "exact-nonnegative-integer?" n_0))))
(define-values
 (struct:list-stream
  make-list-stream
  list-stream?
  list-stream-ref
  list-stream-set!)
 (make-struct-type
  'stream
  #f
  1
  0
  #f
  (list
   (cons
    prop:stream
    (vector
     (lambda (v_0) (not (pair? (|#%app| list-stream-ref v_0 0))))
     (lambda (v_0) (car (|#%app| list-stream-ref v_0 0)))
     (lambda (v_0) (make-list-stream (cdr (|#%app| list-stream-ref v_0 0))))))
   (cons
    prop:gen-sequence
    (lambda (v_0)
      (values car cdr values (|#%app| list-stream-ref v_0 0) pair? #f #f))))))
(define check-list
  (lambda (l_0)
    (if (list? l_0) (void) (raise-argument-error$1 'in-list "list?" l_0))))
(define check-in-hash
  (lambda (ht_0)
    (if (hash? ht_0) (void) (raise-argument-error$1 'in-hash "hash?" ht_0))))
(define check-in-hash-keys
  (lambda (ht_0)
    (if (hash? ht_0)
      (void)
      (raise-argument-error$1 'in-hash-keys "hash?" ht_0))))
(define check-ranges
  (lambda (who_0 type-name_0 vec_0 start_0 stop_0 step_0 len_0)
    (begin
      (if (exact-nonnegative-integer? start_0)
        (void)
        (raise-argument-error$1 who_0 "exact-nonnegative-integer?" start_0))
      (if (let ((or-part_0 (< start_0 len_0)))
            (if or-part_0 or-part_0 (= len_0 start_0 stop_0)))
        (void)
        (1/raise-range-error
         who_0
         type-name_0
         "starting "
         start_0
         vec_0
         0
         (sub1 len_0)))
      (if (exact-integer? stop_0)
        (void)
        (raise-argument-error$1 who_0 "exact-integer?" stop_0))
      (if (if (<= -1 stop_0) (<= stop_0 len_0) #f)
        (void)
        (1/raise-range-error
         who_0
         type-name_0
         "stopping "
         stop_0
         vec_0
         -1
         len_0))
      (if (if (exact-integer? step_0) (not (zero? step_0)) #f)
        (void)
        (raise-argument-error$1
         who_0
         "(and/c exact-integer? (not/c zero?))"
         step_0))
      (if (if (< start_0 stop_0) (< step_0 0) #f)
        (1/raise-arguments-error
         who_0
         "starting index less than stopping index, but given a negative step"
         "starting index"
         start_0
         "stopping index"
         stop_0
         "step"
         step_0)
        (void))
      (if (if (< stop_0 start_0) (> step_0 0) #f)
        (1/raise-arguments-error
         who_0
         "starting index more than stopping index, but given a positive step"
         "starting index"
         start_0
         "stopping index"
         stop_0
         "step"
         step_0)
        (void)))))
(define normalise-inputs
  (lambda (who_0
           type-name_0
           vector?_0
           unsafe-vector-length_0
           vec_0
           start_0
           stop_0
           step_0)
    (begin
      (if (|#%app| vector?_0 vec_0)
        (void)
        (raise-argument-error$1 who_0 (string-append type-name_0 "?") vec_0))
      (let ((len_0 (|#%app| unsafe-vector-length_0 vec_0)))
        (let ((stop*_0 (if stop_0 stop_0 len_0)))
          (begin
            (check-ranges who_0 type-name_0 vec_0 start_0 stop*_0 step_0 len_0)
            (values vec_0 start_0 stop*_0 step_0)))))))
(define unsafe-normalise-inputs
  (lambda (unsafe-vector-length_0 vec_0 start_0 stop_0 step_0)
    (values
     vec_0
     start_0
     (if stop_0 stop_0 (|#%app| unsafe-vector-length_0 vec_0))
     step_0)))
(define check-vector
  (lambda (v_0)
    (if (vector? v_0)
      (void)
      (raise-argument-error$1 'in-vector (string-append "vector" "?") v_0))))
(define check-string
  (lambda (v_0)
    (if (string? v_0)
      (void)
      (raise-argument-error$1 'in-string (string-append "string" "?") v_0))))
(define check-bytes
  (lambda (v_0)
    (if (bytes? v_0)
      (void)
      (raise-argument-error$1 'in-bytes (string-append "bytes" "?") v_0))))
(define-values
 (struct:do-stream make-do-stream do-stream? do-stream-ref do-stream-set!)
 (make-struct-type
  'stream
  #f
  3
  0
  #f
  (list
   (cons
    prop:stream
    (vector
     (lambda (v_0) (|#%app| (|#%app| do-stream-ref v_0 0)))
     (lambda (v_0) (|#%app| (|#%app| do-stream-ref v_0 1)))
     (lambda (v_0) (|#%app| (|#%app| do-stream-ref v_0 2))))))))
(define empty-stream (make-do-stream (lambda () #t) void void))
(define map_2353
  (|#%name|
   map
   (case-lambda
    ((f_0 l_0)
     (letrec*
      ((loop_0
        (|#%name|
         loop
         (lambda (l_1)
           (if (null? l_1)
             null
             (let ((r_0 (cdr l_1)))
               (let ((app_0 (|#%app| f_0 (car l_1))))
                 (cons app_0 (loop_0 r_0)))))))))
      (loop_0 l_0)))
    ((f_0 l1_0 l2_0)
     (letrec*
      ((loop_0
        (|#%name|
         loop
         (lambda (l1_1 l2_1)
           (if (null? l1_1)
             null
             (let ((r1_0 (cdr l1_1)))
               (let ((r2_0 (cdr l2_1)))
                 (let ((r1_1 r1_0))
                   (let ((app_0
                          (let ((app_0 (car l1_1)))
                            (|#%app| f_0 app_0 (car l2_1)))))
                     (cons app_0 (loop_0 r1_1 r2_0)))))))))))
      (loop_0 l1_0 l2_0)))
    ((f_0 l_0 . args_0) (gen-map f_0 (cons l_0 args_0))))))
(define andmap_2814
  (|#%name|
   andmap
   (case-lambda
    ((f_0 l_0)
     (if (null? l_0)
       #t
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda (l_1)
             (if (null? (cdr l_1))
               (|#%app| f_0 (car l_1))
               (let ((r_0 (cdr l_1)))
                 (if (|#%app| f_0 (car l_1)) (loop_0 r_0) #f)))))))
        (loop_0 l_0))))
    ((f_0 l1_0 l2_0)
     (if (null? l1_0)
       #t
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda (l1_1 l2_1)
             (if (null? (cdr l1_1))
               (let ((app_0 (car l1_1))) (|#%app| f_0 app_0 (car l2_1)))
               (let ((r1_0 (cdr l1_1)))
                 (let ((r2_0 (cdr l2_1)))
                   (let ((r1_1 r1_0))
                     (if (let ((app_0 (car l1_1)))
                           (|#%app| f_0 app_0 (car l2_1)))
                       (loop_0 r1_1 r2_0)
                       #f)))))))))
        (loop_0 l1_0 l2_0))))
    ((f_0 l_0 . args_0) (gen-andmap f_0 (cons l_0 args_0))))))
(define check-args
  (lambda (who_0 f_0 ls_0)
    (begin
      (if (procedure? f_0)
        (void)
        (raise-argument-error who_0 "procedure?" f_0))
      (letrec*
       ((loop_0
         (|#%name|
          loop
          (lambda (prev-len_0 ls_1 i_0)
            (if (null? ls_1)
              (void)
              (let ((l_0 (car ls_1)))
                (begin
                  (if (list? l_0)
                    (void)
                    (raise-argument-error who_0 "list?" l_0))
                  (let ((len_0 (length l_0)))
                    (begin
                      (if (if prev-len_0 (not (= len_0 prev-len_0)) #f)
                        (raise-arguments-error
                         who_0
                         "all lists must have same size"
                         "first list length"
                         prev-len_0
                         "other list length"
                         len_0
                         "procedure"
                         f_0)
                        (void))
                      (let ((app_0 (cdr ls_1)))
                        (loop_0 len_0 app_0 (add1 i_0))))))))))))
       (loop_0 #f ls_0 1))
      (if (procedure-arity-includes? f_0 (length ls_0))
        (void)
        (call-with-values
         (lambda () (procedure-keywords f_0))
         (lambda (required-keywords_0 optional-keywords_0)
           (let ((app_0
                  (if (pair? required-keywords_0)
                    (string-append
                     "argument mismatch;\n"
                     " the given procedure expects keyword arguments")
                    (string-append
                     "argument mismatch;\n"
                     " the given procedure's expected number of arguments does not match"
                     " the given number of lists"))))
             (let ((app_1
                    (unquoted-printing-string
                     (let ((or-part_0
                            (let ((n_0 (object-name f_0)))
                              (if (symbol? n_0) (symbol->string n_0) #f))))
                       (if or-part_0 or-part_0 "#<procedure>")))))
               (apply
                raise-arguments-error
                who_0
                app_0
                "given procedure"
                app_1
                (let ((app_2
                       (let ((a_0 (procedure-arity f_0)))
                         (if (pair? required-keywords_0)
                           null
                           (if (integer? a_0)
                             (list "expected" a_0)
                             (if (arity-at-least? a_0)
                               (list
                                "expected"
                                (unquoted-printing-string
                                 (string-append
                                  "at least "
                                  (number->string
                                   (arity-at-least-value a_0)))))
                               null))))))
                  (let ((app_3
                         (if (pair? required-keywords_0)
                           null
                           (list "given" (length ls_0)))))
                    (let ((app_4
                           (if (pair? required-keywords_0)
                             (list
                              "required keywords"
                              (unquoted-printing-string
                               (apply
                                string-append
                                (cdr
                                 (letrec*
                                  ((loop_0
                                    (|#%name|
                                     loop
                                     (lambda (kws_0)
                                       (if (null? kws_0)
                                         null
                                         (let ((app_4
                                                (string-append
                                                 "#:"
                                                 (keyword->string
                                                  (car kws_0)))))
                                           (list*
                                            " "
                                            app_4
                                            (loop_0 (cdr kws_0)))))))))
                                  (loop_0 required-keywords_0))))))
                             null)))
                      (append
                       app_2
                       app_3
                       app_4
                       (let ((w_0
                              (let ((app_5 (error-print-width)))
                                (quotient app_5 (length ls_0)))))
                         (if (> w_0 10)
                           (list
                            "argument lists..."
                            (unquoted-printing-string
                             (apply
                              string-append
                              (letrec*
                               ((loop_0
                                 (|#%name|
                                  loop
                                  (lambda (ls_1)
                                    (if (null? ls_1)
                                      null
                                      (let ((app_5
                                             (string-append
                                              "\n   "
                                              (let ((app_5
                                                     (error-value->string-handler)))
                                                (|#%app|
                                                 app_5
                                                 (car ls_1)
                                                 w_0)))))
                                        (cons app_5 (loop_0 (cdr ls_1)))))))))
                               (loop_0 ls_0)))))
                           null)))))))))))))))
(define gen-map
  (lambda (f_0 ls_0)
    (begin
      #t
      (letrec*
       ((loop_0
         (|#%name|
          loop
          (lambda (ls_1)
            (if (null? (car ls_1))
              null
              (let ((next-ls_0 (map_2353 cdr ls_1)))
                (let ((app_0 (apply f_0 (map_2353 car ls_1))))
                  (cons app_0 (loop_0 next-ls_0)))))))))
       (loop_0 ls_0)))))
(define gen-andmap
  (lambda (f_0 ls_0)
    (begin
      #t
      (letrec*
       ((loop_0
         (|#%name|
          loop
          (lambda (ls_1)
            (if (null? (car ls_1))
              #t
              (if (null? (cdar ls_1))
                (apply f_0 (map_2353 car ls_1))
                (let ((next-ls_0 (map_2353 cdr ls_1)))
                  (if (apply f_0 (map_2353 car ls_1))
                    (loop_0 next-ls_0)
                    #f))))))))
       (loop_0 ls_0)))))
(define hash-keys
  (let ((hash-keys_0
         (|#%name|
          hash-keys
          (lambda (h_0 try-order?_0)
            (if try-order?_0
              (hash-map h_0 (lambda (k_0 v_0) k_0) #t)
              (letrec*
               ((loop_0
                 (|#%name|
                  loop
                  (lambda (pos_0)
                    (if pos_0
                      (let ((k_0
                             (hash-iterate-key h_0 pos_0 unsafe-undefined)))
                        (let ((r_0 (loop_0 (hash-iterate-next h_0 pos_0))))
                          (let ((k_1 k_0))
                            (if (eq? k_1 unsafe-undefined)
                              r_0
                              (cons k_1 r_0)))))
                      null)))))
               (loop_0 (hash-iterate-first h_0))))))))
    (|#%name|
     hash-keys
     (case-lambda
      ((h_0)
       (begin
         (if (hash? h_0)
           (void)
           (raise-argument-error 'hash-keys "hash?" 0 h_0))
         (hash-keys_0 h_0 #f)))
      ((h_0 try-order?_0)
       (begin
         (if (hash? h_0)
           (void)
           (raise-argument-error 'hash-keys "hash?" 0 h_0 try-order?_0))
         (hash-keys_0 h_0 try-order?_0)))))))
(define hash-values
  (let ((hash-values_0
         (|#%name|
          hash-values
          (lambda (h_0 try-order?_0)
            (hash-map h_0 (lambda (k_0 v_0) v_0) try-order?_0)))))
    (|#%name|
     hash-values
     (case-lambda
      ((h_0)
       (begin
         (if (hash? h_0)
           (void)
           (raise-argument-error 'hash-values "hash?" 0 h_0))
         (hash-values_0 h_0 #f)))
      ((h_0 try-order?_0)
       (begin
         (if (hash? h_0)
           (void)
           (raise-argument-error 'hash-values "hash?" 0 h_0 try-order?_0))
         (hash-values_0 h_0 try-order?_0)))))))
(define sort.1
  (|#%name|
   sort
   (lambda (cache-keys?2_0 key1_0 lst5_0 less?6_0)
     (begin
       (if (list? lst5_0) (void) (raise-argument-error 'sort "list?" lst5_0))
       (if (if (procedure? less?6_0) (procedure-arity-includes? less?6_0 2) #f)
         (void)
         (raise-argument-error 'sort "(any/c any/c . -> . any/c)" less?6_0))
       (if (if key1_0
             (not
              (if (procedure? key1_0) (procedure-arity-includes? key1_0 1) #f))
             #f)
         (raise-argument-error 'sort "(any/c . -> . any/c)" key1_0)
         (void))
       (if key1_0
         (|#%app| sort lst5_0 less?6_0 key1_0 cache-keys?2_0)
         (|#%app| sort lst5_0 less?6_0))))))
(define do-remove
  (lambda (who_0 item_0 list_0 equal?_0)
    (begin
      (if (list? list_0) (void) (raise-argument-error who_0 "list?" list_0))
      (letrec*
       ((loop_0
         (|#%name|
          loop
          (lambda (list_1)
            (if (null? list_1)
              list_1
              (if (|#%app| equal?_0 item_0 (car list_1))
                (cdr list_1)
                (let ((next_0 (loop_0 (cdr list_1))))
                  (if (eq? next_0 (cdr list_1))
                    list_1
                    (cons (car list_1) next_0)))))))))
       (loop_0 list_0)))))
(define remq (lambda (item_0 list_0) (do-remove 'remq item_0 list_0 eq?)))
(define print-value-columns
  (make-parameter
   +inf.0
   (lambda (c_0)
     (if (let ((or-part_0 (eqv? c_0 +inf.0)))
           (if or-part_0 or-part_0 (if (exact-integer? c_0) (> c_0 5) #f)))
       c_0
       (raise-argument-error
        'print-value-columns
        "(or/c +inf.0 (and/c exact-integer? (>/c 5)))"
        c_0)))
   'print-value-columns))
(define internal-error
  (lambda (msg_0)
    (raise
     (let ((app_0 (string-append "internal error: " msg_0)))
       (|#%app| exn:fail app_0 (current-continuation-marks))))))
(define effect_2501
  (begin
    (void
     (if (primitive-table '|#%pthread|)
       (void)
       (internal-error "pthreads not provided by host")))
    (void)))
(define 1/unsafe-make-place-local unsafe-make-place-local)
(define unsafe-place-local-ref$1 unsafe-place-local-ref)
(define 1/unsafe-place-local-set! unsafe-place-local-set!)
(define 1/unsafe-add-global-finalizer unsafe-add-global-finalizer)
(define 1/malloc-immobile-cell malloc-immobile-cell)
(define 1/free-immobile-cell free-immobile-cell)
(define finish_1970
  (make-struct-type-install-properties
   '(sandman)
   11
   0
   #f
   null
   'prefab
   #f
   '(0 1 2 3 4 5 6 7 8 9 10)
   #f
   'sandman))
(define struct:sandman
  (make-record-type-descriptor
   'sandman
   #f
   (structure-type-lookup-prefab-uid
    'sandman
    #f
    11
    0
    #f
    '(0 1 2 3 4 5 6 7 8 9 10))
   #f
   #f
   '(11 . 2047)))
(define effect_2951 (finish_1970 struct:sandman))
(define sandman1.1
  (|#%name|
   sandman
   (record-constructor
    (make-record-constructor-descriptor struct:sandman #f #f))))
(define sandman?_2599 (|#%name| sandman? (record-predicate struct:sandman)))
(define sandman?
  (|#%name|
   sandman?
   (lambda (v)
     (if (sandman?_2599 v)
       #t
       ($value
        (if (impersonator? v) (sandman?_2599 (impersonator-val v)) #f))))))
(define sandman-do-sleep_2487
  (|#%name| sandman-do-sleep (record-accessor struct:sandman 0)))
(define sandman-do-sleep
  (|#%name|
   sandman-do-sleep
   (lambda (s)
     (if (sandman?_2599 s)
       (sandman-do-sleep_2487 s)
       ($value
        (impersonate-ref
         sandman-do-sleep_2487
         struct:sandman
         0
         s
         'do-sleep))))))
(define sandman-do-poll_2411
  (|#%name| sandman-do-poll (record-accessor struct:sandman 1)))
(define sandman-do-poll
  (|#%name|
   sandman-do-poll
   (lambda (s)
     (if (sandman?_2599 s)
       (sandman-do-poll_2411 s)
       ($value
        (impersonate-ref sandman-do-poll_2411 struct:sandman 1 s 'do-poll))))))
(define sandman-do-get-wakeup_3028
  (|#%name| sandman-do-get-wakeup (record-accessor struct:sandman 2)))
(define sandman-do-get-wakeup
  (|#%name|
   sandman-do-get-wakeup
   (lambda (s)
     (if (sandman?_2599 s)
       (sandman-do-get-wakeup_3028 s)
       ($value
        (impersonate-ref
         sandman-do-get-wakeup_3028
         struct:sandman
         2
         s
         'do-get-wakeup))))))
(define sandman-do-wakeup_2562
  (|#%name| sandman-do-wakeup (record-accessor struct:sandman 3)))
(define sandman-do-wakeup
  (|#%name|
   sandman-do-wakeup
   (lambda (s)
     (if (sandman?_2599 s)
       (sandman-do-wakeup_2562 s)
       ($value
        (impersonate-ref
         sandman-do-wakeup_2562
         struct:sandman
         3
         s
         'do-wakeup))))))
(define sandman-do-any-sleepers?_2376
  (|#%name| sandman-do-any-sleepers? (record-accessor struct:sandman 4)))
(define sandman-do-any-sleepers?
  (|#%name|
   sandman-do-any-sleepers?
   (lambda (s)
     (if (sandman?_2599 s)
       (sandman-do-any-sleepers?_2376 s)
       ($value
        (impersonate-ref
         sandman-do-any-sleepers?_2376
         struct:sandman
         4
         s
         'do-any-sleepers?))))))
(define sandman-do-sleepers-external-events_2747
  (|#%name|
   sandman-do-sleepers-external-events
   (record-accessor struct:sandman 5)))
(define sandman-do-sleepers-external-events
  (|#%name|
   sandman-do-sleepers-external-events
   (lambda (s)
     (if (sandman?_2599 s)
       (sandman-do-sleepers-external-events_2747 s)
       ($value
        (impersonate-ref
         sandman-do-sleepers-external-events_2747
         struct:sandman
         5
         s
         'do-sleepers-external-events))))))
(define sandman-do-add-thread!_3210
  (|#%name| sandman-do-add-thread! (record-accessor struct:sandman 6)))
(define sandman-do-add-thread!
  (|#%name|
   sandman-do-add-thread!
   (lambda (s)
     (if (sandman?_2599 s)
       (sandman-do-add-thread!_3210 s)
       ($value
        (impersonate-ref
         sandman-do-add-thread!_3210
         struct:sandman
         6
         s
         'do-add-thread!))))))
(define sandman-do-remove-thread!_2183
  (|#%name| sandman-do-remove-thread! (record-accessor struct:sandman 7)))
(define sandman-do-remove-thread!
  (|#%name|
   sandman-do-remove-thread!
   (lambda (s)
     (if (sandman?_2599 s)
       (sandman-do-remove-thread!_2183 s)
       ($value
        (impersonate-ref
         sandman-do-remove-thread!_2183
         struct:sandman
         7
         s
         'do-remove-thread!))))))
(define sandman-do-merge-external-event-sets_2575
  (|#%name|
   sandman-do-merge-external-event-sets
   (record-accessor struct:sandman 8)))
(define sandman-do-merge-external-event-sets
  (|#%name|
   sandman-do-merge-external-event-sets
   (lambda (s)
     (if (sandman?_2599 s)
       (sandman-do-merge-external-event-sets_2575 s)
       ($value
        (impersonate-ref
         sandman-do-merge-external-event-sets_2575
         struct:sandman
         8
         s
         'do-merge-external-event-sets))))))
(define sandman-do-merge-timeout_2100
  (|#%name| sandman-do-merge-timeout (record-accessor struct:sandman 9)))
(define sandman-do-merge-timeout
  (|#%name|
   sandman-do-merge-timeout
   (lambda (s)
     (if (sandman?_2599 s)
       (sandman-do-merge-timeout_2100 s)
       ($value
        (impersonate-ref
         sandman-do-merge-timeout_2100
         struct:sandman
         9
         s
         'do-merge-timeout))))))
(define sandman-do-extract-timeout_2311
  (|#%name| sandman-do-extract-timeout (record-accessor struct:sandman 10)))
(define sandman-do-extract-timeout
  (|#%name|
   sandman-do-extract-timeout
   (lambda (s)
     (if (sandman?_2599 s)
       (sandman-do-extract-timeout_2311 s)
       ($value
        (impersonate-ref
         sandman-do-extract-timeout_2311
         struct:sandman
         10
         s
         'do-extract-timeout))))))
(define table
  (let ((or-part_0 (primitive-table '|#%thread|)))
    (if or-part_0
      or-part_0
      (error '|#%thread| "scheduler cooperation not supported by host"))))
(define 1/thread thread)
(define 1/thread-suspend-evt thread-suspend-evt)
(define 1/thread-dead-evt thread-dead-evt)
(define 1/current-thread current-thread)
(define 1/thread-resume thread-resume)
(define 1/make-semaphore make-semaphore)
(define 1/semaphore-post semaphore-post)
(define 1/semaphore-wait semaphore-wait)
(define 1/semaphore-peek-evt semaphore-peek-evt)
(define 1/make-channel make-channel)
(define 1/channel-put-evt channel-put-evt)
(define 1/wrap-evt wrap-evt)
(define 1/handle-evt handle-evt)
(define 1/always-evt always-evt)
(define 1/sync sync)
(define 1/sync/timeout sync/timeout)
(define 1/evt? evt?)
(define 1/prop:evt prop:evt)
(define 1/unsafe-start-atomic unsafe-start-atomic)
(define 1/unsafe-end-atomic unsafe-end-atomic)
(define 1/current-custodian current-custodian)
(define 1/custodian-shut-down? custodian-shut-down?)
(define 1/current-plumber current-plumber)
(define 1/plumber-add-flush! plumber-add-flush!)
(define 1/plumber-flush-handle-remove! plumber-flush-handle-remove!)
(define 1/choice-evt (hash-ref table 'choice-evt))
(define prop:secondary-evt (hash-ref table 'prop:secondary-evt))
(define sync-atomic-poll-evt? (hash-ref table 'sync-atomic-poll-evt?))
(define poller (hash-ref table 'poller))
(define poller-evt (hash-ref table 'poller-evt))
(define poll-ctx-poll? (hash-ref table 'poll-ctx-poll?))
(define poll-ctx-select-proc (hash-ref table 'poll-ctx-select-proc))
(define poll-ctx-sched-info (hash-ref table 'poll-ctx-sched-info))
(define set-poll-ctx-incomplete?! (hash-ref table 'set-poll-ctx-incomplete?!))
(define schedule-info-did-work! (hash-ref table 'schedule-info-did-work!))
(define control-state-evt (hash-ref table 'control-state-evt))
(define async-evt (hash-ref table 'async-evt))
(define schedule-info-current-exts
  (hash-ref table 'schedule-info-current-exts))
(define current-sandman (hash-ref table 'current-sandman))
(define start-atomic/no-interrupts
  (hash-ref table 'start-atomic/no-interrupts))
(define end-atomic/no-interrupts (hash-ref table 'end-atomic/no-interrupts))
(define in-atomic-mode? (hash-ref table 'in-atomic-mode?))
(define 1/unsafe-custodian-register
  (hash-ref table 'unsafe-custodian-register))
(define 1/unsafe-custodian-unregister
  (hash-ref table 'unsafe-custodian-unregister))
(define 1/unsafe-make-custodian-at-root
  (hash-ref table 'unsafe-make-custodian-at-root))
(define thread-push-kill-callback!
  (hash-ref table 'thread-push-kill-callback!))
(define thread-pop-kill-callback! (hash-ref table 'thread-pop-kill-callback!))
(define unsafe-add-pre-poll-callback!
  (hash-ref table 'unsafe-add-pre-poll-callback!))
(define set-get-subprocesses-time!
  (hash-ref table 'set-get-subprocesses-time!))
(define start-atomic unsafe-start-atomic)
(define end-atomic unsafe-end-atomic)
(define assert-atomic (lambda () (void)))
(define check-current-custodian
  (lambda (who_0)
    (if (custodian-shut-down? (current-custodian))
      (begin
        (unsafe-end-atomic)
        (raise
         (let ((app_0
                (string-append
                 (symbol->string who_0)
                 ": the current custodian has been shut down")))
           (|#%app| exn:fail app_0 (current-continuation-marks)))))
      (void))))
(define rktio-table
  (let ((or-part_0 (primitive-table '|#%rktio|)))
    (if or-part_0 or-part_0 (error '|#%rktio| "rktio not supported by host"))))
(define lookup (lambda (n_0) (hash-ref rktio-table n_0)))
(define << arithmetic-shift)
(define RKTIO_OPEN_READ 1)
(define RKTIO_OPEN_WRITE 2)
(define RKTIO_OPEN_TEXT 4)
(define RKTIO_OPEN_TRUNCATE 8)
(define RKTIO_OPEN_APPEND 16)
(define RKTIO_OPEN_MUST_EXIST 32)
(define RKTIO_OPEN_CAN_EXIST 64)
(define RKTIO_OPEN_SOCKET 128)
(define RKTIO_OPEN_UDP 256)
(define RKTIO_OPEN_REGFILE 512)
(define RKTIO_OPEN_NOT_REGFILE 1024)
(define RKTIO_OPEN_DIR 2048)
(define RKTIO_OPEN_NOT_DIR 4096)
(define RKTIO_OPEN_INIT 8192)
(define RKTIO_OPEN_OWN 16384)
(define RKTIO_OPEN_REPLACE_PERMS 32768)
(define RKTIO_STDIN 0)
(define RKTIO_STDOUT 1)
(define RKTIO_STDERR 2)
(define RKTIO_READ_EOF -1)
(define RKTIO_POLL_NOT_READY 0)
(define RKTIO_POLL_READY 1)
(define RKTIO_LOCK_ACQUIRED 1)
(define RKTIO_POSITION_FROM_START 0)
(define RKTIO_POSITION_FROM_END 1)
(define RKTIO_NO_INHERIT_INPUT 1)
(define RKTIO_NO_INHERIT_OUTPUT 2)
(define RKTIO_FAMILY_ANY -1)
(define RKTIO_SHUTDOWN_READ 0)
(define RKTIO_SHUTDOWN_WRITE 1)
(define RKTIO_ADD_MEMBERSHIP 0)
(define RKTIO_DROP_MEMBERSHIP 1)
(define RKTIO_PROCESS_NEW_GROUP 1)
(define RKTIO_PROCESS_STDOUT_AS_STDERR 2)
(define RKTIO_PROCESS_WINDOWS_EXACT_CMDLINE 4)
(define RKTIO_PROCESS_WINDOWS_CHAIN_TERMINATION 8)
(define RKTIO_PROCESS_NO_CLOSE_FDS 16)
(define RKTIO_PROCESS_NO_INHERIT_FDS 32)
(define RKTIO_FS_CHANGE_SUPPORTED 1)
(define RKTIO_FS_CHANGE_SCALABLE 2)
(define RKTIO_FS_CHANGE_LOW_LATENCY 4)
(define RKTIO_FS_CHANGE_FILE_LEVEL 8)
(define RKTIO_FS_CHANGE_NEED_LTPS 16)
(define RKTIO_POLL_READ 1)
(define RKTIO_POLL_WRITE 2)
(define RKTIO_POLL_FLUSH 8)
(define RKTIO_LTPS_CREATE_READ 1)
(define RKTIO_LTPS_CREATE_WRITE 2)
(define RKTIO_LTPS_CHECK_READ 3)
(define RKTIO_LTPS_CHECK_WRITE 4)
(define RKTIO_LTPS_REMOVE 5)
(define RKTIO_FILE_TYPE_FILE 1)
(define RKTIO_FILE_TYPE_DIRECTORY 2)
(define RKTIO_FILE_TYPE_LINK 3)
(define RKTIO_FILE_TYPE_DIRECTORY_LINK 4)
(define RKTIO_DEFAULT_DIRECTORY_PERM_BITS 511)
(define RKTIO_PERMISSION_READ 4)
(define RKTIO_PERMISSION_WRITE 2)
(define RKTIO_PERMISSION_EXEC 1)
(define RKTIO_COPY_STEP_OPEN_SRC 1)
(define RKTIO_COPY_STEP_OPEN_DEST 2)
(define RKTIO_COPY_STEP_READ_SRC_DATA 3)
(define RKTIO_COPY_STEP_WRITE_DEST_DATA 4)
(define RKTIO_COPY_STEP_READ_SRC_METADATA 5)
(define RKTIO_COPY_STEP_WRITE_DEST_METADATA 6)
(define RKTIO_PATH_SYS_DIR 0)
(define RKTIO_PATH_TEMP_DIR 1)
(define RKTIO_PATH_PREF_DIR 2)
(define RKTIO_PATH_PREF_FILE 3)
(define RKTIO_PATH_ADDON_DIR 4)
(define RKTIO_PATH_HOME_DIR 5)
(define RKTIO_PATH_DESK_DIR 6)
(define RKTIO_PATH_DOC_DIR 7)
(define RKTIO_PATH_INIT_DIR 8)
(define RKTIO_PATH_INIT_FILE 9)
(define RKTIO_PATH_CACHE_DIR 10)
(define RKTIO_OS_SIGNAL_NONE -1)
(define RKTIO_OS_SIGNAL_TERM 1)
(define RKTIO_OS_SIGNAL_HUP 2)
(define RKTIO_SW_HIDE 0)
(define RKTIO_SW_MAXIMIZE 1)
(define RKTIO_SW_MINIMIZE 2)
(define RKTIO_SW_RESTORE 3)
(define RKTIO_SW_SHOW 4)
(define RKTIO_SW_SHOWDEFAULT 5)
(define RKTIO_SW_SHOWMAXIMIZED 6)
(define RKTIO_SW_SHOWMINIMIZED 7)
(define RKTIO_SW_SHOWMINNOACTIVE 8)
(define RKTIO_SW_SHOWNA 9)
(define RKTIO_SW_SHOWNOACTIVATE 10)
(define RKTIO_SW_SHOWNORMAL 11)
(define RKTIO_LOG_FATAL 1)
(define RKTIO_LOG_ERROR 2)
(define RKTIO_LOG_WARNING 3)
(define RKTIO_LOG_INFO 4)
(define RKTIO_LOG_DEBUG 5)
(define RKTIO_CONVERTER_SUPPORTED 1)
(define RKTIO_CONVERT_STRCOLL_UTF_2901 2)
(define RKTIO_CONVERT_RECASE_UTF_2265 4)
(define RKTIO_CONVERT_ERROR -1)
(define RKTIO_SHA1_DIGEST_SIZE 20)
(define RKTIO_SHA224_DIGEST_SIZE 28)
(define RKTIO_SHA256_DIGEST_SIZE 32)
(define RKTIO_ERROR_KIND_POSIX 0)
(define RKTIO_ERROR_KIND_WINDOWS 1)
(define RKTIO_ERROR_KIND_GAI 2)
(define RKTIO_ERROR_KIND_RACKET 3)
(define RKTIO_ERROR_UNSUPPORTED 1)
(define RKTIO_ERROR_EXISTS 4)
(define RKTIO_ERROR_ACCESS_DENIED 5)
(define RKTIO_ERROR_IS_A_DIRECTORY 9)
(define RKTIO_ERROR_CONNECT_TRYING_NEXT 19)
(define RKTIO_ERROR_INFO_TRY_AGAIN 22)
(define RKTIO_ERROR_TRY_AGAIN 23)
(define RKTIO_ERROR_TRY_AGAIN_WITH_IPV_2541 24)
(define RKTIO_ERROR_TIME_OUT_OF_RANGE 25)
(define RKTIO_ERROR_CONVERT_NOT_ENOUGH_SPACE 28)
(define RKTIO_ERROR_CONVERT_BAD_SEQUENCE 29)
(define RKTIO_ERROR_CONVERT_PREMATURE_END 30)
(define RKTIO_ERROR_CONVERT_OTHER 31)
(define rktio_init (hash-ref rktio-table 'rktio_init))
(define rktio_destroy (hash-ref rktio-table 'rktio_destroy))
(define rktio_free (hash-ref rktio-table 'rktio_free))
(define rktio_set_dll_path (hash-ref rktio-table 'rktio_set_dll_path))
(define rktio_get_dll_path (hash-ref rktio-table 'rktio_get_dll_path))
(define rktio_system_fd (hash-ref rktio-table 'rktio_system_fd))
(define rktio_fd_system_fd (hash-ref rktio-table 'rktio_fd_system_fd))
(define rktio_fd_is_regular_file
  (hash-ref rktio-table 'rktio_fd_is_regular_file))
(define rktio_fd_is_directory (hash-ref rktio-table 'rktio_fd_is_directory))
(define rktio_fd_is_socket (hash-ref rktio-table 'rktio_fd_is_socket))
(define rktio_fd_is_udp (hash-ref rktio-table 'rktio_fd_is_udp))
(define rktio_fd_is_terminal (hash-ref rktio-table 'rktio_fd_is_terminal))
(define rktio_fd_is_text_converted
  (hash-ref rktio-table 'rktio_fd_is_text_converted))
(define rktio_fd_is_pending_open
  (hash-ref rktio-table 'rktio_fd_is_pending_open))
(define rktio_fd_modes (hash-ref rktio-table 'rktio_fd_modes))
(define rktio_open (hash-ref rktio-table 'rktio_open))
(define rktio_open_with_create_permissions
  (hash-ref rktio-table 'rktio_open_with_create_permissions))
(define rktio_close (hash-ref rktio-table 'rktio_close))
(define rktio_close_noerr (hash-ref rktio-table 'rktio_close_noerr))
(define rktio_dup (hash-ref rktio-table 'rktio_dup))
(define rktio_forget (hash-ref rktio-table 'rktio_forget))
(define rktio_std_fd (hash-ref rktio-table 'rktio_std_fd))
(define rktio_create_console (hash-ref rktio-table 'rktio_create_console))
(define rktio_read (hash-ref rktio-table 'rktio_read))
(define rktio_write (hash-ref rktio-table 'rktio_write))
(define rktio_read_converted (hash-ref rktio-table 'rktio_read_converted))
(define rktio_read_in (hash-ref rktio-table 'rktio_read_in))
(define rktio_write_in (hash-ref rktio-table 'rktio_write_in))
(define rktio_read_converted_in
  (hash-ref rktio-table 'rktio_read_converted_in))
(define rktio_buffered_byte_count
  (hash-ref rktio-table 'rktio_buffered_byte_count))
(define rktio_poll_read_ready (hash-ref rktio-table 'rktio_poll_read_ready))
(define rktio_poll_write_ready (hash-ref rktio-table 'rktio_poll_write_ready))
(define rktio_poll_write_flushed
  (hash-ref rktio-table 'rktio_poll_write_flushed))
(define rktio_file_lock_try (hash-ref rktio-table 'rktio_file_lock_try))
(define rktio_file_unlock (hash-ref rktio-table 'rktio_file_unlock))
(define rktio_set_file_position
  (hash-ref rktio-table 'rktio_set_file_position))
(define rktio_get_file_position
  (hash-ref rktio-table 'rktio_get_file_position))
(define rktio_set_file_size (hash-ref rktio-table 'rktio_set_file_size))
(define rktio_fd_detach (hash-ref rktio-table 'rktio_fd_detach))
(define rktio_fd_attach (hash-ref rktio-table 'rktio_fd_attach))
(define rktio_fd_close_transfer
  (hash-ref rktio-table 'rktio_fd_close_transfer))
(define rktio_make_pipe (hash-ref rktio-table 'rktio_make_pipe))
(define rktio_start_addrinfo_lookup
  (hash-ref rktio-table 'rktio_start_addrinfo_lookup))
(define rktio_get_ipv4_family (hash-ref rktio-table 'rktio_get_ipv4_family))
(define rktio_poll_addrinfo_lookup_ready
  (hash-ref rktio-table 'rktio_poll_addrinfo_lookup_ready))
(define rktio_addrinfo_lookup_get
  (hash-ref rktio-table 'rktio_addrinfo_lookup_get))
(define rktio_addrinfo_lookup_stop
  (hash-ref rktio-table 'rktio_addrinfo_lookup_stop))
(define rktio_addrinfo_free (hash-ref rktio-table 'rktio_addrinfo_free))
(define rktio_listen (hash-ref rktio-table 'rktio_listen))
(define rktio_listen_stop (hash-ref rktio-table 'rktio_listen_stop))
(define rktio_poll_accept_ready
  (hash-ref rktio-table 'rktio_poll_accept_ready))
(define rktio_accept (hash-ref rktio-table 'rktio_accept))
(define rktio_start_connect (hash-ref rktio-table 'rktio_start_connect))
(define rktio_connect_finish (hash-ref rktio-table 'rktio_connect_finish))
(define rktio_connect_stop (hash-ref rktio-table 'rktio_connect_stop))
(define rktio_poll_connect_ready
  (hash-ref rktio-table 'rktio_poll_connect_ready))
(define rktio_connect_trying (hash-ref rktio-table 'rktio_connect_trying))
(define rktio_socket_shutdown (hash-ref rktio-table 'rktio_socket_shutdown))
(define rktio_tcp_nodelay (hash-ref rktio-table 'rktio_tcp_nodelay))
(define rktio_udp_open (hash-ref rktio-table 'rktio_udp_open))
(define rktio_udp_disconnect (hash-ref rktio-table 'rktio_udp_disconnect))
(define rktio_udp_bind (hash-ref rktio-table 'rktio_udp_bind))
(define rktio_udp_connect (hash-ref rktio-table 'rktio_udp_connect))
(define rktio_udp_sendto (hash-ref rktio-table 'rktio_udp_sendto))
(define rktio_udp_sendto_in (hash-ref rktio-table 'rktio_udp_sendto_in))
(define rktio_udp_recvfrom (hash-ref rktio-table 'rktio_udp_recvfrom))
(define rktio_udp_recvfrom_in (hash-ref rktio-table 'rktio_udp_recvfrom_in))
(define rktio_udp_set_receive_buffer_size
  (hash-ref rktio-table 'rktio_udp_set_receive_buffer_size))
(define rktio_udp_set_ttl (hash-ref rktio-table 'rktio_udp_set_ttl))
(define rktio_udp_get_ttl (hash-ref rktio-table 'rktio_udp_get_ttl))
(define rktio_udp_get_multicast_loopback
  (hash-ref rktio-table 'rktio_udp_get_multicast_loopback))
(define rktio_udp_set_multicast_loopback
  (hash-ref rktio-table 'rktio_udp_set_multicast_loopback))
(define rktio_udp_get_multicast_ttl
  (hash-ref rktio-table 'rktio_udp_get_multicast_ttl))
(define rktio_udp_set_multicast_ttl
  (hash-ref rktio-table 'rktio_udp_set_multicast_ttl))
(define rktio_udp_multicast_interface
  (hash-ref rktio-table 'rktio_udp_multicast_interface))
(define rktio_udp_set_multicast_interface
  (hash-ref rktio-table 'rktio_udp_set_multicast_interface))
(define rktio_udp_change_multicast_group
  (hash-ref rktio-table 'rktio_udp_change_multicast_group))
(define rktio_socket_address (hash-ref rktio-table 'rktio_socket_address))
(define rktio_socket_peer_address
  (hash-ref rktio-table 'rktio_socket_peer_address))
(define rktio_listener_address (hash-ref rktio-table 'rktio_listener_address))
(define rktio_is_ok_envvar_name
  (hash-ref rktio-table 'rktio_is_ok_envvar_name))
(define rktio_are_envvar_names_case_insensitive
  (hash-ref rktio-table 'rktio_are_envvar_names_case_insensitive))
(define rktio_getenv (hash-ref rktio-table 'rktio_getenv))
(define rktio_setenv (hash-ref rktio-table 'rktio_setenv))
(define rktio_envvars (hash-ref rktio-table 'rktio_envvars))
(define rktio_empty_envvars (hash-ref rktio-table 'rktio_empty_envvars))
(define rktio_envvars_copy (hash-ref rktio-table 'rktio_envvars_copy))
(define rktio_envvars_free (hash-ref rktio-table 'rktio_envvars_free))
(define rktio_envvars_get (hash-ref rktio-table 'rktio_envvars_get))
(define rktio_envvars_set (hash-ref rktio-table 'rktio_envvars_set))
(define rktio_envvars_count (hash-ref rktio-table 'rktio_envvars_count))
(define rktio_envvars_name_ref (hash-ref rktio-table 'rktio_envvars_name_ref))
(define rktio_envvars_value_ref
  (hash-ref rktio-table 'rktio_envvars_value_ref))
(define rktio_process (hash-ref rktio-table 'rktio_process))
(define rktio_process_allowed_flags
  (hash-ref rktio-table 'rktio_process_allowed_flags))
(define rktio_process_pid (hash-ref rktio-table 'rktio_process_pid))
(define rktio_process_kill (hash-ref rktio-table 'rktio_process_kill))
(define rktio_process_interrupt
  (hash-ref rktio-table 'rktio_process_interrupt))
(define rktio_process_forget (hash-ref rktio-table 'rktio_process_forget))
(define rktio_poll_process_done
  (hash-ref rktio-table 'rktio_poll_process_done))
(define rktio_process_status (hash-ref rktio-table 'rktio_process_status))
(define rktio_reap_processes (hash-ref rktio-table 'rktio_reap_processes))
(define rktio_fs_change_properties
  (hash-ref rktio-table 'rktio_fs_change_properties))
(define rktio_fs_change (hash-ref rktio-table 'rktio_fs_change))
(define rktio_fs_change_forget (hash-ref rktio-table 'rktio_fs_change_forget))
(define rktio_poll_fs_change_ready
  (hash-ref rktio-table 'rktio_poll_fs_change_ready))
(define rktio_make_poll_set (hash-ref rktio-table 'rktio_make_poll_set))
(define rktio_poll_set_forget (hash-ref rktio-table 'rktio_poll_set_forget))
(define rktio_poll_add (hash-ref rktio-table 'rktio_poll_add))
(define rktio_poll_add_accept (hash-ref rktio-table 'rktio_poll_add_accept))
(define rktio_poll_add_connect (hash-ref rktio-table 'rktio_poll_add_connect))
(define rktio_poll_add_addrinfo_lookup
  (hash-ref rktio-table 'rktio_poll_add_addrinfo_lookup))
(define rktio_poll_add_process (hash-ref rktio-table 'rktio_poll_add_process))
(define rktio_poll_add_fs_change
  (hash-ref rktio-table 'rktio_poll_add_fs_change))
(define rktio_poll_set_add_nosleep
  (hash-ref rktio-table 'rktio_poll_set_add_nosleep))
(define rktio_poll_set_add_handle
  (hash-ref rktio-table 'rktio_poll_set_add_handle))
(define rktio_poll_set_add_eventmask
  (hash-ref rktio-table 'rktio_poll_set_add_eventmask))
(define rkio_reset_sleep_backoff
  (hash-ref rktio-table 'rkio_reset_sleep_backoff))
(define rktio_ltps_open (hash-ref rktio-table 'rktio_ltps_open))
(define rktio_ltps_close (hash-ref rktio-table 'rktio_ltps_close))
(define rktio_ltps_add (hash-ref rktio-table 'rktio_ltps_add))
(define rktio_ltps_handle_set_data
  (hash-ref rktio-table 'rktio_ltps_handle_set_data))
(define rktio_ltps_handle_get_data
  (hash-ref rktio-table 'rktio_ltps_handle_get_data))
(define rktio_ltps_remove_all (hash-ref rktio-table 'rktio_ltps_remove_all))
(define rktio_ltps_poll (hash-ref rktio-table 'rktio_ltps_poll))
(define rktio_ltps_get_signaled_handle
  (hash-ref rktio-table 'rktio_ltps_get_signaled_handle))
(define rktio_ltps_handle_set_auto
  (hash-ref rktio-table 'rktio_ltps_handle_set_auto))
(define rktio_sleep (hash-ref rktio-table 'rktio_sleep))
(define rktio_start_sleep (hash-ref rktio-table 'rktio_start_sleep))
(define rktio_end_sleep (hash-ref rktio-table 'rktio_end_sleep))
(define rktio_file_exists (hash-ref rktio-table 'rktio_file_exists))
(define rktio_directory_exists (hash-ref rktio-table 'rktio_directory_exists))
(define rktio_link_exists (hash-ref rktio-table 'rktio_link_exists))
(define rktio_is_regular_file (hash-ref rktio-table 'rktio_is_regular_file))
(define rktio_file_type (hash-ref rktio-table 'rktio_file_type))
(define rktio_delete_file (hash-ref rktio-table 'rktio_delete_file))
(define rktio_rename_file (hash-ref rktio-table 'rktio_rename_file))
(define rktio_get_current_directory
  (hash-ref rktio-table 'rktio_get_current_directory))
(define rktio_set_current_directory
  (hash-ref rktio-table 'rktio_set_current_directory))
(define rktio_make_directory (hash-ref rktio-table 'rktio_make_directory))
(define rktio_make_directory_with_permissions
  (hash-ref rktio-table 'rktio_make_directory_with_permissions))
(define rktio_delete_directory (hash-ref rktio-table 'rktio_delete_directory))
(define rktio_readlink (hash-ref rktio-table 'rktio_readlink))
(define rktio_make_link (hash-ref rktio-table 'rktio_make_link))
(define rktio_file_size (hash-ref rktio-table 'rktio_file_size))
(define rktio_get_file_modify_seconds
  (hash-ref rktio-table 'rktio_get_file_modify_seconds))
(define rktio_set_file_modify_seconds
  (hash-ref rktio-table 'rktio_set_file_modify_seconds))
(define rktio_file_or_directory_stat
  (hash-ref rktio-table 'rktio_file_or_directory_stat))
(define rktio_fd_stat (hash-ref rktio-table 'rktio_fd_stat))
(define rktio_fd_identity (hash-ref rktio-table 'rktio_fd_identity))
(define rktio_path_identity (hash-ref rktio-table 'rktio_path_identity))
(define rktio_get_file_or_directory_permissions
  (hash-ref rktio-table 'rktio_get_file_or_directory_permissions))
(define rktio_set_file_or_directory_permissions
  (hash-ref rktio-table 'rktio_set_file_or_directory_permissions))
(define rktio_directory_list_start
  (hash-ref rktio-table 'rktio_directory_list_start))
(define rktio_directory_list_step
  (hash-ref rktio-table 'rktio_directory_list_step))
(define rktio_directory_list_stop
  (hash-ref rktio-table 'rktio_directory_list_stop))
(define rktio_filesystem_roots (hash-ref rktio-table 'rktio_filesystem_roots))
(define rktio_copy_file_start (hash-ref rktio-table 'rktio_copy_file_start))
(define rktio_copy_file_start_permissions
  (hash-ref rktio-table 'rktio_copy_file_start_permissions))
(define rktio_copy_file_is_done
  (hash-ref rktio-table 'rktio_copy_file_is_done))
(define rktio_copy_file_step (hash-ref rktio-table 'rktio_copy_file_step))
(define rktio_copy_file_finish_permissions
  (hash-ref rktio-table 'rktio_copy_file_finish_permissions))
(define rktio_copy_file_stop (hash-ref rktio-table 'rktio_copy_file_stop))
(define rktio_system_path (hash-ref rktio-table 'rktio_system_path))
(define rktio_expand_user_tilde
  (hash-ref rktio-table 'rktio_expand_user_tilde))
(define rktio_uname (hash-ref rktio-table 'rktio_uname))
(define rktio_get_signal_handle
  (hash-ref rktio-table 'rktio_get_signal_handle))
(define rktio_signal_received_at
  (hash-ref rktio-table 'rktio_signal_received_at))
(define rktio_signal_received (hash-ref rktio-table 'rktio_signal_received))
(define rktio_wait_until_signal_received
  (hash-ref rktio-table 'rktio_wait_until_signal_received))
(define rktio_flush_signals_received
  (hash-ref rktio-table 'rktio_flush_signals_received))
(define rktio_install_os_signal_handler
  (hash-ref rktio-table 'rktio_install_os_signal_handler))
(define rktio_poll_os_signal (hash-ref rktio-table 'rktio_poll_os_signal))
(define rktio_will_modify_os_signal_handler
  (hash-ref rktio-table 'rktio_will_modify_os_signal_handler))
(define rktio_get_milliseconds (hash-ref rktio-table 'rktio_get_milliseconds))
(define rktio_get_inexact_milliseconds
  (hash-ref rktio-table 'rktio_get_inexact_milliseconds))
(define rktio_get_inexact_monotonic_milliseconds
  (hash-ref rktio-table 'rktio_get_inexact_monotonic_milliseconds))
(define rktio_get_process_milliseconds
  (hash-ref rktio-table 'rktio_get_process_milliseconds))
(define rktio_get_process_children_milliseconds
  (hash-ref rktio-table 'rktio_get_process_children_milliseconds))
(define rktio_get_seconds (hash-ref rktio-table 'rktio_get_seconds))
(define rktio_seconds_to_date (hash-ref rktio-table 'rktio_seconds_to_date))
(define rktio_shell_execute (hash-ref rktio-table 'rktio_shell_execute))
(define rktio_path_to_wide_path
  (hash-ref rktio-table 'rktio_path_to_wide_path))
(define rktio_wide_path_to_path
  (hash-ref rktio-table 'rktio_wide_path_to_path))
(define rktio_processor_count (hash-ref rktio-table 'rktio_processor_count))
(define rktio_syslog (hash-ref rktio-table 'rktio_syslog))
(define rktio_convert_properties
  (hash-ref rktio-table 'rktio_convert_properties))
(define rktio_converter_open (hash-ref rktio-table 'rktio_converter_open))
(define rktio_converter_close (hash-ref rktio-table 'rktio_converter_close))
(define rktio_convert (hash-ref rktio-table 'rktio_convert))
(define rktio_convert_in (hash-ref rktio-table 'rktio_convert_in))
(define rktio_convert_reset (hash-ref rktio-table 'rktio_convert_reset))
(define rktio_locale_recase (hash-ref rktio-table 'rktio_locale_recase))
(define rktio_recase_utf16 (hash-ref rktio-table 'rktio_recase_utf16))
(define rktio_locale_strcoll (hash-ref rktio-table 'rktio_locale_strcoll))
(define rktio_strcoll_utf16 (hash-ref rktio-table 'rktio_strcoll_utf16))
(define rktio_locale_encoding (hash-ref rktio-table 'rktio_locale_encoding))
(define rktio_set_locale (hash-ref rktio-table 'rktio_set_locale))
(define rktio_set_default_locale
  (hash-ref rktio-table 'rktio_set_default_locale))
(define rktio_push_c_numeric_locale
  (hash-ref rktio-table 'rktio_push_c_numeric_locale))
(define rktio_pop_c_numeric_locale
  (hash-ref rktio-table 'rktio_pop_c_numeric_locale))
(define rktio_system_language_country
  (hash-ref rktio-table 'rktio_system_language_country))
(define rktio_sha1_init (hash-ref rktio-table 'rktio_sha1_init))
(define rktio_sha1_update (hash-ref rktio-table 'rktio_sha1_update))
(define rktio_sha1_final (hash-ref rktio-table 'rktio_sha1_final))
(define rktio_sha2_init (hash-ref rktio-table 'rktio_sha2_init))
(define rktio_sha2_update (hash-ref rktio-table 'rktio_sha2_update))
(define rktio_sha2_final (hash-ref rktio-table 'rktio_sha2_final))
(define rktio_dll_open (hash-ref rktio-table 'rktio_dll_open))
(define rktio_dll_find_object (hash-ref rktio-table 'rktio_dll_find_object))
(define rktio_dll_close (hash-ref rktio-table 'rktio_dll_close))
(define rktio_dll_get_error (hash-ref rktio-table 'rktio_dll_get_error))
(define rktio_set_dll_procs (hash-ref rktio-table 'rktio_set_dll_procs))
(define rktio_get_last_error_kind
  (hash-ref rktio-table 'rktio_get_last_error_kind))
(define rktio_get_last_error (hash-ref rktio-table 'rktio_get_last_error))
(define rktio_get_last_error_step
  (hash-ref rktio-table 'rktio_get_last_error_step))
(define rktio_set_last_error (hash-ref rktio-table 'rktio_set_last_error))
(define rktio_set_last_error_step
  (hash-ref rktio-table 'rktio_set_last_error_step))
(define rktio_remap_last_error (hash-ref rktio-table 'rktio_remap_last_error))
(define rktio_get_last_error_string
  (hash-ref rktio-table 'rktio_get_last_error_string))
(define rktio_get_error_string (hash-ref rktio-table 'rktio_get_error_string))
(define rktio_filesize_ref (hash-ref rktio-table 'rktio_filesize_ref))
(define rktio_timestamp_ref (hash-ref rktio-table 'rktio_timestamp_ref))
(define rktio_is_timestamp (hash-ref rktio-table 'rktio_is_timestamp))
(define rktio_recv_length_ref (hash-ref rktio-table 'rktio_recv_length_ref))
(define rktio_recv_address_ref (hash-ref rktio-table 'rktio_recv_address_ref))
(define rktio_stat_to_vector (hash-ref rktio-table 'rktio_stat_to_vector))
(define rktio_identity_to_vector
  (hash-ref rktio-table 'rktio_identity_to_vector))
(define rktio_seconds_to_date* (hash-ref rktio-table 'rktio_seconds_to_date*))
(define rktio_convert_result_to_vector
  (hash-ref rktio-table 'rktio_convert_result_to_vector))
(define rktio_to_bytes (hash-ref rktio-table 'rktio_to_bytes))
(define rktio_to_bytes_list (hash-ref rktio-table 'rktio_to_bytes_list))
(define rktio_to_shorts (hash-ref rktio-table 'rktio_to_shorts))
(define rktio_NULL (hash-ref rktio-table 'rktio_NULL))
(define rktio_do_install_os_signal_handler
  (hash-ref rktio-table 'rktio_do_install_os_signal_handler))
(define rktio_get_ctl_c_handler
  (hash-ref rktio-table 'rktio_get_ctl_c_handler))
(define rktio_from_bytes_list (hash-ref rktio-table 'rktio_from_bytes_list))
(define rktio_free_bytes_list (hash-ref rktio-table 'rktio_free_bytes_list))
(define rktio_make_sha1_ctx (hash-ref rktio-table 'rktio_make_sha1_ctx))
(define rktio_make_sha2_ctx (hash-ref rktio-table 'rktio_make_sha2_ctx))
(define rktio_process_result_stdin_fd
  (hash-ref rktio-table 'rktio_process_result_stdin_fd))
(define rktio_process_result_stdout_fd
  (hash-ref rktio-table 'rktio_process_result_stdout_fd))
(define rktio_process_result_stderr_fd
  (hash-ref rktio-table 'rktio_process_result_stderr_fd))
(define rktio_process_result_process
  (hash-ref rktio-table 'rktio_process_result_process))
(define rktio_status_running (hash-ref rktio-table 'rktio_status_running))
(define rktio_status_result (hash-ref rktio-table 'rktio_status_result))
(define rktio_pipe_results (hash-ref rktio-table 'rktio_pipe_results))
(define rktio-error? vector?)
(define rktio-errkind (lambda (v_0) (vector-ref v_0 0)))
(define rktio-errno (lambda (v_0) (vector-ref v_0 1)))
(define racket-error?
  (lambda (v_0 errno_0)
    (if (eqv? (vector-ref v_0 0) 3) (eqv? (vector-ref v_0 1) errno_0) #f)))
(define cell.1 (unsafe-make-place-local (|#%app| rktio_init)))
(define rktio-place-init!
  (lambda () (unsafe-place-local-set! cell.1 (|#%app| rktio_init))))
(define rktio-place-destroy!
  (lambda ()
    (begin
      (|#%app| rktio_destroy (unsafe-place-local-ref cell.1))
      (unsafe-place-local-set! cell.1 #f))))
(define effect_2397
  (begin
    (void
     (|#%app|
      rktio_do_install_os_signal_handler
      (unsafe-place-local-ref cell.1)))
    (void)))
(define make-ltps
  (lambda ()
    (let ((ltps_0 (|#%app| rktio_ltps_open (unsafe-place-local-ref cell.1))))
      (begin
        (if (vector? ltps_0)
          (void)
          (|#%app|
           1/unsafe-custodian-register
           (current-custodian)
           ltps_0
           (lambda (ltps_1)
             (begin
               (|#%app|
                rktio_ltps_remove_all
                (unsafe-place-local-ref cell.1)
                ltps_1)
               (|#%app|
                rktio_ltps_close
                (unsafe-place-local-ref cell.1)
                ltps_1)
               (shared-ltps-reset!)))
           #f
           #f))
        (if (vector? ltps_0) rktio_NULL ltps_0)))))
(define cell.1$5 (unsafe-make-place-local (make-ltps)))
(define shared-ltps-place-init!
  (lambda () (unsafe-place-local-set! cell.1$5 (make-ltps))))
(define shared-ltps-reset!
  (lambda () (unsafe-place-local-set! cell.1$5 rktio_NULL)))
(define fd-semaphore-update!
  (lambda (fd_0 mode_0)
    (if (eq? (unsafe-place-local-ref cell.1$5) rktio_NULL)
      #f
      (let ((h_0
             (|#%app|
              rktio_ltps_add
              (unsafe-place-local-ref cell.1)
              (unsafe-place-local-ref cell.1$5)
              fd_0
              (if (eq? mode_0 'read)
                1
                (if (eq? mode_0 'write)
                  2
                  (if (eq? mode_0 'check-read)
                    3
                    (if (eq? mode_0 'check-write) 4 5)))))))
        (if (vector? h_0)
          #f
          (let ((ib_0
                 (|#%app|
                  rktio_ltps_handle_get_data
                  (unsafe-place-local-ref cell.1)
                  h_0)))
            (if (not (eq? ib_0 rktio_NULL))
              (|#%app| immobile-cell-ref (|#%app| address->immobile-cell ib_0))
              (let ((s_0 (make-semaphore)))
                (let ((ib_1 (malloc-immobile-cell s_0)))
                  (begin
                    (|#%app|
                     rktio_ltps_handle_set_data
                     (unsafe-place-local-ref cell.1)
                     h_0
                     (|#%app| immobile-cell->address ib_1))
                    s_0))))))))))
(define fd-semaphore-poll-ready?
  (lambda ()
    (if (eq? (unsafe-place-local-ref cell.1$5) rktio_NULL)
      #f
      (begin
        (|#%app|
         rktio_ltps_poll
         (unsafe-place-local-ref cell.1)
         (unsafe-place-local-ref cell.1$5))
        (letrec*
         ((loop_0
           (|#%name|
            loop
            (lambda (did?_0)
              (let ((h_0
                     (|#%app|
                      rktio_ltps_get_signaled_handle
                      (unsafe-place-local-ref cell.1)
                      (unsafe-place-local-ref cell.1$5))))
                (if (vector? h_0)
                  did?_0
                  (let ((ib_0
                         (|#%app|
                          address->immobile-cell
                          (|#%app|
                           rktio_ltps_handle_get_data
                           (unsafe-place-local-ref cell.1)
                           h_0))))
                    (begin
                      (|#%app|
                       semaphore-post-all
                       (|#%app| immobile-cell-ref ib_0))
                      (free-immobile-cell ib_0)
                      (|#%app| rktio_free h_0)
                      (loop_0 #t)))))))))
         (loop_0 #f))))))
(define finish_2882
  (make-struct-type-install-properties
   '(exts)
   2
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1)
   #f
   'exts))
(define struct:exts
  (make-record-type-descriptor
   'exts
   #f
   (|#%nongenerative-uid| exts)
   #f
   #f
   '(2 . 0)))
(define effect_2505 (finish_2882 struct:exts))
(define exts1.1
  (|#%name|
   exts
   (record-constructor
    (make-record-constructor-descriptor struct:exts #f #f))))
(define exts?_3457 (|#%name| exts? (record-predicate struct:exts)))
(define exts?
  (|#%name|
   exts?
   (lambda (v)
     (if (exts?_3457 v)
       #t
       ($value (if (impersonator? v) (exts?_3457 (impersonator-val v)) #f))))))
(define exts-timeout-at_2133
  (|#%name| exts-timeout-at (record-accessor struct:exts 0)))
(define exts-timeout-at
  (|#%name|
   exts-timeout-at
   (lambda (s)
     (if (exts?_3457 s)
       (exts-timeout-at_2133 s)
       ($value
        (impersonate-ref exts-timeout-at_2133 struct:exts 0 s 'timeout-at))))))
(define exts-fd-adders_2889
  (|#%name| exts-fd-adders (record-accessor struct:exts 1)))
(define exts-fd-adders
  (|#%name|
   exts-fd-adders
   (lambda (s)
     (if (exts?_3457 s)
       (exts-fd-adders_2889 s)
       ($value
        (impersonate-ref exts-fd-adders_2889 struct:exts 1 s 'fd-adders))))))
(define sandman-add-poll-set-adder
  (lambda (old-exts_0 adder_0)
    (let ((app_0 (if old-exts_0 (exts-timeout-at old-exts_0) #f)))
      (exts1.1
       app_0
       (cons adder_0 (if old-exts_0 (exts-fd-adders old-exts_0) #f))))))
(define sandman-poll-ctx-add-poll-set-adder!
  (lambda (poll-ctx_0 adder_0)
    (let ((sched-info_0 (|#%app| poll-ctx-sched-info poll-ctx_0)))
      (if sched-info_0
        (|#%app|
         schedule-info-current-exts
         sched-info_0
         (sandman-add-poll-set-adder
          (|#%app| schedule-info-current-exts sched-info_0)
          adder_0))
        (void)))))
(define sandman-poll-ctx-merge-timeout
  (lambda (poll-ctx_0 timeout_0)
    (let ((sched-info_0 (|#%app| poll-ctx-sched-info poll-ctx_0)))
      (if sched-info_0
        (|#%app|
         schedule-info-current-exts
         sched-info_0
         (let ((app_0 (sandman-do-merge-timeout (|#%app| current-sandman))))
           (|#%app|
            app_0
            (|#%app| schedule-info-current-exts sched-info_0)
            timeout_0)))
        (void)))))
(define sandman-poll-ctx-poll?
  (lambda (poll-ctx_0) (|#%app| poll-ctx-poll? poll-ctx_0)))
(define cell.1$10 (unsafe-make-place-local #f))
(define cell.2$3 (unsafe-make-place-local #f))
(define sandman-set-background-sleep!
  (lambda (sleep_0 fd_0)
    (begin
      (unsafe-place-local-set! cell.1$10 sleep_0)
      (unsafe-place-local-set! cell.2$3 fd_0))))
(define effect_2444
  (begin
    (void
     (|#%app|
      current-sandman
      (let ((timeout-sandman_0 (|#%app| current-sandman)))
        (sandman1.1
         (lambda (exts_0)
           (let ((timeout-at_0 (if exts_0 (exts-timeout-at exts_0) #f)))
             (let ((fd-adders_0 (if exts_0 (exts-fd-adders exts_0) #f)))
               (let ((ps_0
                      (|#%app|
                       rktio_make_poll_set
                       (unsafe-place-local-ref cell.1))))
                 (begin
                   (letrec*
                    ((loop_0
                      (|#%name|
                       loop
                       (lambda (fd-adders_1)
                         (if (not fd-adders_1)
                           (void)
                           (if (pair? fd-adders_1)
                             (begin
                               (loop_0 (car fd-adders_1))
                               (loop_0 (cdr fd-adders_1)))
                             (|#%app| fd-adders_1 ps_0)))))))
                    (loop_0 fd-adders_0))
                   (let ((sleep-secs_0
                          (if timeout-at_0
                            (/
                             (-
                              timeout-at_0
                              (current-inexact-monotonic-milliseconds))
                             1000.0)
                            #f)))
                     (begin
                       (if (if sleep-secs_0 (<= sleep-secs_0 0.0) #f)
                         (void)
                         (if (unsafe-place-local-ref cell.1$10)
                           (begin
                             (|#%app|
                              rktio_start_sleep
                              (unsafe-place-local-ref cell.1)
                              (if sleep-secs_0 sleep-secs_0 0.0)
                              ps_0
                              (unsafe-place-local-ref cell.1$5)
                              (unsafe-place-local-ref cell.2$3))
                             (|#%app| (unsafe-place-local-ref cell.1$10))
                             (|#%app|
                              rktio_end_sleep
                              (unsafe-place-local-ref cell.1)))
                           (|#%app|
                            rktio_sleep
                            (unsafe-place-local-ref cell.1)
                            (if sleep-secs_0 sleep-secs_0 0.0)
                            ps_0
                            (unsafe-place-local-ref cell.1$5))))
                       (|#%app|
                        rktio_poll_set_forget
                        (unsafe-place-local-ref cell.1)
                        ps_0))))))))
         (lambda (wakeup_0)
           (begin
             (letrec*
              ((check-signals_0
                (|#%name|
                 check-signals
                 (lambda ()
                   (let ((v_0
                          (|#%app|
                           rktio_poll_os_signal
                           (unsafe-place-local-ref cell.1))))
                     (if (eqv? v_0 -1)
                       (void)
                       (begin
                         (|#%app|
                          (|#%app| rktio_get_ctl_c_handler)
                          (if (eqv? v_0 2)
                            'hang-up
                            (if (eqv? v_0 1) 'terminate 'break)))
                         (|#%app| wakeup_0 #f)
                         (check-signals_0))))))))
              (check-signals_0))
             (if (fd-semaphore-poll-ready?) (|#%app| wakeup_0 #f) (void))
             (|#%app| (sandman-do-poll timeout-sandman_0) wakeup_0)))
         (lambda ()
           (|#%app| rktio_get_signal_handle (unsafe-place-local-ref cell.1)))
         (lambda (h_0) (|#%app| rktio_signal_received_at h_0))
         (lambda () (|#%app| (sandman-do-any-sleepers? timeout-sandman_0)))
         (lambda ()
           (let ((timeout-at_0
                  (|#%app|
                   (sandman-do-sleepers-external-events timeout-sandman_0))))
             (if timeout-at_0 (exts1.1 timeout-at_0 #f) #f)))
         (lambda (t_0 exts_0)
           (let ((fd-adders_0 (exts-fd-adders exts_0)))
             (begin
               (if (let ((or-part_0 (not fd-adders_0)))
                     (if or-part_0 or-part_0 (null? fd-adders_0)))
                 (void)
                 (internal-error "cannot sleep on fds"))
               (let ((app_0 (sandman-do-add-thread! timeout-sandman_0)))
                 (|#%app| app_0 t_0 (exts-timeout-at exts_0))))))
         (lambda (t_0 timeout-handle_0)
           (|#%app|
            (sandman-do-remove-thread! timeout-sandman_0)
            t_0
            timeout-handle_0))
         (lambda (a-exts_0 b-exts_0)
           (if (if a-exts_0 b-exts_0 #f)
             (let ((app_0
                    (let ((app_0
                           (sandman-do-merge-external-event-sets
                            timeout-sandman_0)))
                      (let ((app_1 (exts-timeout-at a-exts_0)))
                        (|#%app| app_0 app_1 (exts-timeout-at b-exts_0))))))
               (exts1.1
                app_0
                (if (if (exts-fd-adders a-exts_0) (exts-fd-adders b-exts_0) #f)
                  (let ((app_1 (exts-fd-adders a-exts_0)))
                    (cons app_1 (exts-fd-adders b-exts_0)))
                  (let ((or-part_0 (exts-fd-adders a-exts_0)))
                    (if or-part_0 or-part_0 (exts-fd-adders b-exts_0))))))
             (if a-exts_0 a-exts_0 b-exts_0)))
         (lambda (old-exts_0 timeout-at_0)
           (let ((app_0
                  (let ((app_0 (sandman-do-merge-timeout timeout-sandman_0)))
                    (|#%app|
                     app_0
                     (if old-exts_0 (exts-timeout-at old-exts_0) #f)
                     timeout-at_0))))
             (exts1.1 app_0 (if old-exts_0 (exts-fd-adders old-exts_0) #f))))
         (lambda (exts_0) (exts-timeout-at exts_0))))))
    (void)))
(define check-range$1
  (|#%name|
   check-range
   (lambda (who_0 start-pos_0 end-pos_0 max-end_0 in-value_0)
     (begin
       (if (> start-pos_0 max-end_0)
         (raise-range-error
          who_0
          "byte string"
          "starting "
          start-pos_0
          in-value_0
          0
          max-end_0
          #f)
         (void))
       (if (let ((or-part_0 (< end-pos_0 start-pos_0)))
             (if or-part_0 or-part_0 (> end-pos_0 max-end_0)))
         (raise-range-error
          who_0
          "byte string"
          "ending "
          end-pos_0
          in-value_0
          start-pos_0
          max-end_0
          0)
         (void))))))
(define check-immutable-field
  (lambda (who_0 v_0 sti_0)
    (if (exact-integer? v_0)
      (if (memv v_0 (list-ref sti_0 5))
        (void)
        (raise-arguments-error
         who_0
         "field index not declared immutable"
         "field index"
         v_0))
      (void))))
(define-values
 (prop:input-port-evt input-port-evt? input-port-evt-ref)
 (make-struct-type-property 'input-port-evt))
(define-values
 (prop:output-port-evt output-port-evt? output-port-evt-ref)
 (make-struct-type-property 'output-port-evt))
(define port->evt
  (lambda (p_0)
    (if (input-port-evt? p_0)
      (wrap-evt (|#%app| (input-port-evt-ref p_0) p_0) (lambda (v_0) p_0))
      (wrap-evt (|#%app| (output-port-evt-ref p_0) p_0) (lambda (v_0) p_0)))))
(define finish_2455
  (make-struct-type-install-properties
   '(core-port)
   7
   0
   #f
   (list
    (cons prop:authentic #t)
    (cons prop:secondary-evt port->evt)
    (cons prop:object-name 1)
    (cons prop:unsafe-authentic-override #t))
   (current-inspector)
   #f
   '(0 1)
   #f
   'create-core-port))
(define struct:core-port
  (make-record-type-descriptor
   'core-port
   #f
   (|#%nongenerative-uid| core-port)
   #f
   #f
   '(7 . 124)))
(define effect_2337 (finish_2455 struct:core-port))
(define create-core-port
  (|#%name|
   create-core-port
   (record-constructor
    (make-record-constructor-descriptor struct:core-port #f #f))))
(define core-port? (|#%name| core-port? (record-predicate struct:core-port)))
(define core-port-vtable
  (|#%name| core-port-vtable (record-accessor struct:core-port 0)))
(define core-port-name
  (|#%name| core-port-name (record-accessor struct:core-port 1)))
(define core-port-buffer
  (|#%name| core-port-buffer (record-accessor struct:core-port 2)))
(define core-port-closed?
  (|#%name| core-port-closed? (record-accessor struct:core-port 3)))
(define core-port-closed-sema
  (|#%name| core-port-closed-sema (record-accessor struct:core-port 4)))
(define core-port-offset
  (|#%name| core-port-offset (record-accessor struct:core-port 5)))
(define core-port-count
  (|#%name| core-port-count (record-accessor struct:core-port 6)))
(define set-core-port-buffer!
  (|#%name| set-core-port-buffer! (record-mutator struct:core-port 2)))
(define set-core-port-closed?!
  (|#%name| set-core-port-closed?! (record-mutator struct:core-port 3)))
(define set-core-port-closed-sema!
  (|#%name| set-core-port-closed-sema! (record-mutator struct:core-port 4)))
(define set-core-port-offset!
  (|#%name| set-core-port-offset! (record-mutator struct:core-port 5)))
(define set-core-port-count!
  (|#%name| set-core-port-count! (record-mutator struct:core-port 6)))
(define finish_2057
  (make-struct-type-install-properties
   '(core-port-methods)
   5
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1 2 3 4)
   #f
   'core-port-methods))
(define struct:core-port-methods.1
  (make-record-type-descriptor
   'core-port-methods
   #f
   (|#%nongenerative-uid| core-port-methods)
   #f
   #f
   '(5 . 0)))
(define effect_2309 (finish_2057 struct:core-port-methods.1))
(define core-port-methods1.1
  (|#%name|
   core-port-methods
   (record-constructor
    (make-record-constructor-descriptor struct:core-port-methods.1 #f #f))))
(define core-port-methods?.1_2103
  (|#%name| core-port-methods? (record-predicate struct:core-port-methods.1)))
(define core-port-methods?.1
  (|#%name|
   core-port-methods?
   (lambda (v)
     (if (core-port-methods?.1_2103 v)
       #t
       ($value
        (if (impersonator? v)
          (core-port-methods?.1_2103 (impersonator-val v))
          #f))))))
(define core-port-methods-close.1_1881
  (|#%name|
   core-port-methods-close
   (record-accessor struct:core-port-methods.1 0)))
(define core-port-methods-close.1
  (|#%name|
   core-port-methods-close
   (lambda (s)
     (if (core-port-methods?.1_2103 s)
       (core-port-methods-close.1_1881 s)
       ($value
        (impersonate-ref
         core-port-methods-close.1_1881
         struct:core-port-methods.1
         0
         s
         'close))))))
(define core-port-methods-count-lines!.1_2484
  (|#%name|
   core-port-methods-count-lines!
   (record-accessor struct:core-port-methods.1 1)))
(define core-port-methods-count-lines!.1
  (|#%name|
   core-port-methods-count-lines!
   (lambda (s)
     (if (core-port-methods?.1_2103 s)
       (core-port-methods-count-lines!.1_2484 s)
       ($value
        (impersonate-ref
         core-port-methods-count-lines!.1_2484
         struct:core-port-methods.1
         1
         s
         'count-lines!))))))
(define core-port-methods-get-location.1_2923
  (|#%name|
   core-port-methods-get-location
   (record-accessor struct:core-port-methods.1 2)))
(define core-port-methods-get-location.1
  (|#%name|
   core-port-methods-get-location
   (lambda (s)
     (if (core-port-methods?.1_2103 s)
       (core-port-methods-get-location.1_2923 s)
       ($value
        (impersonate-ref
         core-port-methods-get-location.1_2923
         struct:core-port-methods.1
         2
         s
         'get-location))))))
(define core-port-methods-file-position.1_2707
  (|#%name|
   core-port-methods-file-position
   (record-accessor struct:core-port-methods.1 3)))
(define core-port-methods-file-position.1
  (|#%name|
   core-port-methods-file-position
   (lambda (s)
     (if (core-port-methods?.1_2103 s)
       (core-port-methods-file-position.1_2707 s)
       ($value
        (impersonate-ref
         core-port-methods-file-position.1_2707
         struct:core-port-methods.1
         3
         s
         'file-position))))))
(define core-port-methods-buffer-mode.1_2291
  (|#%name|
   core-port-methods-buffer-mode
   (record-accessor struct:core-port-methods.1 4)))
(define core-port-methods-buffer-mode.1
  (|#%name|
   core-port-methods-buffer-mode
   (lambda (s)
     (if (core-port-methods?.1_2103 s)
       (core-port-methods-buffer-mode.1_2291 s)
       ($value
        (impersonate-ref
         core-port-methods-buffer-mode.1_2291
         struct:core-port-methods.1
         4
         s
         'buffer-mode))))))
(define core-port-vtable.1
  (core-port-methods1.1
   (|#%name| close (lambda (this-id_0) (void)))
   #f
   #f
   #f
   #f))
(define finish_2711
  (make-struct-type-install-properties
   '(direct)
   3
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'direct))
(define struct:direct
  (make-record-type-descriptor
   'direct
   #f
   (|#%nongenerative-uid| direct)
   #f
   #f
   '(3 . 7)))
(define effect_2682 (finish_2711 struct:direct))
(define direct2.1
  (|#%name|
   direct
   (record-constructor
    (make-record-constructor-descriptor struct:direct #f #f))))
(define direct? (|#%name| direct? (record-predicate struct:direct)))
(define direct-bstr (|#%name| direct-bstr (record-accessor struct:direct 0)))
(define direct-pos (|#%name| direct-pos (record-accessor struct:direct 1)))
(define direct-end (|#%name| direct-end (record-accessor struct:direct 2)))
(define set-direct-bstr!
  (|#%name| set-direct-bstr! (record-mutator struct:direct 0)))
(define set-direct-pos!
  (|#%name| set-direct-pos! (record-mutator struct:direct 1)))
(define set-direct-end!
  (|#%name| set-direct-end! (record-mutator struct:direct 2)))
(define finish_2554
  (make-struct-type-install-properties
   '(location)
   5
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'location))
(define struct:location
  (make-record-type-descriptor
   'location
   #f
   (|#%nongenerative-uid| location)
   #f
   #f
   '(5 . 31)))
(define effect_3131 (finish_2554 struct:location))
(define location3.1
  (|#%name|
   location
   (record-constructor
    (make-record-constructor-descriptor struct:location #f #f))))
(define location? (|#%name| location? (record-predicate struct:location)))
(define location-state
  (|#%name| location-state (record-accessor struct:location 0)))
(define location-cr-state
  (|#%name| location-cr-state (record-accessor struct:location 1)))
(define location-line
  (|#%name| location-line (record-accessor struct:location 2)))
(define location-column
  (|#%name| location-column (record-accessor struct:location 3)))
(define location-position
  (|#%name| location-position (record-accessor struct:location 4)))
(define set-location-state!
  (|#%name| set-location-state! (record-mutator struct:location 0)))
(define set-location-cr-state!
  (|#%name| set-location-cr-state! (record-mutator struct:location 1)))
(define set-location-line!
  (|#%name| set-location-line! (record-mutator struct:location 2)))
(define set-location-column!
  (|#%name| set-location-column! (record-mutator struct:location 3)))
(define set-location-position!
  (|#%name| set-location-position! (record-mutator struct:location 4)))
(define get-core-port-offset
  (lambda (p_0)
    (let ((offset_0 (core-port-offset p_0)))
      (let ((buffer_0 (core-port-buffer p_0)))
        (if offset_0
          (if (direct-bstr buffer_0)
            (+ offset_0 (direct-pos buffer_0))
            offset_0)
          #f)))))
(define-values
 (1/prop:input-port input-port-via-property? input-port-ref)
 (make-struct-type-property
  'input-port
  (lambda (v_0 sti_0)
    (begin
      (if (let ((or-part_0 (exact-nonnegative-integer? v_0)))
            (if or-part_0 or-part_0 (1/input-port? v_0)))
        (void)
        (raise-argument-error
         'prop:input-port
         "(or/c input-port? exact-nonnegative-integer?)"
         v_0))
      (check-immutable-field 'prop:input-port v_0 sti_0)
      (if (exact-nonnegative-integer? v_0)
        (make-struct-field-accessor (list-ref sti_0 3) v_0)
        v_0)))
  (list
   (cons prop:secondary-evt (lambda (v_0) port->evt))
   (cons
    prop:input-port-evt
    (lambda (i_0)
      (input-port-evt-ref (->core-input-port.1 unsafe-undefined i_0 #f)))))))
(define 1/input-port?
  (|#%name|
   input-port?
   (lambda (p_0)
     (let ((or-part_0 (core-input-port? p_0)))
       (if or-part_0 or-part_0 (input-port-via-property? p_0))))))
(define ->core-input-port.1
  (|#%name|
   ->core-input-port
   (lambda (default1_0 v4_0 who3_0)
     (let ((default_0
            (if (eq? default1_0 unsafe-undefined)
              empty-input-port
              default1_0)))
       (if (core-input-port? v4_0)
         v4_0
         (let ((c1_0 (input-port-ref v4_0 #f)))
           (if c1_0
             (if (struct-accessor-procedure? c1_0)
               (let ((temp8_0 (|#%app| c1_0 v4_0)))
                 (->core-input-port.1 unsafe-undefined temp8_0 #f))
               (->core-input-port.1 unsafe-undefined c1_0 #f))
             (if who3_0
               (raise-argument-error who3_0 "input-port?" v4_0)
               default_0))))))))
(define finish_2969
  (make-struct-type-install-properties
   '(core-input-port)
   2
   0
   struct:core-port
   (list
    (cons prop:authentic #t)
    (cons
     prop:input-port-evt
     (lambda (i_0)
       (let ((i_1 (->core-input-port.1 unsafe-undefined i_0 #f)))
         (if (core-port-closed? i_1)
           always-evt
           (let ((byte-ready_0
                  (core-input-port-methods-byte-ready.1
                   (core-port-vtable i_1))))
             (if (1/input-port? byte-ready_0)
               byte-ready_0
               (|#%app|
                poller-evt
                (|#%app|
                 poller
                 (lambda (self_0 poll-ctx_0)
                   (let ((v_0
                          (|#%app|
                           byte-ready_0
                           i_1
                           (lambda ()
                             (|#%app|
                              schedule-info-did-work!
                              (|#%app| poll-ctx-sched-info poll-ctx_0))))))
                     (if (evt? v_0)
                       (values #f v_0)
                       (if (eq? v_0 #t)
                         (values (list #t) #f)
                         (values #f self_0))))))))))))))
   (current-inspector)
   #f
   '()
   #f
   'create-core-input-port))
(define struct:core-input-port
  (make-record-type-descriptor
   'core-input-port
   struct:core-port
   (|#%nongenerative-uid| core-input-port)
   #f
   #f
   '(2 . 3)))
(define effect_2528 (finish_2969 struct:core-input-port))
(define create-core-input-port
  (|#%name|
   create-core-input-port
   (record-constructor
    (make-record-constructor-descriptor struct:core-input-port #f #f))))
(define core-input-port?
  (|#%name| core-input-port? (record-predicate struct:core-input-port)))
(define core-input-port-pending-eof?
  (|#%name|
   core-input-port-pending-eof?
   (record-accessor struct:core-input-port 0)))
(define core-input-port-read-handler
  (|#%name|
   core-input-port-read-handler
   (record-accessor struct:core-input-port 1)))
(define set-core-input-port-pending-eof?!
  (|#%name|
   set-core-input-port-pending-eof?!
   (record-mutator struct:core-input-port 0)))
(define set-core-input-port-read-handler!
  (|#%name|
   set-core-input-port-read-handler!
   (record-mutator struct:core-input-port 1)))
(define finish_2853
  (make-struct-type-install-properties
   '(core-input-port-methods)
   6
   0
   struct:core-port-methods.1
   null
   (current-inspector)
   #f
   '(0 1 2 3 4 5)
   #f
   'core-input-port-methods))
(define struct:core-input-port-methods.1
  (make-record-type-descriptor
   'core-input-port-methods
   struct:core-port-methods.1
   (|#%nongenerative-uid| core-input-port-methods)
   #f
   #f
   '(6 . 0)))
(define effect_2085 (finish_2853 struct:core-input-port-methods.1))
(define core-input-port-methods6.1
  (|#%name|
   core-input-port-methods
   (record-constructor
    (make-record-constructor-descriptor
     struct:core-input-port-methods.1
     #f
     #f))))
(define core-input-port-methods?.1_1957
  (|#%name|
   core-input-port-methods?
   (record-predicate struct:core-input-port-methods.1)))
(define core-input-port-methods?.1
  (|#%name|
   core-input-port-methods?
   (lambda (v)
     (if (core-input-port-methods?.1_1957 v)
       #t
       ($value
        (if (impersonator? v)
          (core-input-port-methods?.1_1957 (impersonator-val v))
          #f))))))
(define core-input-port-methods-prepare-change.1_1814
  (|#%name|
   core-input-port-methods-prepare-change
   (record-accessor struct:core-input-port-methods.1 0)))
(define core-input-port-methods-prepare-change.1
  (|#%name|
   core-input-port-methods-prepare-change
   (lambda (s)
     (if (core-input-port-methods?.1_1957 s)
       (core-input-port-methods-prepare-change.1_1814 s)
       ($value
        (impersonate-ref
         core-input-port-methods-prepare-change.1_1814
         struct:core-input-port-methods.1
         0
         s
         'prepare-change))))))
(define core-input-port-methods-read-in.1_2920
  (|#%name|
   core-input-port-methods-read-in
   (record-accessor struct:core-input-port-methods.1 1)))
(define core-input-port-methods-read-in.1
  (|#%name|
   core-input-port-methods-read-in
   (lambda (s)
     (if (core-input-port-methods?.1_1957 s)
       (core-input-port-methods-read-in.1_2920 s)
       ($value
        (impersonate-ref
         core-input-port-methods-read-in.1_2920
         struct:core-input-port-methods.1
         1
         s
         'read-in))))))
(define core-input-port-methods-peek-in.1_2905
  (|#%name|
   core-input-port-methods-peek-in
   (record-accessor struct:core-input-port-methods.1 2)))
(define core-input-port-methods-peek-in.1
  (|#%name|
   core-input-port-methods-peek-in
   (lambda (s)
     (if (core-input-port-methods?.1_1957 s)
       (core-input-port-methods-peek-in.1_2905 s)
       ($value
        (impersonate-ref
         core-input-port-methods-peek-in.1_2905
         struct:core-input-port-methods.1
         2
         s
         'peek-in))))))
(define core-input-port-methods-byte-ready.1_2198
  (|#%name|
   core-input-port-methods-byte-ready
   (record-accessor struct:core-input-port-methods.1 3)))
(define core-input-port-methods-byte-ready.1
  (|#%name|
   core-input-port-methods-byte-ready
   (lambda (s)
     (if (core-input-port-methods?.1_1957 s)
       (core-input-port-methods-byte-ready.1_2198 s)
       ($value
        (impersonate-ref
         core-input-port-methods-byte-ready.1_2198
         struct:core-input-port-methods.1
         3
         s
         'byte-ready))))))
(define core-input-port-methods-get-progress-evt.1_2402
  (|#%name|
   core-input-port-methods-get-progress-evt
   (record-accessor struct:core-input-port-methods.1 4)))
(define core-input-port-methods-get-progress-evt.1
  (|#%name|
   core-input-port-methods-get-progress-evt
   (lambda (s)
     (if (core-input-port-methods?.1_1957 s)
       (core-input-port-methods-get-progress-evt.1_2402 s)
       ($value
        (impersonate-ref
         core-input-port-methods-get-progress-evt.1_2402
         struct:core-input-port-methods.1
         4
         s
         'get-progress-evt))))))
(define core-input-port-methods-commit.1_2988
  (|#%name|
   core-input-port-methods-commit
   (record-accessor struct:core-input-port-methods.1 5)))
(define core-input-port-methods-commit.1
  (|#%name|
   core-input-port-methods-commit
   (lambda (s)
     (if (core-input-port-methods?.1_1957 s)
       (core-input-port-methods-commit.1_2988 s)
       ($value
        (impersonate-ref
         core-input-port-methods-commit.1_2988
         struct:core-input-port-methods.1
         5
         s
         'commit))))))
(define core-input-port-vtable.1
  (let ((app_0 (core-port-methods-close.1 core-port-vtable.1)))
    (let ((app_1 (core-port-methods-count-lines!.1 core-port-vtable.1)))
      (let ((app_2 (core-port-methods-get-location.1 core-port-vtable.1)))
        (let ((app_3 (core-port-methods-file-position.1 core-port-vtable.1)))
          (core-input-port-methods6.1
           app_0
           app_1
           app_2
           app_3
           (core-port-methods-buffer-mode.1 core-port-vtable.1)
           #f
           (|#%name|
            read-in
            (lambda (this-id_0 bstr13_0 start14_0 end15_0 copy?16_0) eof))
           (|#%name|
            peek-in
            (lambda (this-id_0
                     bstr30_0
                     start31_0
                     end32_0
                     progress-evt33_0
                     copy?34_0)
              eof))
           (|#%name| byte-ready (lambda (this-id_0 work-done!49_0) #t))
           #f
           (|#%name|
            commit
            (lambda (this-id_0 amt60_0 progress-evt61_0 ext-evt62_0 finish63_0)
              #f))))))))
(define empty-input-port
  (create-core-input-port
   core-input-port-vtable.1
   'empty
   (direct2.1 #f 0 0)
   #f
   #f
   0
   #f
   #f
   #f))
(define-values
 (1/prop:output-port output-port-via-property? output-port-ref)
 (make-struct-type-property
  'output-port
  (lambda (v_0 sti_0)
    (begin
      (if (let ((or-part_0 (exact-nonnegative-integer? v_0)))
            (if or-part_0 or-part_0 (1/output-port? v_0)))
        (void)
        (raise-argument-error
         'prop:output-port
         "(or/c output-port? exact-nonnegative-integer?)"
         v_0))
      (check-immutable-field 'prop:output-port v_0 sti_0)
      (if (exact-nonnegative-integer? v_0)
        (make-struct-field-accessor (list-ref sti_0 3) v_0)
        v_0)))
  (list
   (cons prop:secondary-evt (lambda (v_0) port->evt))
   (cons
    prop:output-port-evt
    (lambda (o_0)
      (output-port-evt-ref (->core-output-port.1 unsafe-undefined o_0 #f)))))))
(define 1/output-port?
  (|#%name|
   output-port?
   (lambda (p_0)
     (let ((or-part_0 (core-output-port? p_0)))
       (if or-part_0 or-part_0 (output-port-via-property? p_0))))))
(define ->core-output-port.1
  (|#%name|
   ->core-output-port
   (lambda (default1_0 v4_0 who3_0)
     (let ((default_0
            (if (eq? default1_0 unsafe-undefined)
              empty-output-port
              default1_0)))
       (if (core-output-port? v4_0)
         v4_0
         (let ((c1_0 (output-port-ref v4_0 #f)))
           (if c1_0
             (if (struct-accessor-procedure? c1_0)
               (let ((temp9_0 (|#%app| c1_0 v4_0)))
                 (->core-output-port.1 unsafe-undefined temp9_0 #f))
               (->core-output-port.1 unsafe-undefined c1_0 #f))
             (if who3_0
               (raise-argument-error who3_0 "output-port?" v4_0)
               default_0))))))))
(define finish_2574
  (make-struct-type-install-properties
   '(core-output-port)
   4
   0
   struct:core-port
   (list
    (cons prop:authentic #t)
    (cons
     prop:output-port-evt
     (lambda (o_0)
       (let ((o_1 (->core-output-port.1 unsafe-undefined o_0 #f)))
         (|#%app|
          1/choice-evt
          (let ((app_0
                 (|#%app|
                  poller-evt
                  (|#%app|
                   poller
                   (lambda (self_0 sched-info_0)
                     (if (core-port-closed? o_1)
                       (values '(#t) #f)
                       (values #f self_0)))))))
            (list app_0 (core-output-port-evt o_1))))))))
   (current-inspector)
   #f
   '()
   #f
   'create-core-output-port))
(define struct:core-output-port
  (make-record-type-descriptor
   'core-output-port
   struct:core-port
   (|#%nongenerative-uid| core-output-port)
   #f
   #f
   '(4 . 15)))
(define effect_2808 (finish_2574 struct:core-output-port))
(define create-core-output-port
  (|#%name|
   create-core-output-port
   (record-constructor
    (make-record-constructor-descriptor struct:core-output-port #f #f))))
(define core-output-port?
  (|#%name| core-output-port? (record-predicate struct:core-output-port)))
(define core-output-port-evt
  (|#%name| core-output-port-evt (record-accessor struct:core-output-port 0)))
(define core-output-port-write-handler
  (|#%name|
   core-output-port-write-handler
   (record-accessor struct:core-output-port 1)))
(define core-output-port-print-handler
  (|#%name|
   core-output-port-print-handler
   (record-accessor struct:core-output-port 2)))
(define core-output-port-display-handler
  (|#%name|
   core-output-port-display-handler
   (record-accessor struct:core-output-port 3)))
(define set-core-output-port-evt!
  (|#%name|
   set-core-output-port-evt!
   (record-mutator struct:core-output-port 0)))
(define set-core-output-port-write-handler!
  (|#%name|
   set-core-output-port-write-handler!
   (record-mutator struct:core-output-port 1)))
(define set-core-output-port-print-handler!
  (|#%name|
   set-core-output-port-print-handler!
   (record-mutator struct:core-output-port 2)))
(define set-core-output-port-display-handler!
  (|#%name|
   set-core-output-port-display-handler!
   (record-mutator struct:core-output-port 3)))
(define finish_2648
  (make-struct-type-install-properties
   '(core-output-port-methods)
   4
   0
   struct:core-port-methods.1
   null
   (current-inspector)
   #f
   '(0 1 2 3)
   #f
   'core-output-port-methods))
(define struct:core-output-port-methods.1
  (make-record-type-descriptor
   'core-output-port-methods
   struct:core-port-methods.1
   (|#%nongenerative-uid| core-output-port-methods)
   #f
   #f
   '(4 . 0)))
(define effect_2050 (finish_2648 struct:core-output-port-methods.1))
(define core-output-port-methods6.1
  (|#%name|
   core-output-port-methods
   (record-constructor
    (make-record-constructor-descriptor
     struct:core-output-port-methods.1
     #f
     #f))))
(define core-output-port-methods?.1_2148
  (|#%name|
   core-output-port-methods?
   (record-predicate struct:core-output-port-methods.1)))
(define core-output-port-methods?.1
  (|#%name|
   core-output-port-methods?
   (lambda (v)
     (if (core-output-port-methods?.1_2148 v)
       #t
       ($value
        (if (impersonator? v)
          (core-output-port-methods?.1_2148 (impersonator-val v))
          #f))))))
(define core-output-port-methods-write-out.1_2388
  (|#%name|
   core-output-port-methods-write-out
   (record-accessor struct:core-output-port-methods.1 0)))
(define core-output-port-methods-write-out.1
  (|#%name|
   core-output-port-methods-write-out
   (lambda (s)
     (if (core-output-port-methods?.1_2148 s)
       (core-output-port-methods-write-out.1_2388 s)
       ($value
        (impersonate-ref
         core-output-port-methods-write-out.1_2388
         struct:core-output-port-methods.1
         0
         s
         'write-out))))))
(define core-output-port-methods-write-out-special.1_1911
  (|#%name|
   core-output-port-methods-write-out-special
   (record-accessor struct:core-output-port-methods.1 1)))
(define core-output-port-methods-write-out-special.1
  (|#%name|
   core-output-port-methods-write-out-special
   (lambda (s)
     (if (core-output-port-methods?.1_2148 s)
       (core-output-port-methods-write-out-special.1_1911 s)
       ($value
        (impersonate-ref
         core-output-port-methods-write-out-special.1_1911
         struct:core-output-port-methods.1
         1
         s
         'write-out-special))))))
(define core-output-port-methods-get-write-evt.1_2434
  (|#%name|
   core-output-port-methods-get-write-evt
   (record-accessor struct:core-output-port-methods.1 2)))
(define core-output-port-methods-get-write-evt.1
  (|#%name|
   core-output-port-methods-get-write-evt
   (lambda (s)
     (if (core-output-port-methods?.1_2148 s)
       (core-output-port-methods-get-write-evt.1_2434 s)
       ($value
        (impersonate-ref
         core-output-port-methods-get-write-evt.1_2434
         struct:core-output-port-methods.1
         2
         s
         'get-write-evt))))))
(define core-output-port-methods-get-write-special-evt.1_3014
  (|#%name|
   core-output-port-methods-get-write-special-evt
   (record-accessor struct:core-output-port-methods.1 3)))
(define core-output-port-methods-get-write-special-evt.1
  (|#%name|
   core-output-port-methods-get-write-special-evt
   (lambda (s)
     (if (core-output-port-methods?.1_2148 s)
       (core-output-port-methods-get-write-special-evt.1_3014 s)
       ($value
        (impersonate-ref
         core-output-port-methods-get-write-special-evt.1_3014
         struct:core-output-port-methods.1
         3
         s
         'get-write-special-evt))))))
(define core-output-port-vtable.1
  (let ((app_0 (core-port-methods-close.1 core-port-vtable.1)))
    (let ((app_1 (core-port-methods-count-lines!.1 core-port-vtable.1)))
      (let ((app_2 (core-port-methods-get-location.1 core-port-vtable.1)))
        (let ((app_3 (core-port-methods-file-position.1 core-port-vtable.1)))
          (core-output-port-methods6.1
           app_0
           app_1
           app_2
           app_3
           (core-port-methods-buffer-mode.1 core-port-vtable.1)
           (|#%name|
            write-out
            (lambda (this-id_0
                     bstr14_0
                     start-k15_0
                     end-k16_0
                     no-block/buffer?17_0
                     enable-break?18_0
                     copy?19_0)
              (- end-k16_0 start-k15_0)))
           #f
           (|#%name|
            get-write-evt
            (lambda (this-id_0 bstr37_0 start-k38_0 end-k39_0) always-evt))
           #f))))))
(define get-write-evt-via-write-out
  (lambda (count-write-evt-via-write-out_0)
    (lambda (out_0 src-bstr_0 src-start_0 src-end_0)
      (write-evt7.1
       (lambda (self-evt_0)
         (let ((v_0
                (|#%app|
                 (core-output-port-methods-write-out.1
                  (core-port-vtable out_0))
                 out_0
                 src-bstr_0
                 src-start_0
                 src-end_0
                 #t
                 #f
                 #t)))
           (begin
             (if (exact-integer? v_0)
               (|#%app|
                count-write-evt-via-write-out_0
                out_0
                v_0
                src-bstr_0
                src-start_0)
               (void))
             (if (evt? v_0)
               (values #f (replace-evt v_0 self-evt_0))
               (values (list v_0) #f)))))))))
(define finish_2564
  (make-struct-type-install-properties
   '(write-evt)
   1
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (self_0 sched-info_0)
        (|#%app| (write-evt-proc self_0) self_0)))))
   (current-inspector)
   #f
   '(0)
   #f
   'write-evt))
(define struct:write-evt
  (make-record-type-descriptor
   'write-evt
   #f
   (|#%nongenerative-uid| write-evt)
   #f
   #f
   '(1 . 0)))
(define effect_2493 (finish_2564 struct:write-evt))
(define write-evt7.1
  (|#%name|
   write-evt
   (record-constructor
    (make-record-constructor-descriptor struct:write-evt #f #f))))
(define write-evt?_2870
  (|#%name| write-evt? (record-predicate struct:write-evt)))
(define write-evt?
  (|#%name|
   write-evt?
   (lambda (v)
     (if (write-evt?_2870 v)
       #t
       ($value
        (if (impersonator? v) (write-evt?_2870 (impersonator-val v)) #f))))))
(define write-evt-proc_2583
  (|#%name| write-evt-proc (record-accessor struct:write-evt 0)))
(define write-evt-proc
  (|#%name|
   write-evt-proc
   (lambda (s)
     (if (write-evt?_2870 s)
       (write-evt-proc_2583 s)
       ($value
        (impersonate-ref write-evt-proc_2583 struct:write-evt 0 s 'proc))))))
(define empty-output-port
  (create-core-output-port
   core-output-port-vtable.1
   'empty
   (direct2.1 #f 0 0)
   #f
   #f
   0
   #f
   always-evt
   #f
   #f
   #f))
(define finish_2110
  (make-struct-type-install-properties
   '(utf-8-state)
   3
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1 2)
   #f
   'utf-8-state))
(define struct:utf-8-state
  (make-record-type-descriptor
   'utf-8-state
   #f
   (|#%nongenerative-uid| utf-8-state)
   #f
   #f
   '(3 . 0)))
(define effect_2751 (finish_2110 struct:utf-8-state))
(define utf-8-state1.1
  (|#%name|
   utf-8-state
   (record-constructor
    (make-record-constructor-descriptor struct:utf-8-state #f #f))))
(define utf-8-state?_2522
  (|#%name| utf-8-state? (record-predicate struct:utf-8-state)))
(define utf-8-state?
  (|#%name|
   utf-8-state?
   (lambda (v)
     (if (utf-8-state?_2522 v)
       #t
       ($value
        (if (impersonator? v) (utf-8-state?_2522 (impersonator-val v)) #f))))))
(define utf-8-state-accum_2308
  (|#%name| utf-8-state-accum (record-accessor struct:utf-8-state 0)))
(define utf-8-state-accum
  (|#%name|
   utf-8-state-accum
   (lambda (s)
     (if (utf-8-state?_2522 s)
       (utf-8-state-accum_2308 s)
       ($value
        (impersonate-ref
         utf-8-state-accum_2308
         struct:utf-8-state
         0
         s
         'accum))))))
(define utf-8-state-remaining_2167
  (|#%name| utf-8-state-remaining (record-accessor struct:utf-8-state 1)))
(define utf-8-state-remaining
  (|#%name|
   utf-8-state-remaining
   (lambda (s)
     (if (utf-8-state?_2522 s)
       (utf-8-state-remaining_2167 s)
       ($value
        (impersonate-ref
         utf-8-state-remaining_2167
         struct:utf-8-state
         1
         s
         'remaining))))))
(define utf-8-state-pending-amt_2017
  (|#%name| utf-8-state-pending-amt (record-accessor struct:utf-8-state 2)))
(define utf-8-state-pending-amt
  (|#%name|
   utf-8-state-pending-amt
   (lambda (s)
     (if (utf-8-state?_2522 s)
       (utf-8-state-pending-amt_2017 s)
       ($value
        (impersonate-ref
         utf-8-state-pending-amt_2017
         struct:utf-8-state
         2
         s
         'pending-amt))))))
(define utf-8-decode!.1
  (|#%name|
   utf-8-decode!
   (lambda (abort-mode3_0
            error-char2_0
            state4_0
            in-bstr8_0
            in-start9_0
            in-end10_0
            out-str11_0
            out-start12_0
            out-end13_0)
     (let ((base-i_0
            (if state4_0
              (fx- in-start9_0 (utf-8-state-pending-amt state4_0))
              in-start9_0)))
       (let ((accum_0 (if state4_0 (utf-8-state-accum state4_0) 0)))
         (let ((remaining_0 (if state4_0 (utf-8-state-remaining state4_0) 0)))
           (letrec*
            ((loop_0
              (|#%name|
               loop
               (lambda (i_0 j_0 base-i_1 accum_1 remaining_1)
                 (let ((complete_0
                        (|#%name|
                         complete
                         (lambda (accum_2)
                           (begin
                             (if out-str11_0
                               (string-set!
                                out-str11_0
                                j_0
                                (integer->char accum_2))
                               (void))
                             (let ((next-j_0 (fx+ j_0 1)))
                               (let ((next-i_0 (fx+ i_0 1)))
                                 (if (if out-end13_0
                                       (fx= next-j_0 out-end13_0)
                                       #f)
                                   (let ((app_0 (fx- next-i_0 in-start9_0)))
                                     (let ((app_1
                                            (fx- next-j_0 out-start12_0)))
                                       (values
                                        app_0
                                        app_1
                                        (if (fx= next-i_0 in-end10_0)
                                          'complete
                                          'continues))))
                                   (loop_0
                                    next-i_0
                                    next-j_0
                                    next-i_0
                                    0
                                    0)))))))))
                   (let ((encoding-failure_0
                          (|#%name|
                           encoding-failure
                           (lambda ()
                             (if error-char2_0
                               (begin
                                 (if out-str11_0
                                   (string-set! out-str11_0 j_0 error-char2_0)
                                   (void))
                                 (let ((next-j_0 (fx+ j_0 1)))
                                   (let ((next-i_0 (fx+ base-i_1 1)))
                                     (if (if out-end13_0
                                           (fx= next-j_0 out-end13_0)
                                           #f)
                                       (let ((app_0
                                              (fx- next-i_0 in-start9_0)))
                                         (values
                                          app_0
                                          (fx- next-j_0 out-start12_0)
                                          'continues))
                                       (loop_0
                                        next-i_0
                                        next-j_0
                                        next-i_0
                                        0
                                        0)))))
                               (let ((app_0 (fx- base-i_1 in-start9_0)))
                                 (values
                                  app_0
                                  (fx- j_0 out-start12_0)
                                  'error)))))))
                     (if (fx= i_0 in-end10_0)
                       (if (fx= remaining_1 0)
                         (let ((app_0 (fx- base-i_1 in-start9_0)))
                           (values app_0 (fx- j_0 out-start12_0) 'complete))
                         (if (eq? abort-mode3_0 'error)
                           (encoding-failure_0)
                           (if (eq? abort-mode3_0 'state)
                             (let ((app_0 (fx- i_0 in-start9_0)))
                               (let ((app_1 (fx- j_0 out-start12_0)))
                                 (values
                                  app_0
                                  app_1
                                  (utf-8-state1.1
                                   accum_1
                                   remaining_1
                                   (fx- i_0 base-i_1)))))
                             (let ((app_0 (fx- base-i_1 in-start9_0)))
                               (values
                                app_0
                                (fx- j_0 out-start12_0)
                                'aborts)))))
                       (if (fx< i_0 in-start9_0)
                         (encoding-failure_0)
                         (let ((b_0 (unsafe-bytes-ref in-bstr8_0 i_0)))
                           (if (fx< b_0 128)
                             (if (fx= remaining_1 0)
                               (complete_0 b_0)
                               (encoding-failure_0))
                             (if (fx= 128 (fxand b_0 192))
                               (if (fx= remaining_1 0)
                                 (encoding-failure_0)
                                 (let ((next_0 (fxand b_0 63)))
                                   (let ((next-accum_0
                                          (fxior
                                           (unsafe-fxlshift accum_1 6)
                                           next_0)))
                                     (if (fx= 1 remaining_1)
                                       (if (if (fx> next-accum_0 127)
                                             (if (fx<= next-accum_0 1114111)
                                               (not
                                                (if (fx>= next-accum_0 55296)
                                                  (fx<= next-accum_0 57343)
                                                  #f))
                                               #f)
                                             #f)
                                         (complete_0 next-accum_0)
                                         (encoding-failure_0))
                                       (if (if (fx= 2 remaining_1)
                                             (fx<= next-accum_0 31)
                                             #f)
                                         (encoding-failure_0)
                                         (if (if (fx= 3 remaining_1)
                                               (fx<= next-accum_0 15)
                                               #f)
                                           (encoding-failure_0)
                                           (let ((remaining_2
                                                  (fx- remaining_1 1)))
                                             (loop_0
                                              (fx+ i_0 1)
                                              j_0
                                              base-i_1
                                              next-accum_0
                                              remaining_2))))))))
                               (if (not (fx= remaining_1 0))
                                 (encoding-failure_0)
                                 (if (fx= 192 (fxand b_0 224))
                                   (let ((accum_2 (fxand b_0 31)))
                                     (if (fx= accum_2 0)
                                       (encoding-failure_0)
                                       (loop_0 (fx+ i_0 1) j_0 i_0 accum_2 1)))
                                   (if (fx= 224 (fxand b_0 240))
                                     (let ((accum_2 (fxand b_0 15)))
                                       (loop_0 (fx+ i_0 1) j_0 i_0 accum_2 2))
                                     (if (fx= 240 (fxand b_0 248))
                                       (let ((accum_2 (fxand b_0 7)))
                                         (loop_0
                                          (fx+ i_0 1)
                                          j_0
                                          i_0
                                          accum_2
                                          3))
                                       (encoding-failure_0))))))))))))))))
            (loop_0
             in-start9_0
             out-start12_0
             base-i_0
             accum_0
             remaining_0))))))))
(define utf-8-decode-byte
  (lambda (b_0 accum_0 remaining_0)
    (if (fx< b_0 128)
      (if (fx= remaining_0 0) (values b_0 0 'complete) (values #f 0 'error))
      (if (fx= 128 (fxand b_0 192))
        (if (fx= remaining_0 0)
          (values #f 0 'error)
          (let ((next_0 (fxand b_0 63)))
            (let ((next-accum_0 (fxior (unsafe-fxlshift accum_0 6) next_0)))
              (if (fx= 1 remaining_0)
                (if (if (fx> next-accum_0 127)
                      (if (fx<= next-accum_0 1114111)
                        (not
                         (if (fx>= next-accum_0 55296)
                           (fx<= next-accum_0 57343)
                           #f))
                        #f)
                      #f)
                  (values next-accum_0 0 'complete)
                  (values #f 0 'error))
                (if (if (fx= 2 remaining_0) (fx<= next-accum_0 31) #f)
                  (values #f 0 'error)
                  (if (if (fx= 3 remaining_0) (fx<= next-accum_0 15) #f)
                    (values #f 0 'error)
                    (let ((remaining_1 (fx- remaining_0 1)))
                      (values next-accum_0 remaining_1 'continues))))))))
        (if (not (fx= remaining_0 0))
          (values #f 0 'error)
          (if (fx= 192 (fxand b_0 224))
            (let ((accum_1 (fxand b_0 31)))
              (if (fx= accum_1 0)
                (values #f 0 'error)
                (values accum_1 1 'continues)))
            (if (fx= 224 (fxand b_0 240))
              (let ((accum_1 (fxand b_0 15))) (values accum_1 2 'continues))
              (if (fx= 240 (fxand b_0 248))
                (let ((accum_1 (fxand b_0 7))) (values accum_1 3 'continues))
                (values #f 0 'error)))))))))
(define a-bytes->string/utf-8.1
  (|#%name|
   a-bytes->string/utf-8
   (lambda (just-length?15_0 bstr18_0 start19_0 end20_0 err-char17_0)
     (if (letrec*
          ((for-loop_0
            (|#%name|
             for-loop
             (lambda (result_0 pos_0)
               (if (< pos_0 end20_0)
                 (let ((result_1
                        (let ((result_1
                               (fx< (unsafe-bytes-ref bstr18_0 pos_0) 128)))
                          (values result_1))))
                   (if (if (not (let ((x_0 (list pos_0))) (not result_1)))
                         #t
                         #f)
                     (for-loop_0 result_1 (+ pos_0 1))
                     result_1))
                 result_0)))))
          (for-loop_0 #t start19_0))
       (if just-length?15_0
         (fx- end20_0 start19_0)
         (let ((str_0 (make-string (fx- end20_0 start19_0))))
           (begin
             (letrec*
              ((for-loop_0
                (|#%name|
                 for-loop
                 (lambda (pos_0)
                   (if (< pos_0 end20_0)
                     (begin
                       (let ((app_0 (fx- pos_0 start19_0)))
                         (string-set!
                          str_0
                          app_0
                          (integer->char (unsafe-bytes-ref bstr18_0 pos_0))))
                       (for-loop_0 (+ pos_0 1)))
                     (values))))))
              (for-loop_0 start19_0))
             (void)
             str_0)))
       (call-with-values
        (lambda ()
          (utf-8-decode!.1
           'error
           err-char17_0
           #f
           bstr18_0
           start19_0
           end20_0
           #f
           0
           #f))
        (lambda (used-bytes_0 got-chars_0 state_0)
          (if (eq? state_0 'error)
            #f
            (if just-length?15_0
              got-chars_0
              (let ((str_0 (make-string got-chars_0)))
                (begin
                  (utf-8-decode!.1
                   'error
                   err-char17_0
                   #f
                   bstr18_0
                   start19_0
                   end20_0
                   str_0
                   0
                   #f)
                  str_0))))))))))
(define utf-8-encode!
  (lambda (in-str_0 in-start_0 in-end_0 out-bstr_0 out-start_0 out-end_0)
    (letrec*
     ((loop_0
       (|#%name|
        loop
        (lambda (i_0 j_0)
          (if (fx= i_0 in-end_0)
            (let ((app_0 (fx- in-end_0 in-start_0)))
              (values app_0 (fx- j_0 out-start_0) 'complete))
            (let ((b_0 (char->integer (string-ref in-str_0 i_0))))
              (let ((continue_0
                     (|#%name|
                      continue
                      (lambda (next-j_0) (loop_0 (fx+ i_0 1) next-j_0)))))
                (if (fx<= b_0 127)
                  (if (if out-end_0 (fx= j_0 out-end_0) #f)
                    (let ((app_0 (fx- i_0 in-start_0)))
                      (values app_0 (fx- j_0 out-start_0) 'continues))
                    (begin
                      (if out-bstr_0
                        (unsafe-bytes-set! out-bstr_0 j_0 b_0)
                        (void))
                      (continue_0 (fx+ j_0 1))))
                  (if (fx<= b_0 2047)
                    (if (if out-end_0 (fx>= (fx+ j_0 1) out-end_0) #f)
                      (let ((app_0 (fx- i_0 in-start_0)))
                        (values app_0 (fx- j_0 out-start_0) 'continues))
                      (begin
                        (if out-bstr_0
                          (begin
                            (unsafe-bytes-set!
                             out-bstr_0
                             j_0
                             (fxior 192 (unsafe-fxrshift b_0 6)))
                            (let ((app_0 (fx+ j_0 1)))
                              (unsafe-bytes-set!
                               out-bstr_0
                               app_0
                               (fxior 128 (fxand b_0 63)))))
                          (void))
                        (continue_0 (+ j_0 2))))
                    (if (fx<= b_0 65535)
                      (if (if out-end_0 (fx>= (fx+ j_0 2) out-end_0) #f)
                        (let ((app_0 (fx- i_0 in-start_0)))
                          (values app_0 (fx- j_0 out-start_0) 'continues))
                        (begin
                          (if out-bstr_0
                            (begin
                              (unsafe-bytes-set!
                               out-bstr_0
                               j_0
                               (fxior 224 (unsafe-fxrshift b_0 12)))
                              (let ((app_0 (fx+ j_0 1)))
                                (unsafe-bytes-set!
                                 out-bstr_0
                                 app_0
                                 (fxior
                                  128
                                  (fxand (unsafe-fxrshift b_0 6) 63))))
                              (let ((app_0 (fx+ j_0 2)))
                                (unsafe-bytes-set!
                                 out-bstr_0
                                 app_0
                                 (fxior 128 (fxand b_0 63)))))
                            (void))
                          (continue_0 (fx+ j_0 3))))
                      (if (if out-end_0 (fx>= (fx+ j_0 3) out-end_0) #f)
                        (let ((app_0 (fx- i_0 in-start_0)))
                          (values app_0 (fx- j_0 out-start_0) 'continues))
                        (begin
                          (if out-bstr_0
                            (begin
                              (unsafe-bytes-set!
                               out-bstr_0
                               j_0
                               (fxior 240 (unsafe-fxrshift b_0 18)))
                              (let ((app_0 (fx+ j_0 1)))
                                (unsafe-bytes-set!
                                 out-bstr_0
                                 app_0
                                 (fxior
                                  128
                                  (fxand (unsafe-fxrshift b_0 12) 63))))
                              (let ((app_0 (fx+ j_0 2)))
                                (unsafe-bytes-set!
                                 out-bstr_0
                                 app_0
                                 (fxior
                                  128
                                  (fxand (unsafe-fxrshift b_0 6) 63))))
                              (let ((app_0 (fx+ j_0 3)))
                                (unsafe-bytes-set!
                                 out-bstr_0
                                 app_0
                                 (fxior 128 (fxand b_0 63)))))
                            (void))
                          (continue_0 (fx+ j_0 4))))))))))))))
     (loop_0 in-start_0 out-start_0))))
(define 1/bytes->string/latin-1
  (let ((bytes->string/latin-1_0
         (|#%name|
          bytes->string/latin-1
          (lambda (bstr4_0 err-char1_0 start2_0 end3_0)
            (let ((end_0
                   (if (eq? end3_0 unsafe-undefined)
                     (if (bytes? bstr4_0) (unsafe-bytes-length bstr4_0) #f)
                     end3_0)))
              (begin
                (if (bytes? bstr4_0)
                  (void)
                  (raise-argument-error
                   'bytes->string/latin-1
                   "bytes?"
                   bstr4_0))
                (begin
                  (if (let ((or-part_0 (not err-char1_0)))
                        (if or-part_0 or-part_0 (char? err-char1_0)))
                    (void)
                    (raise-argument-error
                     'bytes->string/latin-1
                     "(or/c char? #f)"
                     err-char1_0))
                  (begin
                    (if (exact-nonnegative-integer? start2_0)
                      (void)
                      (raise-argument-error
                       'bytes->string/latin-1
                       "exact-nonnegative-integer?"
                       start2_0))
                    (begin
                      (if (exact-nonnegative-integer? end_0)
                        (void)
                        (raise-argument-error
                         'bytes->string/latin-1
                         "exact-nonnegative-integer?"
                         end_0))
                      (begin
                        (check-range$1
                         'bytes->string/latin-1
                         start2_0
                         end_0
                         (unsafe-bytes-length bstr4_0)
                         bstr4_0)
                        (let ((len_0 (- end_0 start2_0)))
                          (let ((s_0 (make-string len_0)))
                            (begin
                              (letrec*
                               ((loop_0
                                 (|#%name|
                                  loop
                                  (lambda (i_0)
                                    (if (zero? i_0)
                                      (void)
                                      (let ((i_1 (sub1 i_0)))
                                        (begin
                                          (string-set!
                                           s_0
                                           i_1
                                           (integer->char
                                            (unsafe-bytes-ref
                                             bstr4_0
                                             (+ i_1 start2_0))))
                                          (loop_0 i_1))))))))
                               (loop_0 len_0))
                              s_0)))))))))))))
    (|#%name|
     bytes->string/latin-1
     (case-lambda
      ((bstr_0) (bytes->string/latin-1_0 bstr_0 #f 0 unsafe-undefined))
      ((bstr_0 err-char_0 start_0 end3_0)
       (bytes->string/latin-1_0 bstr_0 err-char_0 start_0 end3_0))
      ((bstr_0 err-char_0 start2_0)
       (bytes->string/latin-1_0 bstr_0 err-char_0 start2_0 unsafe-undefined))
      ((bstr_0 err-char1_0)
       (bytes->string/latin-1_0 bstr_0 err-char1_0 0 unsafe-undefined))))))
(define do-bytes->string/utf-8.1
  (|#%name|
   do-bytes->string/utf-8
   (lambda (just-length?5_0 who7_0 bstr8_0 err-char9_0 start10_0 end11_0)
     (begin
       (if (bytes? bstr8_0)
         (void)
         (raise-argument-error who7_0 "bytes?" bstr8_0))
       (if (let ((or-part_0 (not err-char9_0)))
             (if or-part_0 or-part_0 (char? err-char9_0)))
         (void)
         (raise-argument-error who7_0 "(or/c char? #f)" err-char9_0))
       (if (exact-nonnegative-integer? start10_0)
         (void)
         (raise-argument-error who7_0 "exact-nonnegative-integer?" start10_0))
       (if (exact-nonnegative-integer? end11_0)
         (void)
         (raise-argument-error who7_0 "exact-nonnegative-integer?" end11_0))
       (check-range$1
        who7_0
        start10_0
        end11_0
        (unsafe-bytes-length bstr8_0)
        bstr8_0)
       (let ((or-part_0
              (a-bytes->string/utf-8.1
               just-length?5_0
               bstr8_0
               start10_0
               end11_0
               err-char9_0)))
         (if or-part_0
           or-part_0
           (if just-length?5_0
             #f
             (raise-arguments-error
              who7_0
              "byte string is not a well-formed UTF-8 encoding"
              "byte string"
              (subbytes bstr8_0 start10_0 end11_0)))))))))
(define 1/bytes->string/utf-8
  (let ((bytes->string/utf-8_0
         (|#%name|
          bytes->string/utf-8
          (lambda (bstr16_0 err-char13_0 start14_0 end15_0)
            (let ((end_0
                   (if (eq? end15_0 unsafe-undefined)
                     (if (bytes? bstr16_0) (unsafe-bytes-length bstr16_0) #f)
                     end15_0)))
              (do-bytes->string/utf-8.1
               #f
               'bytes->string/utf-8
               bstr16_0
               err-char13_0
               start14_0
               end_0))))))
    (|#%name|
     bytes->string/utf-8
     (case-lambda
      ((bstr_0) (bytes->string/utf-8_0 bstr_0 #f 0 unsafe-undefined))
      ((bstr_0 err-char_0 start_0 end15_0)
       (bytes->string/utf-8_0 bstr_0 err-char_0 start_0 end15_0))
      ((bstr_0 err-char_0 start14_0)
       (bytes->string/utf-8_0 bstr_0 err-char_0 start14_0 unsafe-undefined))
      ((bstr_0 err-char13_0)
       (bytes->string/utf-8_0 bstr_0 err-char13_0 0 unsafe-undefined))))))
(define 1/bytes-utf-8-length
  (let ((bytes-utf-8-length_0
         (|#%name|
          bytes-utf-8-length
          (lambda (bstr20_0 err-char17_0 start18_0 end19_0)
            (let ((end_0
                   (if (eq? end19_0 unsafe-undefined)
                     (if (bytes? bstr20_0) (unsafe-bytes-length bstr20_0) #f)
                     end19_0)))
              (do-bytes->string/utf-8.1
               #t
               'bytes-utf-8-length
               bstr20_0
               err-char17_0
               start18_0
               end_0))))))
    (|#%name|
     bytes-utf-8-length
     (case-lambda
      ((bstr_0) (bytes-utf-8-length_0 bstr_0 #f 0 unsafe-undefined))
      ((bstr_0 err-char_0 start_0 end19_0)
       (bytes-utf-8-length_0 bstr_0 err-char_0 start_0 end19_0))
      ((bstr_0 err-char_0 start18_0)
       (bytes-utf-8-length_0 bstr_0 err-char_0 start18_0 unsafe-undefined))
      ((bstr_0 err-char17_0)
       (bytes-utf-8-length_0 bstr_0 err-char17_0 0 unsafe-undefined))))))
(define raise-encoding-error
  (lambda (who_0 bstr_0 start_0 end_0)
    (raise-arguments-error
     who_0
     "byte string is not a well-formed UTF-8 encoding"
     "byte string"
     (subbytes bstr_0 start_0 end_0))))
(define do-bytes-utf-8-ref.1
  (|#%name|
   do-bytes-utf-8-ref
   (lambda (get-index?21_0
            who23_0
            bstr24_0
            skip25_0
            err-char26_0
            start27_0
            end28_0)
     (begin
       (if (bytes? bstr24_0)
         (void)
         (raise-argument-error who23_0 "bytes?" bstr24_0))
       (begin
         (if (exact-nonnegative-integer? skip25_0)
           (void)
           (raise-argument-error
            who23_0
            "exact-nonnegative-integer?"
            skip25_0))
         (begin
           (if (let ((or-part_0 (not err-char26_0)))
                 (if or-part_0 or-part_0 (char? err-char26_0)))
             (void)
             (raise-argument-error who23_0 "(or/c char? #f)" err-char26_0))
           (begin
             (if (exact-nonnegative-integer? start27_0)
               (void)
               (raise-argument-error
                who23_0
                "exact-nonnegative-integer?"
                start27_0))
             (begin
               (if (exact-nonnegative-integer? end28_0)
                 (void)
                 (raise-argument-error
                  who23_0
                  "exact-nonnegative-integer?"
                  end28_0))
               (begin
                 (check-range$1
                  who23_0
                  start27_0
                  end28_0
                  (unsafe-bytes-length bstr24_0)
                  bstr24_0)
                 (call-with-values
                  (lambda ()
                    (if (eqv? skip25_0 0)
                      (values
                       0
                       0
                       (if (= start27_0 end28_0) 'complete 'continues))
                      (utf-8-decode!.1
                       'error
                       err-char26_0
                       #f
                       bstr24_0
                       start27_0
                       end28_0
                       #f
                       0
                       skip25_0)))
                  (lambda (initial-used-bytes_0 initial-got-chars_0 state_0)
                    (if (eq? state_0 'error)
                      #f
                      (if (eq? state_0 'continues)
                        (if (if get-index?21_0
                              (< (+ start27_0 initial-used-bytes_0) end28_0)
                              #f)
                          (+ initial-used-bytes_0 start27_0)
                          (let ((str_0
                                 (if (not get-index?21_0) (make-string 1) #f)))
                            (call-with-values
                             (lambda ()
                               (let ((temp87_0
                                      (+ start27_0 initial-used-bytes_0)))
                                 (utf-8-decode!.1
                                  'error
                                  err-char26_0
                                  #f
                                  bstr24_0
                                  temp87_0
                                  end28_0
                                  str_0
                                  0
                                  1)))
                             (lambda (used-bytes_0 got-chars_0 new-state_0)
                               (if (eq? new-state_0 'error)
                                 #f
                                 (if (let ((or-part_0
                                            (eq? state_0 'continues)))
                                       (if or-part_0
                                         or-part_0
                                         (if (eq? state_0 'complete)
                                           (= got-chars_0 1)
                                           #f)))
                                   (if get-index?21_0
                                     (+ initial-used-bytes_0 start27_0)
                                     (string-ref str_0 0))
                                   #f))))))
                        #f)))))))))))))
(define 1/bytes-utf-8-ref
  (let ((bytes-utf-8-ref_0
         (|#%name|
          bytes-utf-8-ref
          (lambda (bstr33_0 skip34_0 err-char30_0 start31_0 end32_0)
            (let ((end_0
                   (if (eq? end32_0 unsafe-undefined)
                     (if (bytes? bstr33_0) (unsafe-bytes-length bstr33_0) #f)
                     end32_0)))
              (do-bytes-utf-8-ref.1
               #f
               'bytes-utf-8-ref
               bstr33_0
               skip34_0
               err-char30_0
               start31_0
               end_0))))))
    (|#%name|
     bytes-utf-8-ref
     (case-lambda
      ((bstr_0 skip_0) (bytes-utf-8-ref_0 bstr_0 skip_0 #f 0 unsafe-undefined))
      ((bstr_0 skip_0 err-char_0 start_0 end32_0)
       (bytes-utf-8-ref_0 bstr_0 skip_0 err-char_0 start_0 end32_0))
      ((bstr_0 skip_0 err-char_0 start31_0)
       (bytes-utf-8-ref_0 bstr_0 skip_0 err-char_0 start31_0 unsafe-undefined))
      ((bstr_0 skip_0 err-char30_0)
       (bytes-utf-8-ref_0 bstr_0 skip_0 err-char30_0 0 unsafe-undefined))))))
(define 1/bytes-utf-8-index
  (let ((bytes-utf-8-index_0
         (|#%name|
          bytes-utf-8-index
          (lambda (bstr38_0 skip39_0 err-char35_0 start36_0 end37_0)
            (let ((end_0
                   (if (eq? end37_0 unsafe-undefined)
                     (if (bytes? bstr38_0) (unsafe-bytes-length bstr38_0) #f)
                     end37_0)))
              (do-bytes-utf-8-ref.1
               #t
               'bytes-utf-8-index
               bstr38_0
               skip39_0
               err-char35_0
               start36_0
               end_0))))))
    (|#%name|
     bytes-utf-8-index
     (case-lambda
      ((bstr_0 skip_0)
       (bytes-utf-8-index_0 bstr_0 skip_0 #f 0 unsafe-undefined))
      ((bstr_0 skip_0 err-char_0 start_0 end37_0)
       (bytes-utf-8-index_0 bstr_0 skip_0 err-char_0 start_0 end37_0))
      ((bstr_0 skip_0 err-char_0 start36_0)
       (bytes-utf-8-index_0
        bstr_0
        skip_0
        err-char_0
        start36_0
        unsafe-undefined))
      ((bstr_0 skip_0 err-char35_0)
       (bytes-utf-8-index_0 bstr_0 skip_0 err-char35_0 0 unsafe-undefined))))))
(define 1/string->bytes/latin-1
  (let ((string->bytes/latin-1_0
         (|#%name|
          string->bytes/latin-1
          (lambda (str43_0 err-byte40_0 start41_0 end42_0)
            (let ((end_0
                   (if (eq? end42_0 unsafe-undefined)
                     (if (string? str43_0) (string-length str43_0) #f)
                     end42_0)))
              (begin
                (if (string? str43_0)
                  (void)
                  (raise-argument-error
                   'string->bytes/latin-1
                   "string?"
                   str43_0))
                (begin
                  (if (let ((or-part_0 (not err-byte40_0)))
                        (if or-part_0 or-part_0 (byte? err-byte40_0)))
                    (void)
                    (raise-argument-error
                     'string->bytes/latin-1
                     "(or/c byte? #f)"
                     err-byte40_0))
                  (begin
                    (if (exact-nonnegative-integer? start41_0)
                      (void)
                      (raise-argument-error
                       'string->bytes/latin-1
                       "exact-nonnegative-integer?"
                       start41_0))
                    (begin
                      (if (exact-nonnegative-integer? end_0)
                        (void)
                        (raise-argument-error
                         'string->bytes/latin-1
                         "exact-nonnegative-integer?"
                         end_0))
                      (begin
                        (check-range$1
                         'string->bytes/latin-1
                         start41_0
                         end_0
                         (string-length str43_0)
                         str43_0)
                        (let ((len_0 (- end_0 start41_0)))
                          (let ((bstr_0 (make-bytes len_0)))
                            (begin
                              (letrec*
                               ((loop_0
                                 (|#%name|
                                  loop
                                  (lambda (i_0)
                                    (if (zero? i_0)
                                      (void)
                                      (let ((i_1 (sub1 i_0)))
                                        (let ((b_0
                                               (char->integer
                                                (string-ref
                                                 str43_0
                                                 (+ i_1 start41_0)))))
                                          (begin
                                            (if (byte? b_0)
                                              (unsafe-bytes-set!
                                               bstr_0
                                               i_1
                                               b_0)
                                              (if err-byte40_0
                                                (unsafe-bytes-set!
                                                 bstr_0
                                                 i_1
                                                 err-byte40_0)
                                                (raise-arguments-error
                                                 'string->bytes/latin-1
                                                 "string cannot be encoded in Latin-1"
                                                 "string"
                                                 str43_0)))
                                            (loop_0 i_1)))))))))
                               (loop_0 len_0))
                              bstr_0)))))))))))))
    (|#%name|
     string->bytes/latin-1
     (case-lambda
      ((str_0) (string->bytes/latin-1_0 str_0 #f 0 unsafe-undefined))
      ((str_0 err-byte_0 start_0 end42_0)
       (string->bytes/latin-1_0 str_0 err-byte_0 start_0 end42_0))
      ((str_0 err-byte_0 start41_0)
       (string->bytes/latin-1_0 str_0 err-byte_0 start41_0 unsafe-undefined))
      ((str_0 err-byte40_0)
       (string->bytes/latin-1_0 str_0 err-byte40_0 0 unsafe-undefined))))))
(define do-string->bytes/utf-8.1
  (|#%name|
   do-string->bytes/utf-8
   (lambda (just-length?44_0 who46_0 str47_0 err-byte48_0 start49_0 end50_0)
     (begin
       (if (string? str47_0)
         (void)
         (raise-argument-error who46_0 "string?" str47_0))
       (begin
         (if (let ((or-part_0 (not err-byte48_0)))
               (if or-part_0 or-part_0 (byte? err-byte48_0)))
           (void)
           (raise-argument-error who46_0 "(or/c byte? #f)" err-byte48_0))
         (begin
           (if (exact-nonnegative-integer? start49_0)
             (void)
             (raise-argument-error
              who46_0
              "exact-nonnegative-integer?"
              start49_0))
           (begin
             (if (exact-nonnegative-integer? end50_0)
               (void)
               (raise-argument-error
                who46_0
                "exact-nonnegative-integer?"
                end50_0))
             (begin
               (check-range$1
                who46_0
                start49_0
                end50_0
                (string-length str47_0)
                str47_0)
               (call-with-values
                (lambda () (utf-8-encode! str47_0 start49_0 end50_0 #f 0 #f))
                (lambda (used-chars_0 got-bytes_0 status_0)
                  (if just-length?44_0
                    got-bytes_0
                    (let ((bstr_0 (make-bytes got-bytes_0)))
                      (begin
                        (utf-8-encode! str47_0 start49_0 end50_0 bstr_0 0 #f)
                        bstr_0)))))))))))))
(define 1/string->bytes/utf-8
  (let ((string->bytes/utf-8_0
         (|#%name|
          string->bytes/utf-8
          (lambda (str55_0 err-byte52_0 start53_0 end54_0)
            (let ((end_0
                   (if (eq? end54_0 unsafe-undefined)
                     (if (string? str55_0) (string-length str55_0) #f)
                     end54_0)))
              (do-string->bytes/utf-8.1
               #f
               'string->bytes/utf-8
               str55_0
               err-byte52_0
               start53_0
               end_0))))))
    (|#%name|
     string->bytes/utf-8
     (case-lambda
      ((str_0) (string->bytes/utf-8_0 str_0 #f 0 unsafe-undefined))
      ((str_0 err-byte_0 start_0 end54_0)
       (string->bytes/utf-8_0 str_0 err-byte_0 start_0 end54_0))
      ((str_0 err-byte_0 start53_0)
       (string->bytes/utf-8_0 str_0 err-byte_0 start53_0 unsafe-undefined))
      ((str_0 err-byte52_0)
       (string->bytes/utf-8_0 str_0 err-byte52_0 0 unsafe-undefined))))))
(define 1/string-utf-8-length
  (let ((string-utf-8-length_0
         (|#%name|
          string-utf-8-length
          (lambda (str58_0 start56_0 end57_0)
            (let ((end_0
                   (if (eq? end57_0 unsafe-undefined)
                     (if (string? str58_0) (string-length str58_0) #f)
                     end57_0)))
              (do-string->bytes/utf-8.1
               #t
               'string-utf-8-length
               str58_0
               #f
               start56_0
               end_0))))))
    (|#%name|
     string-utf-8-length
     (case-lambda
      ((str_0) (string-utf-8-length_0 str_0 0 unsafe-undefined))
      ((str_0 start_0 end57_0) (string-utf-8-length_0 str_0 start_0 end57_0))
      ((str_0 start56_0)
       (string-utf-8-length_0 str_0 start56_0 unsafe-undefined))))))
(define 1/char-utf-8-length
  (|#%name|
   char-utf-8-length
   (lambda (c_0)
     (begin
       (if (char? c_0)
         (void)
         (raise-argument-error 'char-utf-8-length "char?" c_0))
       (let ((n_0 (char->integer c_0)))
         (if (<= n_0 127) 1 (if (<= n_0 2047) 2 (if (<= n_0 65535) 3 4))))))))
(define error-message->string
  (lambda (who_0 msg_0)
    (error-message->adjusted-string
     who_0
     'racket/primitive
     msg_0
     'racket/primitive)))
(define remap-rktio-error
  (lambda (err_0)
    (begin
      (unsafe-start-atomic)
      (begin
        (let ((app_0 (vector-ref err_0 0)))
          (|#%app|
           rktio_set_last_error
           (unsafe-place-local-ref cell.1)
           app_0
           (vector-ref err_0 1)))
        (begin
          (|#%app| rktio_remap_last_error (unsafe-place-local-ref cell.1))
          (let ((errno_0
                 (|#%app|
                  rktio_get_last_error
                  (unsafe-place-local-ref cell.1))))
            (let ((errkind_0
                   (|#%app|
                    rktio_get_last_error_kind
                    (unsafe-place-local-ref cell.1))))
              (begin (unsafe-end-atomic) (vector errkind_0 errno_0)))))))))
(define format-rktio-message
  (lambda (who_0 err_0 base-msg_0)
    (let ((msg_0
           (string-append
            base-msg_0
            "\n  system error: "
            (format-rktio-system-error-message err_0))))
      (error-message->adjusted-string
       who_0
       'racket/primitive
       msg_0
       'racket/primitive))))
(define format-rktio-system-error-message
  (lambda (err_0)
    (begin
      (unsafe-start-atomic)
      (let ((p_0
             (let ((app_0 (vector-ref err_0 0)))
               (|#%app|
                rktio_get_error_string
                (unsafe-place-local-ref cell.1)
                app_0
                (vector-ref err_0 1)))))
        (let ((system-msg_0 (|#%app| rktio_to_bytes p_0)))
          (begin
            (unsafe-end-atomic)
            (let ((app_0 (1/bytes->string/utf-8 system-msg_0 '#\x3f)))
              (let ((app_1
                     (let ((kind_0 (vector-ref err_0 0)))
                       (if (eqv? kind_0 0)
                         "errno"
                         (if (eqv? kind_0 1)
                           "win_err"
                           (if (eqv? kind_0 2) "gai_err" "rkt_err"))))))
                (string-append
                 app_0
                 "; "
                 app_1
                 "="
                 (number->string (vector-ref err_0 1)))))))))))
(define raise-rktio-error
  (lambda (who_0 err_0 base-msg_0)
    (raise
     (let ((app_0
            (let ((msg_0
                   (string-append
                    base-msg_0
                    "\n  system error: "
                    (format-rktio-system-error-message err_0))))
              (error-message->adjusted-string
               who_0
               'racket/primitive
               msg_0
               'racket/primitive))))
       (|#%app| exn:fail app_0 (current-continuation-marks))))))
(define check-rktio-error
  (lambda (v_0 base-msg_0)
    (begin
      (if (vector? v_0)
        (raise
         (let ((app_0
                (let ((msg_0
                       (string-append
                        base-msg_0
                        "\n  system error: "
                        (format-rktio-system-error-message v_0))))
                  (error-message->adjusted-string
                   #f
                   'racket/primitive
                   msg_0
                   'racket/primitive))))
           (|#%app| exn:fail app_0 (current-continuation-marks))))
        (void))
      v_0)))
(define raise-filesystem-error
  (lambda (who_0 orig-err_0 base-msg_0)
    (let ((err_0
           (if (racket-error? orig-err_0 4)
             orig-err_0
             (remap-rktio-error orig-err_0))))
      (let ((msg_0
             (if (racket-error? err_0 4)
               (error-message->adjusted-string
                who_0
                'racket/primitive
                base-msg_0
                'racket/primitive)
               (let ((msg_0
                      (string-append
                       base-msg_0
                       "\n  system error: "
                       (format-rktio-system-error-message err_0))))
                 (error-message->adjusted-string
                  who_0
                  'racket/primitive
                  msg_0
                  'racket/primitive)))))
        (raise
         (if (racket-error? err_0 4)
           (|#%app|
            exn:fail:filesystem:exists
            msg_0
            (current-continuation-marks))
           (if (not (eq? (vector-ref err_0 0) 3))
             (let ((app_0 (current-continuation-marks)))
               (|#%app|
                exn:fail:filesystem:errno
                msg_0
                app_0
                (let ((app_1 (vector-ref err_0 1)))
                  (cons
                   app_1
                   (let ((kind_0 (vector-ref err_0 0)))
                     (if (eqv? kind_0 0)
                       'posix
                       (if (eqv? kind_0 1)
                         'windows
                         (if (eqv? kind_0 2)
                           'gai
                           (error
                            'raise-filesystem-error
                            "confused about rktio error")))))))))
             (|#%app|
              exn:fail:filesystem
              msg_0
              (current-continuation-marks)))))))))
(define copy-file-step-string
  (lambda (err_0)
    (if (racket-error? err_0 4)
      "destination exists"
      (let ((step_0 (vector-ref err_0 2)))
        (if (eqv? step_0 1)
          "cannot open source file"
          (if (eqv? step_0 2)
            "cannot open destination file"
            (if (eqv? step_0 3)
              "error reading source file"
              (if (eqv? step_0 4)
                "error writing destination file"
                (if (eqv? step_0 5)
                  "error reading source-file metadata"
                  (if (eqv? step_0 6)
                    "error writing destination-file metadata"
                    "copy failed"))))))))))
(define maybe-raise-missing-module void)
(define set-maybe-raise-missing-module!
  (lambda (proc_0) (set! maybe-raise-missing-module proc_0)))
(define saved-error-value->string #f)
(define error-value->string
  (lambda (v_0)
    (if saved-error-value->string
      (|#%app| saved-error-value->string v_0)
      (let ((app_0 (error-value->string-handler)))
        (|#%app| app_0 v_0 (error-print-width))))))
(define register-error-value->string!
  (lambda (proc_0)
    (if saved-error-value->string
      (void)
      (set! saved-error-value->string proc_0))))
(define 1/port-closed?
  (|#%name|
   port-closed?
   (lambda (p_0)
     (let ((p_1
            (if (1/input-port? p_0)
              (->core-input-port.1 unsafe-undefined p_0 #f)
              (if (1/output-port? p_0)
                (->core-output-port.1 unsafe-undefined p_0 #f)
                (raise-argument-error 'close-input-port "port?" p_0)))))
       (core-port-closed? p_1)))))
(define close-port
  (lambda (p_0)
    (if (core-port-closed? p_0)
      (void)
      (begin
        (unsafe-start-atomic)
        (begin0
          (begin
            (|#%app| (core-port-methods-close.1 (core-port-vtable p_0)) p_0)
            (set-closed-state! p_0))
          (unsafe-end-atomic))))))
(define set-closed-state!
  (lambda (p_0)
    (if (core-port-closed? p_0)
      (void)
      (begin
        (set-core-port-closed?! p_0 #t)
        (let ((s_0 (core-port-closed-sema p_0)))
          (if s_0 (semaphore-post s_0) (void)))))))
(define 1/close-input-port
  (|#%name|
   close-input-port
   (lambda (p_0)
     (begin
       (if (1/input-port? p_0)
         (void)
         (raise-argument-error 'close-input-port "input-port?" p_0))
       (close-port (->core-input-port.1 unsafe-undefined p_0 #f))))))
(define 1/close-output-port
  (|#%name|
   close-output-port
   (lambda (p_0)
     (begin
       (if (1/output-port? p_0)
         (void)
         (raise-argument-error 'close-output-port "output-port?" p_0))
       (close-port (->core-output-port.1 unsafe-undefined p_0 #f))))))
(define 1/port-closed-evt
  (|#%name|
   port-closed-evt
   (lambda (p_0)
     (let ((p_1
            (if (1/input-port? p_0)
              (->core-input-port.1 unsafe-undefined p_0 #f)
              (if (1/output-port? p_0)
                (->core-output-port.1 unsafe-undefined p_0 #f)
                (raise-argument-error 'port-closed-evt "port?" p_0)))))
       (let ((sema_0
              (begin
                (unsafe-start-atomic)
                (begin0
                  (let ((or-part_0 (core-port-closed-sema p_1)))
                    (if or-part_0
                      or-part_0
                      (let ((s_0 (make-semaphore)))
                        (begin
                          (set-core-port-closed-sema! p_1 s_0)
                          (if (core-port-closed? p_1)
                            (semaphore-post s_0)
                            (void))
                          s_0))))
                  (unsafe-end-atomic)))))
         (let ((self_0 unsafe-undefined))
           (set! self_0
             (wrap-evt (semaphore-peek-evt sema_0) (lambda (v_0) self_0)))
           self_0))))))
(define check-not-closed
  (lambda (who_0 cp_0)
    (if (core-port-closed? cp_0)
      (begin
        (unsafe-end-atomic)
        (let ((input?_0 (core-input-port? cp_0)))
          (raise
           (let ((app_0
                  (let ((msg_0
                         (string-append
                          (if input?_0
                            "input port is closed"
                            "output port is closed")
                          "\n  "
                          (if input?_0 "input port: " "output port: ")
                          (error-value->string cp_0))))
                    (error-message->adjusted-string
                     who_0
                     'racket/primitive
                     msg_0
                     'racket/primitive))))
             (|#%app| exn:fail app_0 (current-continuation-marks))))))
      (void))))
(define 1/file-position
  (|#%name|
   file-position
   (case-lambda
    ((p_0)
     (do-simple-file-position
      'file-position
      p_0
      (lambda ()
        (raise
         (let ((app_0
                (let ((msg_0
                       (string-append
                        "the port's current position is not known\n port: "
                        (error-value->string p_0))))
                  (error-message->adjusted-string
                   'file-position
                   'racket/primitive
                   msg_0
                   'racket/primitive))))
           (|#%app|
            exn:fail:filesystem
            app_0
            (current-continuation-marks)))))))
    ((p_0 pos_0)
     (begin
       (if (let ((or-part_0 (1/input-port? p_0)))
             (if or-part_0 or-part_0 (1/output-port? p_0)))
         (void)
         (raise-argument-error 'file-position "port?" p_0))
       (if (let ((or-part_0 (exact-nonnegative-integer? pos_0)))
             (if or-part_0 or-part_0 (eof-object? pos_0)))
         (void)
         (raise-argument-error
          'file-position
          "(or/c exact-nonnegative-integer? eof-object?)"
          pos_0))
       (if (if (number? p_0) (>= pos_0 9223372036854775808) #f)
         (raise-arguments-error
          'file-position
          "new position is too large"
          "port"
          p_0
          "position"
          pos_0)
         (void))
       (let ((cp_0
              (if (1/input-port? p_0)
                (->core-input-port.1 unsafe-undefined p_0 #f)
                (->core-output-port.1 unsafe-undefined p_0 #f))))
         (let ((file-position_0
                (core-port-methods-file-position.1 (core-port-vtable cp_0))))
           (if (if (procedure? file-position_0)
                 (procedure-arity-includes? file-position_0 2)
                 #f)
             (begin
               (unsafe-start-atomic)
               (begin0
                 (begin
                   (check-not-closed 'file-position cp_0)
                   (|#%app| file-position_0 cp_0 pos_0))
                 (unsafe-end-atomic)))
             (raise-arguments-error
              'file-position
              "setting position allowed for file-stream and string ports only"
              "port"
              p_0
              "position"
              pos_0)))))))))
(define 1/file-position*
  (|#%name|
   file-position*
   (lambda (p_0)
     (do-simple-file-position 'file-position* p_0 (lambda () #f)))))
(define do-simple-file-position
  (lambda (who_0 orig-p_0 fail-k_0)
    (let ((p_0
           (if (1/input-port? orig-p_0)
             (->core-input-port.1 unsafe-undefined orig-p_0 #f)
             (if (1/output-port? orig-p_0)
               (->core-output-port.1 unsafe-undefined orig-p_0 #f)
               (raise-argument-error who_0 "port?" orig-p_0)))))
      (begin
        (unsafe-start-atomic)
        (begin
          (check-not-closed who_0 p_0)
          (let ((file-position_0
                 (core-port-methods-file-position.1 (core-port-vtable p_0))))
            (if (let ((or-part_0 (1/input-port? file-position_0)))
                  (if or-part_0 or-part_0 (1/output-port? file-position_0)))
              (begin
                (unsafe-end-atomic)
                (do-simple-file-position who_0 file-position_0 fail-k_0))
              (let ((pos_0
                     (let ((or-part_0
                            (if file-position_0
                              (|#%app| file-position_0 p_0)
                              #f)))
                       (if or-part_0 or-part_0 (get-core-port-offset p_0)))))
                (begin
                  (unsafe-end-atomic)
                  (if pos_0 pos_0 (|#%app| fail-k_0)))))))))))
(define 1/port-count-lines-enabled
  (make-parameter #f (lambda (v_0) (if v_0 #t #f)) 'port-count-lines-enabled))
(define finish-port/count
  (lambda (p_0)
    (begin
      (if (1/port-count-lines-enabled) (1/port-count-lines! p_0) (void))
      p_0)))
(define 1/port-count-lines!
  (|#%name|
   port-count-lines!
   (lambda (p_0)
     (let ((p_1
            (if (1/input-port? p_0)
              (->core-input-port.1 unsafe-undefined p_0 #f)
              (if (1/output-port? p_0)
                (->core-output-port.1 unsafe-undefined p_0 #f)
                (raise-argument-error 'port-count-lines! "port?" p_0)))))
       (begin
         (unsafe-start-atomic)
         (begin0
           (begin
             (check-not-closed 'port-count-lines! p_1)
             (if (core-port-count p_1)
               (void)
               (begin
                 (set-core-port-count!
                  p_1
                  (location3.1
                   #f
                   #f
                   1
                   0
                   (add1
                    (let ((or-part_0 (core-port-offset p_1)))
                      (if or-part_0 or-part_0 0)))))
                 (let ((count-lines!_0
                        (core-port-methods-count-lines!.1
                         (core-port-vtable p_1))))
                   (if count-lines!_0 (|#%app| count-lines!_0 p_1) (void))))))
           (unsafe-end-atomic)))))))
(define 1/port-counts-lines?
  (|#%name|
   port-counts-lines?
   (lambda (p_0)
     (if (core-port-count
          (if (1/input-port? p_0)
            (->core-input-port.1 unsafe-undefined p_0 #f)
            (if (1/output-port? p_0)
              (->core-output-port.1 unsafe-undefined p_0 #f)
              (raise-argument-error 'port-counts-lines? "port?" p_0))))
       #t
       #f))))
(define 1/port-next-location
  (|#%name|
   port-next-location
   (lambda (p_0)
     (let ((p_1
            (if (1/input-port? p_0)
              (->core-input-port.1 unsafe-undefined p_0 #f)
              (if (1/output-port? p_0)
                (->core-output-port.1 unsafe-undefined p_0 #f)
                (raise-argument-error 'port-next-location "port?" p_0)))))
       (let ((loc_0 (core-port-count p_1)))
         (if loc_0
           (begin
             (unsafe-start-atomic)
             (begin0
               (begin
                 (check-not-closed 'port-next-location p_1)
                 (let ((get-location_0
                        (core-port-methods-get-location.1
                         (core-port-vtable p_1))))
                   (if get-location_0
                     (|#%app| get-location_0 p_1)
                     (let ((app_0 (location-line loc_0)))
                       (let ((app_1 (location-column loc_0)))
                         (values app_0 app_1 (location-position loc_0)))))))
               (unsafe-end-atomic)))
           (if (core-port-methods-file-position.1 (core-port-vtable p_1))
             (let ((offset_0
                    (do-simple-file-position
                     'port-next-location
                     p_1
                     (lambda () #f))))
               (values #f #f (if offset_0 (add1 offset_0) #f)))
             (let ((offset_0 (get-core-port-offset p_1)))
               (values #f #f (if offset_0 (add1 offset_0) #f))))))))))
(define 1/set-port-next-location!
  (|#%name|
   set-port-next-location!
   (lambda (p_0 line_0 col_0 pos_0)
     (begin
       (if (let ((or-part_0 (1/input-port? p_0)))
             (if or-part_0 or-part_0 (1/output-port? p_0)))
         (void)
         (raise-argument-error 'set-port-next-location! "port?" p_0))
       (if (let ((or-part_0 (not line_0)))
             (if or-part_0 or-part_0 (exact-positive-integer? line_0)))
         (void)
         (raise-argument-error
          'set-port-next-location!
          "(or/c #f exact-positive-integer?)"
          line_0))
       (if (let ((or-part_0 (not col_0)))
             (if or-part_0 or-part_0 (exact-nonnegative-integer? col_0)))
         (void)
         (raise-argument-error
          'set-port-next-location!
          "(or/c #f exact-nonnegative-integer?)"
          col_0))
       (if (let ((or-part_0 (not pos_0)))
             (if or-part_0 or-part_0 (exact-positive-integer? pos_0)))
         (void)
         (raise-argument-error
          'set-port-next-location!
          "(or/c #f exact-positive-integer?)"
          pos_0))
       (let ((p_1
              (if (1/input-port? p_0)
                (->core-input-port.1 unsafe-undefined p_0 #f)
                (->core-output-port.1 unsafe-undefined p_0 #f))))
         (begin
           (unsafe-start-atomic)
           (begin0
             (let ((loc_0 (core-port-count p_1)))
               (if (if loc_0
                     (not
                      (core-port-methods-get-location.1
                       (core-port-vtable p_1)))
                     #f)
                 (begin
                   (set-location-line! loc_0 line_0)
                   (set-location-column! loc_0 col_0)
                   (set-location-position! loc_0 pos_0))
                 (void)))
             (unsafe-end-atomic))))))))
(define port-count!
  (lambda (in_0 amt_0 bstr_0 start_0)
    (begin
      (increment-offset! in_0 amt_0)
      (let ((loc_0 (core-port-count in_0)))
        (if loc_0
          (let ((end_0 (+ start_0 amt_0)))
            (letrec*
             ((loop_0
               (|#%name|
                loop
                (lambda (i_0
                         span_0
                         line_0
                         column_0
                         position_0
                         state_0
                         cr-state_0)
                  (let ((finish-utf-8_0
                         (|#%name|
                          finish-utf-8
                          (lambda (i_1 abort-mode_0)
                            (call-with-values
                             (lambda ()
                               (let ((temp14_0 (- i_1 span_0)))
                                 (utf-8-decode!.1
                                  abort-mode_0
                                  '#\x3f
                                  state_0
                                  bstr_0
                                  temp14_0
                                  i_1
                                  #f
                                  0
                                  #f)))
                             (lambda (used-bytes_0 got-chars_0 new-state_0)
                               (let ((delta-chars_0
                                      (-
                                       got-chars_0
                                       (+
                                        span_0
                                        (let ((app_0
                                               (if (utf-8-state? state_0)
                                                 (utf-8-state-pending-amt
                                                  state_0)
                                                 0)))
                                          (-
                                           app_0
                                           (if (utf-8-state? new-state_0)
                                             (utf-8-state-pending-amt
                                              new-state_0)
                                             0)))))))
                                 (let ((keep-aborts_0
                                        (|#%name|
                                         keep-aborts
                                         (lambda (s_0)
                                           (if (eq? s_0 'complete) #f s_0)))))
                                   (let ((app_0
                                          (if column_0
                                            (+ column_0 delta-chars_0)
                                            #f)))
                                     (let ((app_1
                                            (if position_0
                                              (+ position_0 delta-chars_0)
                                              #f)))
                                       (loop_0
                                        i_1
                                        0
                                        line_0
                                        app_0
                                        app_1
                                        (keep-aborts_0 new-state_0)
                                        #f)))))))))))
                    (if (= i_0 end_0)
                      (if (zero? span_0)
                        (begin
                          (set-location-line! loc_0 line_0)
                          (set-location-column! loc_0 column_0)
                          (set-location-position! loc_0 position_0)
                          (set-location-state! loc_0 state_0)
                          (set-location-cr-state! loc_0 cr-state_0))
                        (finish-utf-8_0 end_0 'state))
                      (let ((b_0 (unsafe-bytes-ref bstr_0 i_0)))
                        (let ((end-utf-8_0
                               (|#%name|
                                end-utf-8
                                (lambda () (finish-utf-8_0 i_0 'error)))))
                          (if (eq? b_0 10)
                            (if (if state_0 state_0 (not (zero? span_0)))
                              (end-utf-8_0)
                              (if cr-state_0
                                (loop_0
                                 (add1 i_0)
                                 0
                                 line_0
                                 column_0
                                 position_0
                                 #f
                                 #f)
                                (let ((app_0 (add1 i_0)))
                                  (let ((app_1 (if line_0 (add1 line_0) #f)))
                                    (loop_0
                                     app_0
                                     0
                                     app_1
                                     (if column_0 0 #f)
                                     (if position_0 (add1 position_0) #f)
                                     #f
                                     #f)))))
                            (if (eq? b_0 13)
                              (if (if (zero? span_0) (not state_0) #f)
                                (let ((app_0 (add1 i_0)))
                                  (let ((app_1 (if line_0 (add1 line_0) #f)))
                                    (loop_0
                                     app_0
                                     0
                                     app_1
                                     (if column_0 0 #f)
                                     (if position_0 (add1 position_0) #f)
                                     #f
                                     #t)))
                                (end-utf-8_0))
                              (if (eq? b_0 9)
                                (if (if (zero? span_0) (not state_0) #f)
                                  (let ((app_0 (add1 i_0)))
                                    (let ((app_1
                                           (if column_0
                                             (+ (bitwise-and column_0 -8) 8)
                                             #f)))
                                      (loop_0
                                       app_0
                                       0
                                       line_0
                                       app_1
                                       (if position_0 (add1 position_0) #f)
                                       #f
                                       #f)))
                                  (end-utf-8_0))
                                (if (< b_0 128)
                                  (if (if (zero? span_0) (not state_0) #f)
                                    (let ((app_0 (add1 i_0)))
                                      (let ((app_1
                                             (if column_0 (add1 column_0) #f)))
                                        (loop_0
                                         app_0
                                         0
                                         line_0
                                         app_1
                                         (if position_0 (add1 position_0) #f)
                                         #f
                                         #f)))
                                    (let ((app_0 (add1 i_0)))
                                      (let ((app_1 (add1 span_0)))
                                        (let ((app_2
                                               (if column_0
                                                 (add1 column_0)
                                                 #f)))
                                          (loop_0
                                           app_0
                                           app_1
                                           line_0
                                           app_2
                                           (if position_0 (add1 position_0) #f)
                                           state_0
                                           #f)))))
                                  (let ((app_0 (add1 i_0)))
                                    (let ((app_1 (add1 span_0)))
                                      (let ((app_2
                                             (if column_0 (add1 column_0) #f)))
                                        (loop_0
                                         app_0
                                         app_1
                                         line_0
                                         app_2
                                         (if position_0 (add1 position_0) #f)
                                         state_0
                                         #f))))))))))))))))
             (let ((app_0 (location-line loc_0)))
               (let ((app_1 (location-column loc_0)))
                 (let ((app_2 (location-position loc_0)))
                   (let ((app_3 (location-state loc_0)))
                     (loop_0
                      start_0
                      0
                      app_0
                      app_1
                      app_2
                      app_3
                      (location-cr-state loc_0))))))))
          (void))))))
(define port-count-all!
  (lambda (in_0 extra-ins_0 amt_0 bstr_0 start_0)
    (begin
      (port-count! in_0 amt_0 bstr_0 start_0)
      (letrec*
       ((for-loop_0
         (|#%name|
          for-loop
          (lambda (lst_0)
            (if (pair? lst_0)
              (let ((in_1 (unsafe-car lst_0)))
                (let ((rest_0 (unsafe-cdr lst_0)))
                  (begin
                    (port-count! in_1 amt_0 bstr_0 start_0)
                    (for-loop_0 rest_0))))
              (values))))))
       (for-loop_0 extra-ins_0))
      (void))))
(define port-count-byte!
  (lambda (in_0 b_0)
    (begin
      (increment-offset! in_0 1)
      (let ((loc_0 (core-port-count in_0)))
        (if loc_0
          (if (let ((or-part_0 (location-state loc_0)))
                (if or-part_0
                  or-part_0
                  (let ((or-part_1 (location-cr-state loc_0)))
                    (if or-part_1
                      or-part_1
                      (let ((or-part_2 (if (fixnum? b_0) (> b_0 127) #f)))
                        (if or-part_2
                          or-part_2
                          (let ((or-part_3 (eq? b_0 13)))
                            (if or-part_3
                              or-part_3
                              (let ((or-part_4 (eq? b_0 10)))
                                (if or-part_4 or-part_4 (eq? b_0 9)))))))))))
            (port-count! in_0 1 (bytes b_0) 0)
            (let ((column_0 (location-column loc_0)))
              (let ((position_0 (location-position loc_0)))
                (let ((column_1 column_0))
                  (begin
                    (if position_0
                      (set-location-position! loc_0 (add1 position_0))
                      (void))
                    (if column_1
                      (set-location-column! loc_0 (add1 column_1))
                      (void)))))))
          (void))))))
(define port-count-byte-all!
  (lambda (in_0 extra-ins_0 b_0)
    (begin
      (port-count-byte! in_0 b_0)
      (letrec*
       ((for-loop_0
         (|#%name|
          for-loop
          (lambda (lst_0)
            (if (pair? lst_0)
              (let ((in_1 (unsafe-car lst_0)))
                (let ((rest_0 (unsafe-cdr lst_0)))
                  (begin (port-count-byte! in_1 b_0) (for-loop_0 rest_0))))
              (values))))))
       (for-loop_0 extra-ins_0))
      (void))))
(define increment-offset!
  (lambda (in_0 amt_0)
    (if (direct-bstr (core-port-buffer in_0))
      (void)
      (let ((old-offset_0 (core-port-offset in_0)))
        (if old-offset_0
          (set-core-port-offset! in_0 (+ amt_0 old-offset_0))
          (void))))))
(define finish_2616
  (make-struct-type-install-properties
   '(commit-manager)
   3
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1 2)
   #f
   'commit-manager))
(define struct:commit-manager
  (make-record-type-descriptor
   'commit-manager
   #f
   (|#%nongenerative-uid| commit-manager)
   #f
   #f
   '(3 . 0)))
(define effect_2594 (finish_2616 struct:commit-manager))
(define commit-manager1.1
  (|#%name|
   commit-manager
   (record-constructor
    (make-record-constructor-descriptor struct:commit-manager #f #f))))
(define commit-manager?_2038
  (|#%name| commit-manager? (record-predicate struct:commit-manager)))
(define commit-manager?
  (|#%name|
   commit-manager?
   (lambda (v)
     (if (commit-manager?_2038 v)
       #t
       ($value
        (if (impersonator? v)
          (commit-manager?_2038 (impersonator-val v))
          #f))))))
(define commit-manager-pause-channel_2672
  (|#%name|
   commit-manager-pause-channel
   (record-accessor struct:commit-manager 0)))
(define commit-manager-pause-channel
  (|#%name|
   commit-manager-pause-channel
   (lambda (s)
     (if (commit-manager?_2038 s)
       (commit-manager-pause-channel_2672 s)
       ($value
        (impersonate-ref
         commit-manager-pause-channel_2672
         struct:commit-manager
         0
         s
         'pause-channel))))))
(define commit-manager-commit-channel_2862
  (|#%name|
   commit-manager-commit-channel
   (record-accessor struct:commit-manager 1)))
(define commit-manager-commit-channel
  (|#%name|
   commit-manager-commit-channel
   (lambda (s)
     (if (commit-manager?_2038 s)
       (commit-manager-commit-channel_2862 s)
       ($value
        (impersonate-ref
         commit-manager-commit-channel_2862
         struct:commit-manager
         1
         s
         'commit-channel))))))
(define commit-manager-thread_2564
  (|#%name| commit-manager-thread (record-accessor struct:commit-manager 2)))
(define commit-manager-thread
  (|#%name|
   commit-manager-thread
   (lambda (s)
     (if (commit-manager?_2038 s)
       (commit-manager-thread_2564 s)
       ($value
        (impersonate-ref
         commit-manager-thread_2564
         struct:commit-manager
         2
         s
         'thread))))))
(define finish_2581
  (make-struct-type-install-properties
   '(commit-request)
   5
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1 2 3 4)
   #f
   'commit-request))
(define struct:commit-request
  (make-record-type-descriptor
   'commit-request
   #f
   (|#%nongenerative-uid| commit-request)
   #f
   #f
   '(5 . 0)))
(define effect_2646 (finish_2581 struct:commit-request))
(define commit-request2.1
  (|#%name|
   commit-request
   (record-constructor
    (make-record-constructor-descriptor struct:commit-request #f #f))))
(define commit-request?_2595
  (|#%name| commit-request? (record-predicate struct:commit-request)))
(define commit-request?
  (|#%name|
   commit-request?
   (lambda (v)
     (if (commit-request?_2595 v)
       #t
       ($value
        (if (impersonator? v)
          (commit-request?_2595 (impersonator-val v))
          #f))))))
(define commit-request-ext-evt_2428
  (|#%name| commit-request-ext-evt (record-accessor struct:commit-request 0)))
(define commit-request-ext-evt
  (|#%name|
   commit-request-ext-evt
   (lambda (s)
     (if (commit-request?_2595 s)
       (commit-request-ext-evt_2428 s)
       ($value
        (impersonate-ref
         commit-request-ext-evt_2428
         struct:commit-request
         0
         s
         'ext-evt))))))
(define commit-request-progress-evt_2907
  (|#%name|
   commit-request-progress-evt
   (record-accessor struct:commit-request 1)))
(define commit-request-progress-evt
  (|#%name|
   commit-request-progress-evt
   (lambda (s)
     (if (commit-request?_2595 s)
       (commit-request-progress-evt_2907 s)
       ($value
        (impersonate-ref
         commit-request-progress-evt_2907
         struct:commit-request
         1
         s
         'progress-evt))))))
(define commit-request-abandon-evt_2705
  (|#%name|
   commit-request-abandon-evt
   (record-accessor struct:commit-request 2)))
(define commit-request-abandon-evt
  (|#%name|
   commit-request-abandon-evt
   (lambda (s)
     (if (commit-request?_2595 s)
       (commit-request-abandon-evt_2705 s)
       ($value
        (impersonate-ref
         commit-request-abandon-evt_2705
         struct:commit-request
         2
         s
         'abandon-evt))))))
(define commit-request-finish_2610
  (|#%name| commit-request-finish (record-accessor struct:commit-request 3)))
(define commit-request-finish
  (|#%name|
   commit-request-finish
   (lambda (s)
     (if (commit-request?_2595 s)
       (commit-request-finish_2610 s)
       ($value
        (impersonate-ref
         commit-request-finish_2610
         struct:commit-request
         3
         s
         'finish))))))
(define commit-request-result-ch_2336
  (|#%name|
   commit-request-result-ch
   (record-accessor struct:commit-request 4)))
(define commit-request-result-ch
  (|#%name|
   commit-request-result-ch
   (lambda (s)
     (if (commit-request?_2595 s)
       (commit-request-result-ch_2336 s)
       ($value
        (impersonate-ref
         commit-request-result-ch_2336
         struct:commit-request
         4
         s
         'result-ch))))))
(define finish_2113
  (make-struct-type-install-properties
   '(commit-response)
   2
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1)
   #f
   'commit-response))
(define struct:commit-response
  (make-record-type-descriptor
   'commit-response
   #f
   (|#%nongenerative-uid| commit-response)
   #f
   #f
   '(2 . 0)))
(define effect_2529 (finish_2113 struct:commit-response))
(define commit-response3.1
  (|#%name|
   commit-response
   (record-constructor
    (make-record-constructor-descriptor struct:commit-response #f #f))))
(define commit-response?_2041
  (|#%name| commit-response? (record-predicate struct:commit-response)))
(define commit-response?
  (|#%name|
   commit-response?
   (lambda (v)
     (if (commit-response?_2041 v)
       #t
       ($value
        (if (impersonator? v)
          (commit-response?_2041 (impersonator-val v))
          #f))))))
(define commit-response-abandon-evt_3225
  (|#%name|
   commit-response-abandon-evt
   (record-accessor struct:commit-response 0)))
(define commit-response-abandon-evt
  (|#%name|
   commit-response-abandon-evt
   (lambda (s)
     (if (commit-response?_2041 s)
       (commit-response-abandon-evt_3225 s)
       ($value
        (impersonate-ref
         commit-response-abandon-evt_3225
         struct:commit-response
         0
         s
         'abandon-evt))))))
(define commit-response-result-put-evt_2135
  (|#%name|
   commit-response-result-put-evt
   (record-accessor struct:commit-response 1)))
(define commit-response-result-put-evt
  (|#%name|
   commit-response-result-put-evt
   (lambda (s)
     (if (commit-response?_2041 s)
       (commit-response-result-put-evt_2135 s)
       ($value
        (impersonate-ref
         commit-response-result-put-evt_2135
         struct:commit-response
         1
         s
         'result-put-evt))))))
(define make-commit-manager
  (lambda ()
    (let ((pause-ch_0 (make-channel)))
      (let ((commit-ch_0 (make-channel)))
        (commit-manager1.1
         pause-ch_0
         commit-ch_0
         (thread
          (lambda ()
            (letrec*
             ((loop_0
               (|#%name|
                loop
                (lambda (reqs_0 resps_0)
                  (call-with-values
                   (lambda () (poll-commit-liveness reqs_0 resps_0))
                   (lambda (live-reqs_0 new-resps_0)
                     (let ((live-resps_0 (drop-abandoned new-resps_0)))
                       (let ((app_0
                              (handle-evt
                               pause-ch_0
                               (lambda (evt_0)
                                 (begin
                                   (sync evt_0)
                                   (loop_0 live-reqs_0 live-resps_0))))))
                         (let ((app_1
                                (handle-evt
                                 commit-ch_0
                                 (lambda (req_0)
                                   (loop_0
                                    (cons req_0 live-reqs_0)
                                    live-resps_0)))))
                           (apply
                            sync
                            app_0
                            app_1
                            (let ((app_2
                                   (1/reverse
                                    (letrec*
                                     ((for-loop_0
                                       (|#%name|
                                        for-loop
                                        (lambda (fold-var_0 lst_0)
                                          (if (pair? lst_0)
                                            (let ((req_0 (unsafe-car lst_0)))
                                              (let ((rest_0
                                                     (unsafe-cdr lst_0)))
                                                (let ((fold-var_1
                                                       (let ((fold-var_1
                                                              (cons
                                                               (handle-evt
                                                                (commit-request-ext-evt
                                                                 req_0)
                                                                (lambda (v_0)
                                                                  (begin
                                                                    (unsafe-start-atomic)
                                                                    (begin0
                                                                      (|#%app|
                                                                       (commit-request-finish
                                                                        req_0))
                                                                      (unsafe-end-atomic))
                                                                    (let ((app_2
                                                                           (do-remove
                                                                            'remq
                                                                            req_0
                                                                            live-reqs_0
                                                                            eq?)))
                                                                      (loop_0
                                                                       app_2
                                                                       (cons
                                                                        (let ((app_3
                                                                               (commit-request-abandon-evt
                                                                                req_0)))
                                                                          (commit-response3.1
                                                                           app_3
                                                                           (channel-put-evt
                                                                            (commit-request-result-ch
                                                                             req_0)
                                                                            #t)))
                                                                        live-resps_0))))))
                                                               fold-var_0)))
                                                         (values fold-var_1))))
                                                  (for-loop_0
                                                   fold-var_1
                                                   rest_0))))
                                            fold-var_0)))))
                                     (for-loop_0 null live-reqs_0)))))
                              (append
                               app_2
                               (1/reverse
                                (letrec*
                                 ((for-loop_0
                                   (|#%name|
                                    for-loop
                                    (lambda (fold-var_0 lst_0)
                                      (if (pair? lst_0)
                                        (let ((resp_0 (unsafe-car lst_0)))
                                          (let ((rest_0 (unsafe-cdr lst_0)))
                                            (let ((fold-var_1
                                                   (let ((fold-var_1
                                                          (cons
                                                           (handle-evt
                                                            (commit-response-result-put-evt
                                                             resp_0)
                                                            (lambda (ignored_0)
                                                              (loop_0
                                                               live-reqs_0
                                                               (do-remove
                                                                'remq
                                                                resp_0
                                                                live-resps_0
                                                                eq?))))
                                                           fold-var_0)))
                                                     (values fold-var_1))))
                                              (for-loop_0 fold-var_1 rest_0))))
                                        fold-var_0)))))
                                 (for-loop_0 null live-resps_0)))))))))))))))
             (loop_0 '() '())))))))))
(define poll-commit-liveness
  (lambda (reqs_0 resps_0)
    (letrec*
     ((loop_0
       (|#%name|
        loop
        (lambda (reqs_1 live-reqs_0 resps_1)
          (if (null? reqs_1)
            (values live-reqs_0 resps_1)
            (if (sync/timeout 0 (commit-request-progress-evt (car reqs_1)))
              (let ((app_0 (cdr reqs_1)))
                (loop_0
                 app_0
                 live-reqs_0
                 (cons
                  (let ((app_1 (commit-request-abandon-evt (car reqs_1))))
                    (commit-response3.1
                     app_1
                     (channel-put-evt
                      (commit-request-result-ch (car reqs_1))
                      #f)))
                  resps_1)))
              (if (sync/timeout 0 (commit-request-abandon-evt (car reqs_1)))
                (loop_0 (cdr reqs_1) live-reqs_0 resps_1)
                (let ((app_0 (cdr reqs_1)))
                  (loop_0
                   app_0
                   (cons (car reqs_1) live-reqs_0)
                   resps_1)))))))))
     (loop_0 reqs_0 '() resps_0))))
(define drop-abandoned
  (lambda (resps_0)
    (1/reverse
     (letrec*
      ((for-loop_0
        (|#%name|
         for-loop
         (lambda (fold-var_0 lst_0)
           (if (pair? lst_0)
             (let ((resp_0 (unsafe-car lst_0)))
               (let ((rest_0 (unsafe-cdr lst_0)))
                 (let ((fold-var_1
                        (if (sync/timeout
                             0
                             (commit-response-abandon-evt resp_0))
                          fold-var_0
                          (let ((fold-var_1 (cons resp_0 fold-var_0)))
                            (values fold-var_1)))))
                   (for-loop_0 fold-var_1 rest_0))))
             fold-var_0)))))
      (for-loop_0 null resps_0)))))
(define commit-manager-pause
  (lambda (mgr_0)
    (let ((lock_0 (make-semaphore)))
      (let ((suspend-evt_0 (thread-suspend-evt (current-thread))))
        (begin
          (dynamic-wind
           void
           (lambda ()
             (begin
               (unsafe-end-atomic)
               (begin0
                 (begin
                   (let ((app_0 (commit-manager-thread mgr_0)))
                     (thread-resume app_0 (current-thread)))
                   (sync
                    (let ((app_0 (commit-manager-pause-channel mgr_0)))
                      (channel-put-evt
                       app_0
                       (|#%app|
                        1/choice-evt
                        (list
                         lock_0
                         suspend-evt_0
                         (thread-dead-evt (current-thread))))))))
                 (unsafe-start-atomic))))
           (lambda () (semaphore-post lock_0)))
          (if (sync/timeout 0 suspend-evt_0)
            (commit-manager-pause mgr_0)
            (void)))))))
(define commit-manager-wait
  (lambda (mgr_0 progress-evt_0 ext-evt_0 finish_0)
    (let ((result-ch_0 (make-channel)))
      (let ((abandon-evt_0 (make-semaphore)))
        (dynamic-wind
         void
         (lambda ()
           (begin
             (unsafe-end-atomic)
             (begin0
               (begin
                 (sync
                  (let ((app_0 (commit-manager-commit-channel mgr_0)))
                    (channel-put-evt
                     app_0
                     (commit-request2.1
                      ext-evt_0
                      progress-evt_0
                      (|#%app|
                       1/choice-evt
                       (list abandon-evt_0 (thread-dead-evt (current-thread))))
                      finish_0
                      result-ch_0))))
                 (sync result-ch_0))
               (unsafe-start-atomic))))
         (lambda () (semaphore-post abandon-evt_0)))))))
(define finish_3101
  (make-struct-type-install-properties
   '(commit-input-port)
   2
   0
   struct:core-input-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-commit-input-port))
(define struct:commit-input-port
  (make-record-type-descriptor
   'commit-input-port
   struct:core-input-port
   (|#%nongenerative-uid| commit-input-port)
   #f
   #f
   '(2 . 3)))
(define effect_2802 (finish_3101 struct:commit-input-port))
(define create-commit-input-port
  (|#%name|
   create-commit-input-port
   (record-constructor
    (make-record-constructor-descriptor struct:commit-input-port #f #f))))
(define commit-input-port?
  (|#%name| commit-input-port? (record-predicate struct:commit-input-port)))
(define commit-input-port-progress-sema
  (|#%name|
   commit-input-port-progress-sema
   (record-accessor struct:commit-input-port 0)))
(define commit-input-port-commit-manager
  (|#%name|
   commit-input-port-commit-manager
   (record-accessor struct:commit-input-port 1)))
(define set-commit-input-port-progress-sema!
  (|#%name|
   set-commit-input-port-progress-sema!
   (record-mutator struct:commit-input-port 0)))
(define set-commit-input-port-commit-manager!
  (|#%name|
   set-commit-input-port-commit-manager!
   (record-mutator struct:commit-input-port 1)))
(define finish_2744
  (make-struct-type-install-properties
   '(commit-input-port-methods)
   0
   0
   struct:core-input-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'commit-input-port-methods))
(define struct:commit-input-port-methods.1
  (make-record-type-descriptor
   'commit-input-port-methods
   struct:core-input-port-methods.1
   (|#%nongenerative-uid| commit-input-port-methods)
   #f
   #f
   '(0 . 0)))
(define effect_3199 (finish_2744 struct:commit-input-port-methods.1))
(define commit-input-port-methods5.1
  (|#%name|
   commit-input-port-methods
   (record-constructor
    (make-record-constructor-descriptor
     struct:commit-input-port-methods.1
     #f
     #f))))
(define commit-input-port-methods?.1_1864
  (|#%name|
   commit-input-port-methods?
   (record-predicate struct:commit-input-port-methods.1)))
(define commit-input-port-methods?.1
  (|#%name|
   commit-input-port-methods?
   (lambda (v)
     (if (commit-input-port-methods?.1_1864 v)
       #t
       ($value
        (if (impersonator? v)
          (commit-input-port-methods?.1_1864 (impersonator-val v))
          #f))))))
(define commit-input-port-vtable.1
  (let ((app_0 (core-port-methods-close.1 core-input-port-vtable.1)))
    (let ((app_1 (core-port-methods-count-lines!.1 core-input-port-vtable.1)))
      (let ((app_2
             (core-port-methods-get-location.1 core-input-port-vtable.1)))
        (let ((app_3
               (core-port-methods-file-position.1 core-input-port-vtable.1)))
          (let ((app_4
                 (core-port-methods-buffer-mode.1 core-input-port-vtable.1)))
            (let ((app_5
                   (core-input-port-methods-prepare-change.1
                    core-input-port-vtable.1)))
              (let ((app_6
                     (core-input-port-methods-read-in.1
                      core-input-port-vtable.1)))
                (let ((app_7
                       (core-input-port-methods-peek-in.1
                        core-input-port-vtable.1)))
                  (let ((app_8
                         (core-input-port-methods-byte-ready.1
                          core-input-port-vtable.1)))
                    (let ((app_9
                           (core-input-port-methods-get-progress-evt.1
                            core-input-port-vtable.1)))
                      (commit-input-port-methods5.1
                       app_0
                       app_1
                       app_2
                       app_3
                       app_4
                       app_5
                       app_6
                       app_7
                       app_8
                       app_9
                       (core-input-port-methods-commit.1
                        core-input-port-vtable.1)))))))))))))
(define temp1.1
  (|#%name|
   progress!
   (lambda (this-id_0)
     (if (commit-input-port-progress-sema this-id_0)
       (begin
         (semaphore-post (commit-input-port-progress-sema this-id_0))
         (set-commit-input-port-progress-sema! this-id_0 #f))
       (void)))))
(define temp2.1
  (|#%name|
   pause-waiting-commit
   (lambda (this-id_0)
     (if (commit-input-port-commit-manager this-id_0)
       (commit-manager-pause (commit-input-port-commit-manager this-id_0))
       (void)))))
(define temp3.1
  (|#%name|
   wait-commit
   (lambda (this-id_0 progress-evt38_0 ext-evt39_0 finish40_0)
     (if (if (not (commit-input-port-commit-manager this-id_0))
           (if (not (sync/timeout 0 progress-evt38_0))
             (sync/timeout 0 ext-evt39_0)
             #f)
           #f)
       (begin (|#%app| finish40_0) #t)
       (begin
         (if (commit-input-port-commit-manager this-id_0)
           (void)
           (set-commit-input-port-commit-manager!
            this-id_0
            (make-commit-manager)))
         (commit-manager-wait
          (commit-input-port-commit-manager this-id_0)
          progress-evt38_0
          ext-evt39_0
          finish40_0))))))
(define temp4.1
  (|#%name|
   make-progress-evt
   (lambda (this-id_0)
     (begin
       (if (commit-input-port-progress-sema this-id_0)
         (void)
         (set-commit-input-port-progress-sema! this-id_0 (make-semaphore)))
       (semaphore-peek-evt (commit-input-port-progress-sema this-id_0))))))
(define min+1 (lambda (a_0 b_0) (if a_0 (min (add1 a_0) b_0) b_0)))
(define pipe-input-port?*
  (|#%name|
   pipe-input-port?
   (lambda (p_0)
     (let ((cp_0 (->core-input-port.1 unsafe-undefined p_0 #f)))
       (pipe-input-port? p_0)))))
(define pipe-output-port?*
  (|#%name|
   pipe-output-port?
   (lambda (p_0)
     (let ((cp_0 (->core-output-port.1 unsafe-undefined p_0 #f)))
       (pipe-output-port? p_0)))))
(define 1/pipe-port?
  (|#%name|
   pipe-port?
   (lambda (p_0)
     (if (1/input-port? p_0)
       (pipe-input-port?* p_0)
       (if (1/output-port? p_0)
         (pipe-output-port?* p_0)
         (raise-argument-error 'pipe-port? "port?" p_0))))))
(define 1/pipe-content-length
  (|#%name|
   pipe-content-length
   (lambda (p_0)
     (let ((d_0
            (let ((c2_0
                   (let ((p_1 (->core-input-port.1 unsafe-undefined p_0 #f)))
                     (if p_1 (if (pipe-input-port? p_1) p_1 #f) #f))))
              (if c2_0
                (pipe-input-port-d c2_0)
                (let ((c1_0
                       (let ((p_1
                              (->core-output-port.1 unsafe-undefined p_0 #f)))
                         (if p_1 (if (pipe-output-port? p_1) p_1 #f) #f))))
                  (if c1_0
                    (pipe-output-port-d c1_0)
                    (raise-argument-error
                     'pipe-content-length
                     "pipe-port?"
                     p_0)))))))
       (begin
         (unsafe-start-atomic)
         (begin0
           (begin (temp3.1$3 d_0) (temp4.1$2 d_0))
           (unsafe-end-atomic)))))))
(define finish_2207
  (make-struct-type-install-properties
   '(pipe-data)
   16
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '(0)
   #f
   'create-pipe-data))
(define struct:pipe-data
  (make-record-type-descriptor
   'pipe-data
   #f
   (|#%nongenerative-uid| pipe-data)
   #f
   #f
   '(16 . 65534)))
(define effect_3021 (finish_2207 struct:pipe-data))
(define create-pipe-data
  (|#%name|
   create-pipe-data
   (record-constructor
    (make-record-constructor-descriptor struct:pipe-data #f #f))))
(define pipe-data? (|#%name| pipe-data? (record-predicate struct:pipe-data)))
(define pipe-data-vtable
  (|#%name| pipe-data-vtable (record-accessor struct:pipe-data 0)))
(define pipe-data-bstr
  (|#%name| pipe-data-bstr (record-accessor struct:pipe-data 1)))
(define pipe-data-len
  (|#%name| pipe-data-len (record-accessor struct:pipe-data 2)))
(define pipe-data-limit
  (|#%name| pipe-data-limit (record-accessor struct:pipe-data 3)))
(define pipe-data-peeked-amt
  (|#%name| pipe-data-peeked-amt (record-accessor struct:pipe-data 4)))
(define pipe-data-start
  (|#%name| pipe-data-start (record-accessor struct:pipe-data 5)))
(define pipe-data-end
  (|#%name| pipe-data-end (record-accessor struct:pipe-data 6)))
(define pipe-data-input-ref
  (|#%name| pipe-data-input-ref (record-accessor struct:pipe-data 7)))
(define pipe-data-output-ref
  (|#%name| pipe-data-output-ref (record-accessor struct:pipe-data 8)))
(define pipe-data-input-buffer
  (|#%name| pipe-data-input-buffer (record-accessor struct:pipe-data 9)))
(define pipe-data-output-buffer
  (|#%name| pipe-data-output-buffer (record-accessor struct:pipe-data 10)))
(define pipe-data-read-ready-sema
  (|#%name| pipe-data-read-ready-sema (record-accessor struct:pipe-data 11)))
(define pipe-data-write-ready-sema
  (|#%name| pipe-data-write-ready-sema (record-accessor struct:pipe-data 12)))
(define pipe-data-more-read-ready-sema
  (|#%name|
   pipe-data-more-read-ready-sema
   (record-accessor struct:pipe-data 13)))
(define pipe-data-read-ready-evt
  (|#%name| pipe-data-read-ready-evt (record-accessor struct:pipe-data 14)))
(define pipe-data-write-ready-evt
  (|#%name| pipe-data-write-ready-evt (record-accessor struct:pipe-data 15)))
(define set-pipe-data-bstr!
  (|#%name| set-pipe-data-bstr! (record-mutator struct:pipe-data 1)))
(define set-pipe-data-len!
  (|#%name| set-pipe-data-len! (record-mutator struct:pipe-data 2)))
(define set-pipe-data-limit!
  (|#%name| set-pipe-data-limit! (record-mutator struct:pipe-data 3)))
(define set-pipe-data-peeked-amt!
  (|#%name| set-pipe-data-peeked-amt! (record-mutator struct:pipe-data 4)))
(define set-pipe-data-start!
  (|#%name| set-pipe-data-start! (record-mutator struct:pipe-data 5)))
(define set-pipe-data-end!
  (|#%name| set-pipe-data-end! (record-mutator struct:pipe-data 6)))
(define set-pipe-data-input-ref!
  (|#%name| set-pipe-data-input-ref! (record-mutator struct:pipe-data 7)))
(define set-pipe-data-output-ref!
  (|#%name| set-pipe-data-output-ref! (record-mutator struct:pipe-data 8)))
(define set-pipe-data-input-buffer!
  (|#%name| set-pipe-data-input-buffer! (record-mutator struct:pipe-data 9)))
(define set-pipe-data-output-buffer!
  (|#%name| set-pipe-data-output-buffer! (record-mutator struct:pipe-data 10)))
(define set-pipe-data-read-ready-sema!
  (|#%name|
   set-pipe-data-read-ready-sema!
   (record-mutator struct:pipe-data 11)))
(define set-pipe-data-write-ready-sema!
  (|#%name|
   set-pipe-data-write-ready-sema!
   (record-mutator struct:pipe-data 12)))
(define set-pipe-data-more-read-ready-sema!
  (|#%name|
   set-pipe-data-more-read-ready-sema!
   (record-mutator struct:pipe-data 13)))
(define set-pipe-data-read-ready-evt!
  (|#%name|
   set-pipe-data-read-ready-evt!
   (record-mutator struct:pipe-data 14)))
(define set-pipe-data-write-ready-evt!
  (|#%name|
   set-pipe-data-write-ready-evt!
   (record-mutator struct:pipe-data 15)))
(define finish_2129
  (make-struct-type-install-properties
   '(pipe-data-methods)
   0
   0
   #f
   null
   (current-inspector)
   #f
   '()
   #f
   'pipe-data-methods))
(define struct:pipe-data-methods.1
  (make-record-type-descriptor
   'pipe-data-methods
   #f
   (|#%nongenerative-uid| pipe-data-methods)
   #f
   #f
   '(0 . 0)))
(define effect_2537 (finish_2129 struct:pipe-data-methods.1))
(define pipe-data-methods10.1
  (|#%name|
   pipe-data-methods
   (record-constructor
    (make-record-constructor-descriptor struct:pipe-data-methods.1 #f #f))))
(define pipe-data-methods?.1_2563
  (|#%name| pipe-data-methods? (record-predicate struct:pipe-data-methods.1)))
(define pipe-data-methods?.1
  (|#%name|
   pipe-data-methods?
   (lambda (v)
     (if (pipe-data-methods?.1_2563 v)
       #t
       ($value
        (if (impersonator? v)
          (pipe-data-methods?.1_2563 (impersonator-val v))
          #f))))))
(define pipe-data-vtable.1 (pipe-data-methods10.1))
(define temp1.1$2
  (|#%name|
   sync-input
   (lambda (this-id_0)
     (let ((b_0 (pipe-data-input-buffer this-id_0)))
       (if (direct-bstr b_0)
         (let ((pos_0 (direct-pos b_0)))
           (set-pipe-data-start!
            this-id_0
            (if (fx= pos_0 (pipe-data-len this-id_0)) 0 pos_0)))
         (void))))))
(define temp2.1$2
  (|#%name|
   sync-output
   (lambda (this-id_0)
     (let ((b_0 (pipe-data-output-buffer this-id_0)))
       (if (direct-bstr b_0)
         (let ((pos_0 (direct-pos b_0)))
           (set-pipe-data-end!
            this-id_0
            (if (fx= pos_0 (pipe-data-len this-id_0)) 0 pos_0)))
         (void))))))
(define temp3.1$3
  (|#%name|
   sync-both
   (lambda (this-id_0) (begin (temp1.1$2 this-id_0) (temp2.1$2 this-id_0)))))
(define temp4.1$2
  (|#%name|
   content-length
   (lambda (this-id_0)
     (let ((s_0 (pipe-data-start this-id_0)))
       (let ((e_0 (pipe-data-end this-id_0)))
         (if (fx<= s_0 e_0)
           (fx- e_0 s_0)
           (fx+ e_0 (fx- (pipe-data-len this-id_0) s_0))))))))
(define temp5.1$2
  (|#%name|
   input-empty?
   (lambda (this-id_0)
     (let ((app_0 (pipe-data-start this-id_0)))
       (fx= app_0 (pipe-data-end this-id_0))))))
(define temp6.1$2
  (|#%name|
   output-full?
   (lambda (this-id_0)
     (let ((l_0 (pipe-data-limit this-id_0)))
       (if l_0
         (let ((app_0 (temp4.1$2 this-id_0)))
           (>= app_0 (+ l_0 (pipe-data-peeked-amt this-id_0))))
         #f)))))
(define temp7.1$2
  (|#%name|
   check-output-unblocking
   (lambda (this-id_0)
     (if (pipe-data-write-ready-sema this-id_0)
       (begin
         (semaphore-post (pipe-data-write-ready-sema this-id_0))
         (set-pipe-data-write-ready-sema! this-id_0 #f))
       (void)))))
(define temp8.1$1
  (|#%name|
   check-input-unblocking
   (lambda (this-id_0)
     (begin
       (if (pipe-data-read-ready-sema this-id_0)
         (begin
           (semaphore-post (pipe-data-read-ready-sema this-id_0))
           (set-pipe-data-read-ready-sema! this-id_0 #f))
         (void))
       (if (pipe-data-more-read-ready-sema this-id_0)
         (begin
           (semaphore-post (pipe-data-more-read-ready-sema this-id_0))
           (set-pipe-data-more-read-ready-sema! this-id_0 #f))
         (void))))))
(define temp9.1$1
  (|#%name|
   peeked!
   (lambda (this-id_0 amt259_0)
     (if (> amt259_0 (pipe-data-peeked-amt this-id_0))
       (begin
         (temp7.1$2 this-id_0)
         (set-pipe-data-peeked-amt! this-id_0 amt259_0))
       (void)))))
(define make-ref (lambda (v_0) (make-weak-box v_0)))
(define ref-value (lambda (r_0) (weak-box-value r_0)))
(define finish_3163
  (make-struct-type-install-properties
   '(pipe-input-port)
   1
   0
   struct:commit-input-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-pipe-input-port))
(define struct:pipe-input-port
  (make-record-type-descriptor
   'pipe-input-port
   struct:commit-input-port
   (|#%nongenerative-uid| pipe-input-port)
   #f
   #f
   '(1 . 1)))
(define effect_2318 (finish_3163 struct:pipe-input-port))
(define create-pipe-input-port
  (|#%name|
   create-pipe-input-port
   (record-constructor
    (make-record-constructor-descriptor struct:pipe-input-port #f #f))))
(define pipe-input-port?
  (|#%name| pipe-input-port? (record-predicate struct:pipe-input-port)))
(define pipe-input-port-d
  (|#%name| pipe-input-port-d (record-accessor struct:pipe-input-port 0)))
(define set-pipe-input-port-d!
  (|#%name| set-pipe-input-port-d! (record-mutator struct:pipe-input-port 0)))
(define finish_2415
  (make-struct-type-install-properties
   '(pipe-input-port-methods)
   0
   0
   struct:commit-input-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'pipe-input-port-methods))
(define struct:pipe-input-port-methods.1
  (make-record-type-descriptor
   'pipe-input-port-methods
   struct:commit-input-port-methods.1
   (|#%nongenerative-uid| pipe-input-port-methods)
   #f
   #f
   '(0 . 0)))
(define effect_2335 (finish_2415 struct:pipe-input-port-methods.1))
(define pipe-input-port-methods15.1
  (|#%name|
   pipe-input-port-methods
   (record-constructor
    (make-record-constructor-descriptor
     struct:pipe-input-port-methods.1
     #f
     #f))))
(define pipe-input-port-methods?.1_2609
  (|#%name|
   pipe-input-port-methods?
   (record-predicate struct:pipe-input-port-methods.1)))
(define pipe-input-port-methods?.1
  (|#%name|
   pipe-input-port-methods?
   (lambda (v)
     (if (pipe-input-port-methods?.1_2609 v)
       #t
       ($value
        (if (impersonator? v)
          (pipe-input-port-methods?.1_2609 (impersonator-val v))
          #f))))))
(define pipe-input-port-vtable.1
  (let ((app_0 (core-port-methods-get-location.1 commit-input-port-vtable.1)))
    (let ((app_1
           (core-port-methods-file-position.1 commit-input-port-vtable.1)))
      (pipe-input-port-methods15.1
       (|#%name|
        close
        (lambda (this-id_0)
          (let ((o_0 (pipe-input-port-d this-id_0)))
            (if (pipe-data-input-ref o_0)
              (begin
                (temp12.1 this-id_0)
                (set-pipe-data-input-ref! o_0 #f)
                (temp1.1 this-id_0)
                (temp8.1$1 o_0)
                (temp7.1$2 o_0))
              (void)))))
       (|#%name| count-lines! (lambda (this-id_0) (temp12.1 this-id_0)))
       app_0
       app_1
       (core-port-methods-buffer-mode.1 commit-input-port-vtable.1)
       (|#%name|
        prepare-change
        (lambda (this-id_0)
          (let ((o_0 (pipe-input-port-d this-id_0))) (temp2.1 this-id_0))))
       (|#%name|
        read-in
        (lambda (this-id_0
                 dest-bstr396_0
                 dest-start397_0
                 dest-end398_0
                 copy?399_0)
          (begin
            (temp12.1 this-id_0)
            (let ((o_0 (pipe-input-port-d this-id_0)))
              (if (temp5.1$2 o_0)
                (if (pipe-data-output-ref o_0)
                  (pipe-data-read-ready-evt o_0)
                  eof)
                (begin
                  (temp7.1$2 o_0)
                  (let ((s_0 (pipe-data-start o_0)))
                    (let ((e_0 (pipe-data-end o_0)))
                      (let ((amt_0
                             (if (fx< s_0 e_0)
                               (let ((amt_0
                                      (let ((app_2
                                             (fx-
                                              dest-end398_0
                                              dest-start397_0)))
                                        (fxmin app_2 (fx- e_0 s_0)))))
                                 (begin
                                   (let ((app_2 (pipe-data-bstr o_0)))
                                     (unsafe-bytes-copy!
                                      dest-bstr396_0
                                      dest-start397_0
                                      app_2
                                      s_0
                                      (fx+ s_0 amt_0)))
                                   (set-pipe-data-start! o_0 (fx+ s_0 amt_0))
                                   (set-pipe-data-peeked-amt!
                                    o_0
                                    (fxmax
                                     0
                                     (fx- (pipe-data-peeked-amt o_0) amt_0)))
                                   amt_0))
                               (let ((amt_0
                                      (let ((app_2
                                             (fx-
                                              dest-end398_0
                                              dest-start397_0)))
                                        (fxmin
                                         app_2
                                         (fx- (pipe-data-len o_0) s_0)))))
                                 (begin
                                   (let ((app_2 (pipe-data-bstr o_0)))
                                     (unsafe-bytes-copy!
                                      dest-bstr396_0
                                      dest-start397_0
                                      app_2
                                      s_0
                                      (fx+ s_0 amt_0)))
                                   (set-pipe-data-start!
                                    o_0
                                    (let ((app_2 (fx+ s_0 amt_0)))
                                      (modulo app_2 (pipe-data-len o_0))))
                                   (set-pipe-data-peeked-amt!
                                    o_0
                                    (fxmax
                                     0
                                     (fx- (pipe-data-peeked-amt o_0) amt_0)))
                                   amt_0)))))
                        (begin
                          (temp1.1 this-id_0)
                          (temp11.1 this-id_0 amt_0)
                          amt_0))))))))))
       (|#%name|
        peek-in
        (lambda (this-id_0
                 dest-bstr448_0
                 dest-start449_0
                 dest-end450_0
                 skip451_0
                 progress-evt452_0
                 copy?453_0)
          (let ((o_0 (pipe-input-port-d this-id_0)))
            (begin
              (temp3.1$3 o_0)
              (let ((content-amt_0 (temp4.1$2 o_0)))
                (if (if progress-evt452_0
                      (sync/timeout 0 progress-evt452_0)
                      #f)
                  #f
                  (if (<= content-amt_0 skip451_0)
                    (if (not (pipe-data-output-ref o_0))
                      eof
                      (begin
                        (if (let ((or-part_0 (zero? skip451_0)))
                              (if or-part_0
                                or-part_0
                                (pipe-data-more-read-ready-sema o_0)))
                          (void)
                          (begin
                            (set-pipe-data-more-read-ready-sema!
                             o_0
                             (make-semaphore))
                            (let ((out_0
                                   (let ((r_0 (pipe-data-output-ref o_0)))
                                     (weak-box-value r_0))))
                              (if out_0 (temp19.1$1 out_0) (void)))))
                        (let ((evt_0
                               (if (zero? skip451_0)
                                 (pipe-data-read-ready-evt o_0)
                                 (wrap-evt
                                  (semaphore-peek-evt
                                   (pipe-data-more-read-ready-sema o_0))
                                  (lambda (v_0) 0)))))
                          evt_0)))
                    (let ((peek-start_0
                           (let ((app_2 (fx+ (pipe-data-start o_0) skip451_0)))
                             (fxmodulo app_2 (pipe-data-len o_0)))))
                      (if (fx< peek-start_0 (pipe-data-end o_0))
                        (let ((amt_0
                               (let ((app_2
                                      (fx- dest-end450_0 dest-start449_0)))
                                 (fxmin
                                  app_2
                                  (fx- (pipe-data-end o_0) peek-start_0)))))
                          (begin
                            (let ((app_2 (pipe-data-bstr o_0)))
                              (unsafe-bytes-copy!
                               dest-bstr448_0
                               dest-start449_0
                               app_2
                               peek-start_0
                               (fx+ peek-start_0 amt_0)))
                            (temp9.1$1 o_0 (+ skip451_0 amt_0))
                            amt_0))
                        (let ((amt_0
                               (let ((app_2
                                      (fx- dest-end450_0 dest-start449_0)))
                                 (fxmin
                                  app_2
                                  (fx- (pipe-data-len o_0) peek-start_0)))))
                          (begin
                            (let ((app_2 (pipe-data-bstr o_0)))
                              (unsafe-bytes-copy!
                               dest-bstr448_0
                               dest-start449_0
                               app_2
                               peek-start_0
                               (fx+ peek-start_0 amt_0)))
                            (temp9.1$1 o_0 (+ skip451_0 amt_0))
                            amt_0)))))))))))
       (|#%name|
        byte-ready
        (lambda (this-id_0 work-done!504_0)
          (let ((o_0 (pipe-input-port-d this-id_0)))
            (let ((or-part_0 (not (pipe-data-output-ref o_0))))
              (if or-part_0
                or-part_0
                (begin (temp3.1$3 o_0) (not (fx= 0 (temp4.1$2 o_0)))))))))
       (|#%name|
        get-progress-evt
        (lambda (this-id_0)
          (begin
            (unsafe-start-atomic)
            (begin0
              (let ((o_0 (pipe-input-port-d this-id_0)))
                (if (not (pipe-data-input-ref o_0))
                  always-evt
                  (begin (temp12.1 this-id_0) (temp4.1 this-id_0))))
              (unsafe-end-atomic)))))
       (|#%name|
        commit
        (lambda (this-id_0 amt594_0 progress-evt595_0 ext-evt596_0 finish597_0)
          (if (zero? amt594_0)
            (temp1.1 this-id_0)
            (temp3.1
             this-id_0
             progress-evt595_0
             ext-evt596_0
             (lambda ()
               (let ((o_0 (pipe-input-port-d this-id_0)))
                 (begin
                   (temp12.1 this-id_0)
                   (let ((amt_0 (min amt594_0 (temp4.1$2 o_0))))
                     (if (fx= 0 amt_0)
                       (|#%app| finish597_0 #vu8())
                       (let ((dest-bstr_0 (make-bytes amt_0)))
                         (let ((s_0 (pipe-data-start o_0)))
                           (let ((e_0 (pipe-data-end o_0)))
                             (begin
                               (if (fx< s_0 e_0)
                                 (let ((app_2 (pipe-data-bstr o_0)))
                                   (unsafe-bytes-copy!
                                    dest-bstr_0
                                    0
                                    app_2
                                    s_0
                                    (fx+ s_0 amt_0)))
                                 (let ((amt1_0
                                        (fxmin
                                         (fx- (pipe-data-len o_0) s_0)
                                         amt_0)))
                                   (begin
                                     (let ((app_2 (pipe-data-bstr o_0)))
                                       (unsafe-bytes-copy!
                                        dest-bstr_0
                                        0
                                        app_2
                                        s_0
                                        (fx+ s_0 amt1_0)))
                                     (if (fx< amt1_0 amt_0)
                                       (let ((app_2 (pipe-data-bstr o_0)))
                                         (unsafe-bytes-copy!
                                          dest-bstr_0
                                          amt1_0
                                          app_2
                                          0
                                          (fx- amt_0 amt1_0)))
                                       (void)))))
                               (set-pipe-data-start!
                                o_0
                                (let ((app_2 (fx+ s_0 amt_0)))
                                  (fxmodulo app_2 (pipe-data-len o_0))))
                               (temp1.1 this-id_0)
                               (temp11.1 this-id_0 amt_0)
                               (|#%app|
                                finish597_0
                                dest-bstr_0))))))))))))))))))
(define temp13.1
  (|#%name| on-resize (lambda (this-id_0) (temp12.1 this-id_0))))
(define temp14.1
  (|#%name| on-output-full (lambda (this-id_0) (temp12.1 this-id_0))))
(define temp11.1
  (|#%name|
   fast-mode!
   (lambda (this-id_0 amt686_0)
     (let ((o_0 (pipe-input-port-d this-id_0)))
       (let ((s_0 (pipe-data-start o_0)))
         (let ((e_0 (pipe-data-end o_0)))
           (if (fx= s_0 e_0)
             (void)
             (let ((b_0 (core-port-buffer this-id_0)))
               (begin
                 (set-direct-bstr! b_0 (pipe-data-bstr o_0))
                 (begin
                   (set-direct-pos! b_0 s_0)
                   (begin
                     (set-direct-end!
                      b_0
                      (if (fx< s_0 e_0) e_0 (pipe-data-len o_0)))
                     (let ((o_1 (core-port-offset this-id_0)))
                       (if o_1
                         (set-core-port-offset!
                          this-id_0
                          (- (+ o_1 amt686_0) s_0))
                         (void))))))))))))))
(define temp12.1
  (|#%name|
   slow-mode!
   (lambda (this-id_0)
     (let ((o_0 (pipe-input-port-d this-id_0)))
       (let ((b_0 (core-port-buffer this-id_0)))
         (begin
           (if (direct-bstr b_0)
             (let ((pos_0 (direct-pos b_0)))
               (let ((o_1 (core-port-offset this-id_0)))
                 (begin
                   (if o_1
                     (set-core-port-offset! this-id_0 (+ o_1 pos_0))
                     (void))
                   (set-pipe-data-start!
                    o_0
                    (if (fx= pos_0 (pipe-data-len o_0)) 0 pos_0))
                   (set-direct-bstr! b_0 #f)
                   (set-direct-pos! b_0 (direct-end b_0)))))
             (void))
           (temp2.1$2 o_0)))))))
(define finish_2124
  (make-struct-type-install-properties
   '(pipe-output-port)
   1
   0
   struct:core-output-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-pipe-output-port))
(define struct:pipe-output-port
  (make-record-type-descriptor
   'pipe-output-port
   struct:core-output-port
   (|#%nongenerative-uid| pipe-output-port)
   #f
   #f
   '(1 . 1)))
(define effect_2635 (finish_2124 struct:pipe-output-port))
(define create-pipe-output-port
  (|#%name|
   create-pipe-output-port
   (record-constructor
    (make-record-constructor-descriptor struct:pipe-output-port #f #f))))
(define pipe-output-port?
  (|#%name| pipe-output-port? (record-predicate struct:pipe-output-port)))
(define pipe-output-port-d
  (|#%name| pipe-output-port-d (record-accessor struct:pipe-output-port 0)))
(define set-pipe-output-port-d!
  (|#%name|
   set-pipe-output-port-d!
   (record-mutator struct:pipe-output-port 0)))
(define finish_2185
  (make-struct-type-install-properties
   '(pipe-output-port-methods)
   0
   0
   struct:core-output-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'pipe-output-port-methods))
(define struct:pipe-output-port-methods.1
  (make-record-type-descriptor
   'pipe-output-port-methods
   struct:core-output-port-methods.1
   (|#%nongenerative-uid| pipe-output-port-methods)
   #f
   #f
   '(0 . 0)))
(define effect_3193 (finish_2185 struct:pipe-output-port-methods.1))
(define pipe-output-port-methods20.1
  (|#%name|
   pipe-output-port-methods
   (record-constructor
    (make-record-constructor-descriptor
     struct:pipe-output-port-methods.1
     #f
     #f))))
(define pipe-output-port-methods?.1_2695
  (|#%name|
   pipe-output-port-methods?
   (record-predicate struct:pipe-output-port-methods.1)))
(define pipe-output-port-methods?.1
  (|#%name|
   pipe-output-port-methods?
   (lambda (v)
     (if (pipe-output-port-methods?.1_2695 v)
       #t
       ($value
        (if (impersonator? v)
          (pipe-output-port-methods?.1_2695 (impersonator-val v))
          #f))))))
(define pipe-output-port-vtable.1
  (let ((app_0 (core-port-methods-count-lines!.1 core-output-port-vtable.1)))
    (let ((app_1 (core-port-methods-get-location.1 core-output-port-vtable.1)))
      (let ((app_2
             (core-port-methods-file-position.1 core-output-port-vtable.1)))
        (let ((app_3
               (core-port-methods-buffer-mode.1 core-output-port-vtable.1)))
          (let ((app_4
                 (core-output-port-methods-write-out-special.1
                  core-output-port-vtable.1)))
            (let ((app_5
                   (let ((get-write-evt_0
                          (get-write-evt-via-write-out
                           (lambda (out_0 v_0 bstr_0 start_0)
                             (port-count! out_0 v_0 bstr_0 start_0)))))
                     get-write-evt_0)))
              (pipe-output-port-methods20.1
               (|#%name|
                close
                (lambda (this-id_0)
                  (let ((o_0 (pipe-output-port-d this-id_0)))
                    (if (pipe-data-output-ref o_0)
                      (begin
                        (temp17.1 this-id_0)
                        (set-pipe-data-output-ref! o_0 #f)
                        (temp8.1$1 o_0)
                        (temp7.1$2 o_0))
                      (void)))))
               app_0
               app_1
               app_2
               app_3
               (|#%name|
                write-out
                (lambda (this-id_0
                         src-bstr818_0
                         src-start819_0
                         src-end820_0
                         nonblock?821_0
                         enable-break?822_0
                         copy?823_0)
                  (begin
                    (temp17.1 this-id_0)
                    (let ((o_0 (pipe-output-port-d this-id_0)))
                      (letrec*
                       ((try-again_0
                         (|#%name|
                          try-again
                          (lambda ()
                            (let ((top-pos_0
                                   (if (fx= (pipe-data-start o_0) 0)
                                     (fx- (pipe-data-len o_0) 1)
                                     (pipe-data-len o_0))))
                              (letrec*
                               ((maybe-grow_0
                                 (|#%name|
                                  maybe-grow
                                  (lambda (suggested-amt_0)
                                    (if (let ((or-part_0
                                               (not (pipe-data-limit o_0))))
                                          (if or-part_0
                                            or-part_0
                                            (let ((app_6
                                                   (let ((app_6
                                                          (pipe-data-limit
                                                           o_0)))
                                                     (+
                                                      app_6
                                                      (pipe-data-peeked-amt
                                                       o_0)))))
                                              (>
                                               app_6
                                               (fx- (pipe-data-len o_0) 1)))))
                                      (let ((in_0
                                             (let ((r_0
                                                    (pipe-data-input-ref o_0)))
                                               (weak-box-value r_0))))
                                        (begin
                                          (if in_0 (temp13.1 in_0) (void))
                                          (let ((new-bstr_0
                                                 (make-bytes
                                                  (let ((app_6
                                                         (if (pipe-data-limit
                                                              o_0)
                                                           (let ((app_6
                                                                  (pipe-data-limit
                                                                   o_0)))
                                                             (+
                                                              app_6
                                                              (pipe-data-peeked-amt
                                                               o_0)))
                                                           #f)))
                                                    (min+1
                                                     app_6
                                                     (let ((app_7
                                                            (fx*
                                                             (pipe-data-len
                                                              o_0)
                                                             2)))
                                                       (fxmax
                                                        app_7
                                                        (unsafe-fxlshift
                                                         1
                                                         (fxmin
                                                          (integer-length
                                                           suggested-amt_0)
                                                          12)))))))))
                                            (begin
                                              (if (fx= 0 (pipe-data-start o_0))
                                                (let ((app_6
                                                       (pipe-data-bstr o_0)))
                                                  (unsafe-bytes-copy!
                                                   new-bstr_0
                                                   0
                                                   app_6
                                                   0
                                                   (fx-
                                                    (pipe-data-len o_0)
                                                    1)))
                                                (begin
                                                  (let ((app_6
                                                         (pipe-data-bstr o_0)))
                                                    (let ((app_7
                                                           (pipe-data-start
                                                            o_0)))
                                                      (unsafe-bytes-copy!
                                                       new-bstr_0
                                                       0
                                                       app_6
                                                       app_7
                                                       (pipe-data-len o_0))))
                                                  (let ((app_6
                                                         (let ((app_6
                                                                (pipe-data-len
                                                                 o_0)))
                                                           (fx-
                                                            app_6
                                                            (pipe-data-start
                                                             o_0)))))
                                                    (let ((app_7
                                                           (pipe-data-bstr
                                                            o_0)))
                                                      (unsafe-bytes-copy!
                                                       new-bstr_0
                                                       app_6
                                                       app_7
                                                       0
                                                       (pipe-data-end o_0))))
                                                  (set-pipe-data-start! o_0 0)
                                                  (set-pipe-data-end!
                                                   o_0
                                                   (fx-
                                                    (pipe-data-len o_0)
                                                    1))))
                                              (set-pipe-data-bstr!
                                               o_0
                                               new-bstr_0)
                                              (set-pipe-data-len!
                                               o_0
                                               (unsafe-bytes-length
                                                new-bstr_0))
                                              (try-again_0)))))
                                      (pipe-is-full_0)))))
                                (pipe-is-full_0
                                 (|#%name|
                                  pipe-is-full
                                  (lambda ()
                                    (wrap-evt
                                     (pipe-data-write-ready-evt o_0)
                                     (lambda (v_0) #f))))))
                               (let ((apply-limit_0
                                      (|#%name|
                                       apply-limit
                                       (lambda (amt_0)
                                         (if (pipe-data-limit o_0)
                                           (min
                                            amt_0
                                            (let ((app_6
                                                   (let ((app_6
                                                          (pipe-data-limit
                                                           o_0)))
                                                     (+
                                                      app_6
                                                      (pipe-data-peeked-amt
                                                       o_0)))))
                                              (- app_6 (temp4.1$2 o_0))))
                                           amt_0)))))
                                 (if (fx= src-start819_0 src-end820_0)
                                   0
                                   (if (not (pipe-data-input-ref o_0))
                                     (fx- src-end820_0 src-start819_0)
                                     (if (if (let ((app_6 (pipe-data-end o_0)))
                                               (fx>=
                                                app_6
                                                (pipe-data-start o_0)))
                                           (fx< (pipe-data-end o_0) top-pos_0)
                                           #f)
                                       (let ((amt_0
                                              (apply-limit_0
                                               (let ((app_6
                                                      (fx-
                                                       top-pos_0
                                                       (pipe-data-end o_0))))
                                                 (fxmin
                                                  app_6
                                                  (fx-
                                                   src-end820_0
                                                   src-start819_0))))))
                                         (if (fx= amt_0 0)
                                           (pipe-is-full_0)
                                           (begin
                                             (temp8.1$1 o_0)
                                             (let ((app_6
                                                    (pipe-data-bstr o_0)))
                                               (let ((app_7
                                                      (pipe-data-end o_0)))
                                                 (unsafe-bytes-copy!
                                                  app_6
                                                  app_7
                                                  src-bstr818_0
                                                  src-start819_0
                                                  (fx+ src-start819_0 amt_0))))
                                             (let ((new-end_0
                                                    (fx+
                                                     (pipe-data-end o_0)
                                                     amt_0)))
                                               (set-pipe-data-end!
                                                o_0
                                                (if (fx=
                                                     new-end_0
                                                     (pipe-data-len o_0))
                                                  0
                                                  new-end_0)))
                                             (temp16.1 this-id_0 amt_0)
                                             amt_0)))
                                       (if (fx= (pipe-data-end o_0) top-pos_0)
                                         (if (fx= (pipe-data-start o_0) 0)
                                           (maybe-grow_0
                                            (fx- src-end820_0 src-start819_0))
                                           (let ((amt_0
                                                  (let ((app_6
                                                         (fx-
                                                          (pipe-data-start o_0)
                                                          1)))
                                                    (fxmin
                                                     app_6
                                                     (fx-
                                                      src-end820_0
                                                      src-start819_0)))))
                                             (if (fx= amt_0 0)
                                               (pipe-is-full_0)
                                               (begin
                                                 (temp8.1$1 o_0)
                                                 (let ((app_6
                                                        (pipe-data-bstr o_0)))
                                                   (unsafe-bytes-copy!
                                                    app_6
                                                    0
                                                    src-bstr818_0
                                                    src-start819_0
                                                    (fx+
                                                     src-start819_0
                                                     amt_0)))
                                                 (set-pipe-data-end! o_0 amt_0)
                                                 (temp16.1 this-id_0 amt_0)
                                                 amt_0))))
                                         (if (let ((app_6 (pipe-data-end o_0)))
                                               (fx<
                                                app_6
                                                (fx- (pipe-data-start o_0) 1)))
                                           (let ((amt_0
                                                  (apply-limit_0
                                                   (let ((app_6
                                                          (let ((app_6
                                                                 (fx-
                                                                  (pipe-data-start
                                                                   o_0)
                                                                  1)))
                                                            (fx-
                                                             app_6
                                                             (pipe-data-end
                                                              o_0)))))
                                                     (fxmin
                                                      app_6
                                                      (fx-
                                                       src-end820_0
                                                       src-start819_0))))))
                                             (if (fx= amt_0 0)
                                               (pipe-is-full_0)
                                               (begin
                                                 (temp8.1$1 o_0)
                                                 (let ((app_6
                                                        (pipe-data-bstr o_0)))
                                                   (let ((app_7
                                                          (pipe-data-end o_0)))
                                                     (unsafe-bytes-copy!
                                                      app_6
                                                      app_7
                                                      src-bstr818_0
                                                      src-start819_0
                                                      (fx+
                                                       src-start819_0
                                                       amt_0))))
                                                 (set-pipe-data-end!
                                                  o_0
                                                  (fx+
                                                   (pipe-data-end o_0)
                                                   amt_0))
                                                 (temp16.1 this-id_0 amt_0)
                                                 amt_0)))
                                           (maybe-grow_0
                                            (fx-
                                             src-end820_0
                                             src-start819_0))))))))))))))
                       (try-again_0))))))
               app_4
               app_5
               (core-output-port-methods-get-write-special-evt.1
                core-output-port-vtable.1)))))))))
(define temp18.1$1
  (|#%name| on-input-empty (lambda (this-id_0) (temp17.1 this-id_0))))
(define temp19.1$1
  (|#%name| on-need-more-ready (lambda (this-id_0) (temp17.1 this-id_0))))
(define temp16.1
  (|#%name|
   fast-mode!
   (lambda (this-id_0 amt902_0)
     (let ((o_0 (pipe-output-port-d this-id_0)))
       (let ((lim_0 (pipe-data-limit o_0)))
         (let ((avail_0 (if lim_0 (- lim_0 (temp4.1$2 o_0)) #f)))
           (if (let ((or-part_0 (not avail_0)))
                 (if or-part_0 or-part_0 (<= avail_0 0)))
             (let ((s_0 (pipe-data-start o_0)))
               (let ((e_0 (pipe-data-end o_0)))
                 (let ((b_0 (core-port-buffer this-id_0)))
                   (begin
                     (set-direct-bstr! b_0 (pipe-data-bstr o_0))
                     (begin
                       (set-direct-pos! b_0 e_0)
                       (begin
                         (set-direct-end!
                          b_0
                          (let ((end_0
                                 (if (fx<= s_0 e_0)
                                   (if (fx= s_0 0)
                                     (fx- (pipe-data-len o_0) 1)
                                     (pipe-data-len o_0))
                                   (fx- s_0 1))))
                            (if (if avail_0 (> (fx- end_0 e_0) avail_0) #f)
                              (fx+ e_0 avail_0)
                              end_0)))
                         (let ((o_1 (core-port-offset this-id_0)))
                           (if o_1
                             (set-core-port-offset!
                              this-id_0
                              (- (+ o_1 amt902_0) e_0))
                             (void)))))))))
             (void))))))))
(define temp17.1
  (|#%name|
   slow-mode!
   (lambda (this-id_0)
     (let ((o_0 (pipe-output-port-d this-id_0)))
       (let ((b_0 (core-port-buffer this-id_0)))
         (begin
           (if (direct-bstr b_0)
             (let ((pos_0 (direct-pos b_0)))
               (let ((o_1 (core-port-offset this-id_0)))
                 (begin
                   (if o_1
                     (set-core-port-offset! this-id_0 (+ o_1 pos_0))
                     (void))
                   (set-pipe-data-end!
                    o_0
                    (if (fx= pos_0 (pipe-data-len o_0)) 0 pos_0))
                   (set-direct-bstr! b_0 #f)
                   (set-direct-pos! b_0 (direct-end b_0)))))
             (void))
           (temp1.1$2 o_0)))))))
(define make-pipe-ends
  (let ((make-pipe-ends_0
         (|#%name|
          make-pipe-ends
          (lambda (limit21_0 input-name22_0 output-name23_0)
            (let ((len_0 (min+1 limit21_0 63)))
              (let ((d_0
                     (create-pipe-data
                      pipe-data-vtable.1
                      (make-bytes len_0)
                      len_0
                      limit21_0
                      0
                      0
                      0
                      #f
                      #f
                      #f
                      #f
                      #f
                      #f
                      #f
                      #f
                      #f)))
                (let ((write-ready-evt_0
                       (if limit21_0 (pipe-write-poller27.1 d_0) always-evt)))
                  (let ((read-ready-evt_0 (pipe-read-poller28.1 d_0)))
                    (let ((input_0
                           (create-pipe-input-port
                            pipe-input-port-vtable.1
                            input-name22_0
                            (direct2.1 #f 0 0)
                            #f
                            #f
                            0
                            #f
                            #f
                            #f
                            #f
                            #f
                            d_0)))
                      (let ((output_0
                             (create-pipe-output-port
                              pipe-output-port-vtable.1
                              output-name23_0
                              (direct2.1 #f 0 0)
                              #f
                              #f
                              0
                              #f
                              write-ready-evt_0
                              #f
                              #f
                              #f
                              d_0)))
                        (begin
                          (set-pipe-data-input-buffer!
                           d_0
                           (core-port-buffer input_0))
                          (set-pipe-data-output-buffer!
                           d_0
                           (core-port-buffer output_0))
                          (set-pipe-data-input-ref!
                           d_0
                           (make-weak-box input_0))
                          (set-pipe-data-output-ref!
                           d_0
                           (make-weak-box output_0))
                          (set-pipe-data-write-ready-evt!
                           d_0
                           write-ready-evt_0)
                          (set-pipe-data-read-ready-evt! d_0 read-ready-evt_0)
                          (values input_0 output_0))))))))))))
    (case-lambda
     (() (make-pipe-ends_0 #f 'pipe 'pipe))
     ((limit_0 input-name_0 output-name23_0)
      (make-pipe-ends_0 limit_0 input-name_0 output-name23_0))
     ((limit_0 input-name22_0) (make-pipe-ends_0 limit_0 input-name22_0 'pipe))
     ((limit21_0) (make-pipe-ends_0 limit21_0 'pipe 'pipe)))))
(define 1/make-pipe
  (let ((make-pipe_0
         (|#%name|
          make-pipe
          (lambda (limit24_0 input-name25_0 output-name26_0)
            (begin
              (if (let ((or-part_0 (not limit24_0)))
                    (if or-part_0
                      or-part_0
                      (exact-positive-integer? limit24_0)))
                (void)
                (raise-argument-error
                 'make-pipe
                 "(or/c #f exact-positive-integer?)"
                 limit24_0))
              (call-with-values
               (lambda ()
                 (make-pipe-ends limit24_0 input-name25_0 output-name26_0))
               (lambda (ip_0 op_0)
                 (let ((app_0 (finish-port/count ip_0)))
                   (values app_0 (finish-port/count op_0))))))))))
    (|#%name|
     make-pipe
     (case-lambda
      (() (make-pipe_0 #f 'pipe 'pipe))
      ((limit_0 input-name_0 output-name26_0)
       (make-pipe_0 limit_0 input-name_0 output-name26_0))
      ((limit_0 input-name25_0) (make-pipe_0 limit_0 input-name25_0 'pipe))
      ((limit24_0) (make-pipe_0 limit24_0 'pipe 'pipe))))))
(define finish_2341
  (make-struct-type-install-properties
   '(pipe-write-poller)
   1
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (pwp_0 ctx_0)
        (let ((o_0 (pipe-write-poller-d pwp_0)))
          (begin
            (temp3.1$3 o_0)
            (if (let ((or-part_0 (not (temp6.1$2 o_0))))
                  (if or-part_0
                    or-part_0
                    (let ((or-part_1 (not (pipe-data-input-ref o_0))))
                      (if or-part_1
                        or-part_1
                        (not (pipe-data-output-ref o_0))))))
              (values (list pwp_0) #f)
              (begin
                (if (pipe-data-write-ready-sema o_0)
                  (void)
                  (set-pipe-data-write-ready-sema! o_0 (make-semaphore)))
                (let ((in_0
                       (let ((r_0 (pipe-data-input-ref o_0)))
                         (weak-box-value r_0))))
                  (begin
                    (if in_0 (temp14.1 in_0) (void))
                    (values
                     #f
                     (replace-evt
                      (semaphore-peek-evt (pipe-data-write-ready-sema o_0))
                      (lambda (v_0) pwp_0)))))))))))))
   (current-inspector)
   #f
   '(0)
   #f
   'pipe-write-poller))
(define struct:pipe-write-poller
  (make-record-type-descriptor
   'pipe-write-poller
   #f
   (|#%nongenerative-uid| pipe-write-poller)
   #f
   #f
   '(1 . 0)))
(define effect_2599 (finish_2341 struct:pipe-write-poller))
(define pipe-write-poller27.1
  (|#%name|
   pipe-write-poller
   (record-constructor
    (make-record-constructor-descriptor struct:pipe-write-poller #f #f))))
(define pipe-write-poller?_2587
  (|#%name| pipe-write-poller? (record-predicate struct:pipe-write-poller)))
(define pipe-write-poller?
  (|#%name|
   pipe-write-poller?
   (lambda (v)
     (if (pipe-write-poller?_2587 v)
       #t
       ($value
        (if (impersonator? v)
          (pipe-write-poller?_2587 (impersonator-val v))
          #f))))))
(define pipe-write-poller-d_2070
  (|#%name| pipe-write-poller-d (record-accessor struct:pipe-write-poller 0)))
(define pipe-write-poller-d
  (|#%name|
   pipe-write-poller-d
   (lambda (s)
     (if (pipe-write-poller?_2587 s)
       (pipe-write-poller-d_2070 s)
       ($value
        (impersonate-ref
         pipe-write-poller-d_2070
         struct:pipe-write-poller
         0
         s
         'd))))))
(define finish_2262
  (make-struct-type-install-properties
   '(pipe-read-poller)
   1
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (prp_0 ctx_0)
        (let ((o_0 (pipe-read-poller-d prp_0)))
          (begin
            (temp3.1$3 o_0)
            (if (let ((or-part_0 (not (temp5.1$2 o_0))))
                  (if or-part_0
                    or-part_0
                    (let ((or-part_1 (not (pipe-data-output-ref o_0))))
                      (if or-part_1
                        or-part_1
                        (not (pipe-data-input-ref o_0))))))
              (values (list 0) #f)
              (begin
                (if (pipe-data-read-ready-sema o_0)
                  (void)
                  (set-pipe-data-read-ready-sema! o_0 (make-semaphore)))
                (let ((out_0
                       (let ((r_0 (pipe-data-output-ref o_0)))
                         (weak-box-value r_0))))
                  (begin
                    (if out_0 (temp18.1$1 out_0) (void))
                    (values
                     #f
                     (wrap-evt
                      (semaphore-peek-evt (pipe-data-read-ready-sema o_0))
                      (lambda (v_0) 0)))))))))))))
   (current-inspector)
   #f
   '(0)
   #f
   'pipe-read-poller))
(define struct:pipe-read-poller
  (make-record-type-descriptor
   'pipe-read-poller
   #f
   (|#%nongenerative-uid| pipe-read-poller)
   #f
   #f
   '(1 . 0)))
(define effect_2907 (finish_2262 struct:pipe-read-poller))
(define pipe-read-poller28.1
  (|#%name|
   pipe-read-poller
   (record-constructor
    (make-record-constructor-descriptor struct:pipe-read-poller #f #f))))
(define pipe-read-poller?_2227
  (|#%name| pipe-read-poller? (record-predicate struct:pipe-read-poller)))
(define pipe-read-poller?
  (|#%name|
   pipe-read-poller?
   (lambda (v)
     (if (pipe-read-poller?_2227 v)
       #t
       ($value
        (if (impersonator? v)
          (pipe-read-poller?_2227 (impersonator-val v))
          #f))))))
(define pipe-read-poller-d_2582
  (|#%name| pipe-read-poller-d (record-accessor struct:pipe-read-poller 0)))
(define pipe-read-poller-d
  (|#%name|
   pipe-read-poller-d
   (lambda (s)
     (if (pipe-read-poller?_2227 s)
       (pipe-read-poller-d_2582 s)
       ($value
        (impersonate-ref
         pipe-read-poller-d_2582
         struct:pipe-read-poller
         0
         s
         'd))))))
(define finish_2316
  (make-struct-type-install-properties
   '(peek-via-read-input-port)
   5
   0
   struct:commit-input-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-peek-via-read-input-port))
(define struct:peek-via-read-input-port
  (make-record-type-descriptor
   'peek-via-read-input-port
   struct:commit-input-port
   (|#%nongenerative-uid| peek-via-read-input-port)
   #f
   #f
   '(5 . 31)))
(define effect_2578 (finish_2316 struct:peek-via-read-input-port))
(define create-peek-via-read-input-port
  (|#%name|
   create-peek-via-read-input-port
   (record-constructor
    (make-record-constructor-descriptor
     struct:peek-via-read-input-port
     #f
     #f))))
(define peek-via-read-input-port?
  (|#%name|
   peek-via-read-input-port?
   (record-predicate struct:peek-via-read-input-port)))
(define peek-via-read-input-port-bstr
  (|#%name|
   peek-via-read-input-port-bstr
   (record-accessor struct:peek-via-read-input-port 0)))
(define peek-via-read-input-port-pos
  (|#%name|
   peek-via-read-input-port-pos
   (record-accessor struct:peek-via-read-input-port 1)))
(define peek-via-read-input-port-end-pos
  (|#%name|
   peek-via-read-input-port-end-pos
   (record-accessor struct:peek-via-read-input-port 2)))
(define peek-via-read-input-port-peeked-eof?
  (|#%name|
   peek-via-read-input-port-peeked-eof?
   (record-accessor struct:peek-via-read-input-port 3)))
(define peek-via-read-input-port-buffer-mode
  (|#%name|
   peek-via-read-input-port-buffer-mode
   (record-accessor struct:peek-via-read-input-port 4)))
(define set-peek-via-read-input-port-bstr!
  (|#%name|
   set-peek-via-read-input-port-bstr!
   (record-mutator struct:peek-via-read-input-port 0)))
(define set-peek-via-read-input-port-pos!
  (|#%name|
   set-peek-via-read-input-port-pos!
   (record-mutator struct:peek-via-read-input-port 1)))
(define set-peek-via-read-input-port-end-pos!
  (|#%name|
   set-peek-via-read-input-port-end-pos!
   (record-mutator struct:peek-via-read-input-port 2)))
(define set-peek-via-read-input-port-peeked-eof?!
  (|#%name|
   set-peek-via-read-input-port-peeked-eof?!
   (record-mutator struct:peek-via-read-input-port 3)))
(define set-peek-via-read-input-port-buffer-mode!
  (|#%name|
   set-peek-via-read-input-port-buffer-mode!
   (record-mutator struct:peek-via-read-input-port 4)))
(define finish_2372
  (make-struct-type-install-properties
   '(peek-via-read-input-port-methods)
   2
   0
   struct:commit-input-port-methods.1
   null
   (current-inspector)
   #f
   '(0 1)
   #f
   'peek-via-read-input-port-methods))
(define struct:peek-via-read-input-port-methods.1
  (make-record-type-descriptor
   'peek-via-read-input-port-methods
   struct:commit-input-port-methods.1
   (|#%nongenerative-uid| peek-via-read-input-port-methods)
   #f
   #f
   '(2 . 0)))
(define effect_2499 (finish_2372 struct:peek-via-read-input-port-methods.1))
(define peek-via-read-input-port-methods10.1
  (|#%name|
   peek-via-read-input-port-methods
   (record-constructor
    (make-record-constructor-descriptor
     struct:peek-via-read-input-port-methods.1
     #f
     #f))))
(define peek-via-read-input-port-methods?.1_2485
  (|#%name|
   peek-via-read-input-port-methods?
   (record-predicate struct:peek-via-read-input-port-methods.1)))
(define peek-via-read-input-port-methods?.1
  (|#%name|
   peek-via-read-input-port-methods?
   (lambda (v)
     (if (peek-via-read-input-port-methods?.1_2485 v)
       #t
       ($value
        (if (impersonator? v)
          (peek-via-read-input-port-methods?.1_2485 (impersonator-val v))
          #f))))))
(define peek-via-read-input-port-methods-read-in/inner.1_2761
  (|#%name|
   peek-via-read-input-port-methods-read-in/inner
   (record-accessor struct:peek-via-read-input-port-methods.1 0)))
(define peek-via-read-input-port-methods-read-in/inner.1
  (|#%name|
   peek-via-read-input-port-methods-read-in/inner
   (lambda (s)
     (if (peek-via-read-input-port-methods?.1_2485 s)
       (peek-via-read-input-port-methods-read-in/inner.1_2761 s)
       ($value
        (impersonate-ref
         peek-via-read-input-port-methods-read-in/inner.1_2761
         struct:peek-via-read-input-port-methods.1
         0
         s
         'read-in/inner))))))
(define peek-via-read-input-port-methods-byte-ready/inner.1_2519
  (|#%name|
   peek-via-read-input-port-methods-byte-ready/inner
   (record-accessor struct:peek-via-read-input-port-methods.1 1)))
(define peek-via-read-input-port-methods-byte-ready/inner.1
  (|#%name|
   peek-via-read-input-port-methods-byte-ready/inner
   (lambda (s)
     (if (peek-via-read-input-port-methods?.1_2485 s)
       (peek-via-read-input-port-methods-byte-ready/inner.1_2519 s)
       ($value
        (impersonate-ref
         peek-via-read-input-port-methods-byte-ready/inner.1_2519
         struct:peek-via-read-input-port-methods.1
         1
         s
         'byte-ready/inner))))))
(define peek-via-read-input-port-vtable.1
  (let ((app_0 (core-port-methods-count-lines!.1 commit-input-port-vtable.1)))
    (let ((app_1
           (core-port-methods-get-location.1 commit-input-port-vtable.1)))
      (peek-via-read-input-port-methods10.1
       (|#%name| close (lambda (this-id_0) (temp7.1 this-id_0)))
       app_0
       app_1
       (core-port-methods-file-position.1 commit-input-port-vtable.1)
       (|#%name|
        buffer-mode
        (case-lambda
         ((this-id_0) (temp9.1 this-id_0))
         ((this-id_0 mode42_0) (temp9.1 this-id_0 mode42_0))))
       (|#%name| prepare-change (lambda (this-id_0) (temp2.1 this-id_0)))
       (|#%name|
        read-in
        (lambda (this-id_0 dest-bstr131_0 start132_0 end133_0 copy?134_0)
          (begin
            (temp5.1$1 this-id_0)
            (letrec*
             ((try-again_0
               (|#%name|
                try-again
                (lambda ()
                  (if (let ((app_2 (peek-via-read-input-port-pos this-id_0)))
                        (fx<
                         app_2
                         (peek-via-read-input-port-end-pos this-id_0)))
                    (let ((amt_0
                           (let ((app_2
                                  (let ((app_2
                                         (peek-via-read-input-port-end-pos
                                          this-id_0)))
                                    (fx-
                                     app_2
                                     (peek-via-read-input-port-pos
                                      this-id_0)))))
                             (min app_2 (fx- end133_0 start132_0)))))
                      (begin
                        (let ((app_2
                               (peek-via-read-input-port-bstr this-id_0)))
                          (let ((app_3
                                 (peek-via-read-input-port-pos this-id_0)))
                            (unsafe-bytes-copy!
                             dest-bstr131_0
                             start132_0
                             app_2
                             app_3
                             (fx+
                              (peek-via-read-input-port-pos this-id_0)
                              amt_0))))
                        (set-peek-via-read-input-port-pos!
                         this-id_0
                         (fx+ (peek-via-read-input-port-pos this-id_0) amt_0))
                        (temp1.1 this-id_0)
                        (temp4.1$1 this-id_0 amt_0)
                        amt_0))
                    (if (peek-via-read-input-port-peeked-eof? this-id_0)
                      (begin
                        (set-peek-via-read-input-port-peeked-eof?!
                         this-id_0
                         #f)
                        eof)
                      (if (if (eq?
                               'block
                               (peek-via-read-input-port-buffer-mode
                                this-id_0))
                            (let ((app_2 (fx- end133_0 start132_0)))
                              (fx<
                               app_2
                               (unsafe-fxrshift
                                (unsafe-bytes-length
                                 (peek-via-read-input-port-bstr this-id_0))
                                1)))
                            #f)
                        (let ((v_0 (temp1.1$1 this-id_0)))
                          (if (let ((or-part_0 (eqv? v_0 0)))
                                (if or-part_0 or-part_0 (evt? v_0)))
                            v_0
                            (try-again_0)))
                        (let ((v_0
                               (|#%app|
                                (peek-via-read-input-port-methods-read-in/inner.1
                                 (core-port-vtable this-id_0))
                                this-id_0
                                dest-bstr131_0
                                start132_0
                                end133_0
                                copy?134_0
                                #f)))
                          (begin
                            (if (eqv? v_0 0) (void) (temp1.1 this-id_0))
                            v_0)))))))))
             (try-again_0)))))
       (|#%name|
        peek-in
        (lambda (this-id_0
                 dest-bstr168_0
                 start169_0
                 end170_0
                 skip171_0
                 progress-evt172_0
                 copy?173_0)
          (letrec*
           ((try-again_0
             (|#%name|
              try-again
              (lambda ()
                (if (if progress-evt172_0
                      (sync/timeout 0 progress-evt172_0)
                      #f)
                  #f
                  (let ((b_0 (core-port-buffer this-id_0)))
                    (let ((s_0
                           (if (direct-bstr b_0)
                             (direct-pos b_0)
                             (peek-via-read-input-port-pos this-id_0))))
                      (let ((peeked-amt_0
                             (fx-
                              (peek-via-read-input-port-end-pos this-id_0)
                              s_0)))
                        (if (> peeked-amt_0 skip171_0)
                          (let ((amt_0
                                 (let ((app_2 (fx- peeked-amt_0 skip171_0)))
                                   (min app_2 (fx- end170_0 start169_0)))))
                            (let ((s-pos_0 (fx+ s_0 skip171_0)))
                              (begin
                                (let ((app_2
                                       (peek-via-read-input-port-bstr
                                        this-id_0)))
                                  (unsafe-bytes-copy!
                                   dest-bstr168_0
                                   start169_0
                                   app_2
                                   s-pos_0
                                   (fx+ s-pos_0 amt_0)))
                                (if (commit-input-port-progress-sema this-id_0)
                                  (void)
                                  (temp4.1$1 this-id_0 0))
                                amt_0)))
                          (if (peek-via-read-input-port-peeked-eof? this-id_0)
                            eof
                            (begin
                              (temp5.1$1 this-id_0)
                              (let ((v_0
                                     (temp2.1$1
                                      this-id_0
                                      (let ((app_2 (- skip171_0 peeked-amt_0)))
                                        (+ app_2 (fx- end170_0 start169_0))))))
                                (if (temp3.1$2 this-id_0 v_0)
                                  (try-again_0)
                                  v_0)))))))))))))
           (try-again_0))))
       (|#%name|
        byte-ready
        (lambda (this-id_0 work-done!209_0)
          (letrec*
           ((loop_0
             (|#%name|
              loop
              (lambda ()
                (let ((b_0 (core-port-buffer this-id_0)))
                  (let ((peeked-amt_0
                         (let ((app_2
                                (peek-via-read-input-port-end-pos this-id_0)))
                           (fx-
                            app_2
                            (if (direct-bstr b_0)
                              (direct-pos b_0)
                              (peek-via-read-input-port-pos this-id_0))))))
                    (if (fx> peeked-amt_0 0)
                      #t
                      (if (peek-via-read-input-port-peeked-eof? this-id_0)
                        #t
                        (let ((c1_0
                               (|#%app|
                                (peek-via-read-input-port-methods-byte-ready/inner.1
                                 (core-port-vtable this-id_0))
                                this-id_0
                                work-done!209_0)))
                          (if c1_0
                            (if (not (eq? c1_0 'not-ready)) c1_0 #f)
                            (begin
                              (temp5.1$1 this-id_0)
                              (let ((v_0 (temp1.1$1 this-id_0)))
                                (begin
                                  (|#%app| work-done!209_0)
                                  (if (temp3.1$2 this-id_0 v_0)
                                    (loop_0)
                                    (if (evt? v_0)
                                      v_0
                                      (not (eqv? v_0 0)))))))))))))))))
           (loop_0))))
       (|#%name|
        get-progress-evt
        (lambda (this-id_0)
          (begin
            (unsafe-start-atomic)
            (begin0
              (begin (temp5.1$1 this-id_0) (temp4.1 this-id_0))
              (unsafe-end-atomic)))))
       (|#%name|
        commit
        (lambda (this-id_0 amt269_0 progress-evt270_0 ext-evt271_0 finish272_0)
          (begin
            (temp5.1$1 this-id_0)
            (temp3.1
             this-id_0
             progress-evt270_0
             ext-evt271_0
             (lambda ()
               (let ((amt_0
                      (fxmin
                       amt269_0
                       (let ((app_2
                              (peek-via-read-input-port-end-pos this-id_0)))
                         (fx-
                          app_2
                          (peek-via-read-input-port-pos this-id_0))))))
                 (if (fx= 0 amt_0)
                   (|#%app| finish272_0 #vu8())
                   (let ((dest-bstr_0 (make-bytes amt_0)))
                     (begin
                       (let ((app_2 (peek-via-read-input-port-bstr this-id_0)))
                         (let ((app_3
                                (peek-via-read-input-port-pos this-id_0)))
                           (unsafe-bytes-copy!
                            dest-bstr_0
                            0
                            app_2
                            app_3
                            (fx+
                             (peek-via-read-input-port-pos this-id_0)
                             amt_0))))
                       (set-peek-via-read-input-port-pos!
                        this-id_0
                        (fx+ (peek-via-read-input-port-pos this-id_0) amt_0))
                       (temp1.1 this-id_0)
                       (|#%app| finish272_0 dest-bstr_0))))))))))
       (|#%name|
        read-in/inner
        (lambda (this-id_0
                 dest-bstr306_0
                 start307_0
                 end308_0
                 copy?309_0
                 to-buffer?310_0)
          0))
       (|#%name| byte-ready/inner (lambda (this-id_0 work-done!345_0) #f))))))
(define temp6.1$1
  (|#%name|
   purge-buffer
   (lambda (this-id_0)
     (begin
       (temp5.1$1 this-id_0)
       (set-peek-via-read-input-port-pos! this-id_0 0)
       (set-peek-via-read-input-port-end-pos! this-id_0 0)
       (set-peek-via-read-input-port-peeked-eof?! this-id_0 #f)))))
(define temp7.1
  (|#%name|
   close-peek-buffer
   (lambda (this-id_0)
     (begin
       (temp6.1$1 this-id_0)
       (set-peek-via-read-input-port-bstr! this-id_0 #vu8())
       (temp1.1 this-id_0)))))
(define temp8.1
  (|#%name|
   buffer-adjust-pos
   (lambda (this-id_0 i434_0 is-converted435_0)
     (let ((b_0 (core-port-buffer this-id_0)))
       (let ((start-pos_0
              (if (direct-bstr b_0)
                (direct-pos b_0)
                (peek-via-read-input-port-pos this-id_0))))
         (let ((r_0
                (-
                 i434_0
                 (fx-
                  (peek-via-read-input-port-end-pos this-id_0)
                  start-pos_0))))
           (if is-converted435_0
             (letrec*
              ((loop_0
                (|#%name|
                 loop
                 (lambda (pos_0 r_1)
                   (if (fx= pos_0 (peek-via-read-input-port-end-pos this-id_0))
                     r_1
                     (let ((app_0 (fx+ pos_0 1)))
                       (loop_0
                        app_0
                        (if (eqv? 0 (unsafe-bytes-ref is-converted435_0 pos_0))
                          r_1
                          (- r_1 1)))))))))
              (loop_0 start-pos_0 r_0))
             r_0)))))))
(define temp9.1
  (|#%name|
   default-buffer-mode
   (case-lambda
    ((this-id_0) (peek-via-read-input-port-buffer-mode this-id_0))
    ((this-id_0 mode467_0)
     (set-peek-via-read-input-port-buffer-mode! this-id_0 mode467_0)))))
(define temp1.1$1
  (let ((pull-some-bytes_0
         (|#%name|
          pull-some-bytes
          (lambda (this-id533_0 amt527530_0 offset528531_0 init-pos529532_0)
            (let ((amt527_0
                   (if (eq? amt527530_0 unsafe-undefined)
                     (if (eq?
                          'block
                          (peek-via-read-input-port-buffer-mode this-id533_0))
                       (unsafe-bytes-length
                        (peek-via-read-input-port-bstr this-id533_0))
                       1)
                     amt527530_0)))
              (let ((offset528_0
                     (if (eq? offset528531_0 unsafe-undefined)
                       0
                       offset528531_0)))
                (let ((init-pos529_0
                       (if (eq? init-pos529532_0 unsafe-undefined)
                         0
                         init-pos529532_0)))
                  (let ((get-end_0
                         (let ((app_0 (+ amt527_0 offset528_0)))
                           (min
                            app_0
                            (unsafe-bytes-length
                             (peek-via-read-input-port-bstr this-id533_0))))))
                    (let ((v_0
                           (let ((app_0
                                  (peek-via-read-input-port-methods-read-in/inner.1
                                   (core-port-vtable this-id533_0))))
                             (|#%app|
                              app_0
                              this-id533_0
                              (peek-via-read-input-port-bstr this-id533_0)
                              offset528_0
                              get-end_0
                              #f
                              #t))))
                      (if (eof-object? v_0)
                        (begin
                          (set-peek-via-read-input-port-peeked-eof?!
                           this-id533_0
                           #t)
                          eof)
                        (if (evt? v_0)
                          v_0
                          (if (eqv? v_0 0)
                            0
                            (begin
                              (set-peek-via-read-input-port-pos!
                               this-id533_0
                               init-pos529_0)
                              (set-peek-via-read-input-port-end-pos!
                               this-id533_0
                               (fx+ offset528_0 v_0))
                              v_0)))))))))))))
    (|#%name|
     pull-some-bytes
     (case-lambda
      ((this-id_0)
       (pull-some-bytes_0
        this-id_0
        unsafe-undefined
        unsafe-undefined
        unsafe-undefined))
      ((this-id_0 amt527_0 offset528_0 init-pos529532_0)
       (pull-some-bytes_0 this-id_0 amt527_0 offset528_0 init-pos529532_0))
      ((this-id_0 amt527_0 offset528531_0)
       (pull-some-bytes_0 this-id_0 amt527_0 offset528531_0 unsafe-undefined))
      ((this-id_0 amt527530_0)
       (pull-some-bytes_0
        this-id_0
        amt527530_0
        unsafe-undefined
        unsafe-undefined))))))
(define temp2.1$1
  (|#%name|
   pull-more-bytes
   (lambda (this-id_0 amt656_0)
     (if (let ((app_0 (peek-via-read-input-port-end-pos this-id_0)))
           (fx<
            app_0
            (unsafe-bytes-length (peek-via-read-input-port-bstr this-id_0))))
       (let ((pull-amt_0
              (if (eq? 'block (peek-via-read-input-port-buffer-mode this-id_0))
                (let ((app_0
                       (unsafe-bytes-length
                        (peek-via-read-input-port-bstr this-id_0))))
                  (fx- app_0 (peek-via-read-input-port-end-pos this-id_0)))
                amt656_0)))
         (let ((app_0 (peek-via-read-input-port-end-pos this-id_0)))
           (temp1.1$1
            this-id_0
            pull-amt_0
            app_0
            (peek-via-read-input-port-pos this-id_0))))
       (if (fx= (peek-via-read-input-port-pos this-id_0) 0)
         (let ((new-bstr_0
                (make-bytes
                 (fx*
                  2
                  (unsafe-bytes-length
                   (peek-via-read-input-port-bstr this-id_0))))))
           (begin
             (let ((app_0 (peek-via-read-input-port-bstr this-id_0)))
               (unsafe-bytes-copy!
                new-bstr_0
                0
                app_0
                0
                (peek-via-read-input-port-end-pos this-id_0)))
             (set-peek-via-read-input-port-bstr! this-id_0 new-bstr_0)
             (temp1.1$1
              this-id_0
              amt656_0
              (peek-via-read-input-port-end-pos this-id_0))))
         (begin
           (let ((app_0 (peek-via-read-input-port-bstr this-id_0)))
             (let ((app_1 (peek-via-read-input-port-bstr this-id_0)))
               (let ((app_2 (peek-via-read-input-port-pos this-id_0)))
                 (unsafe-bytes-copy!
                  app_0
                  0
                  app_1
                  app_2
                  (peek-via-read-input-port-end-pos this-id_0)))))
           (set-peek-via-read-input-port-end-pos!
            this-id_0
            (let ((app_0 (peek-via-read-input-port-end-pos this-id_0)))
              (fx- app_0 (peek-via-read-input-port-pos this-id_0))))
           (set-peek-via-read-input-port-pos! this-id_0 0)
           (temp2.1$1 this-id_0 amt656_0)))))))
(define temp3.1$2
  (|#%name|
   retry-pull?
   (lambda (this-id_0 v687_0)
     (if (integer? v687_0) (not (eqv? v687_0 0)) #f))))
(define temp4.1$1
  (|#%name|
   fast-mode!
   (lambda (this-id_0 amt718_0)
     (let ((b_0 (core-port-buffer this-id_0)))
       (begin
         (set-direct-bstr! b_0 (peek-via-read-input-port-bstr this-id_0))
         (let ((s_0 (peek-via-read-input-port-pos this-id_0)))
           (begin
             (set-direct-pos! b_0 s_0)
             (begin
               (set-direct-end!
                b_0
                (peek-via-read-input-port-end-pos this-id_0))
               (let ((o_0 (core-port-offset this-id_0)))
                 (if o_0
                   (set-core-port-offset! this-id_0 (- (+ o_0 amt718_0) s_0))
                   (void)))))))))))
(define temp5.1$1
  (|#%name|
   slow-mode!
   (lambda (this-id_0)
     (let ((b_0 (core-port-buffer this-id_0)))
       (if (direct-bstr b_0)
         (let ((s_0 (direct-pos b_0)))
           (let ((o_0 (core-port-offset this-id_0)))
             (begin
               (if o_0 (set-core-port-offset! this-id_0 (+ o_0 s_0)) (void))
               (set-peek-via-read-input-port-pos! this-id_0 s_0)
               (set-direct-bstr! b_0 #f)
               (set-direct-pos! b_0 (direct-end b_0)))))
         (void))))))
(define-values
 (prop:file-stream file-stream? file-stream-ref)
 (make-struct-type-property 'file-stream))
(define 1/file-stream-port?
  (|#%name|
   file-stream-port?
   (lambda (p_0)
     (let ((core-port_0
            (let ((or-part_0 (->core-input-port.1 #f p_0 #f)))
              (if or-part_0 or-part_0 (->core-output-port.1 #f p_0 #f)))))
       (if (file-stream-ref core-port_0 #f) #t #f)))))
(define-values
 (prop:file-truncate file-truncate? file-truncate-ref)
 (make-struct-type-property 'file-truncate))
(define 1/file-truncate
  (|#%name|
   file-truncate
   (lambda (p_0 pos_0)
     (begin
       (if (if (1/output-port? p_0) (1/file-stream-port? p_0) #f)
         (void)
         (raise-argument-error
          'file-truncate
          "(and/c output-port? file-stream-port?)"
          p_0))
       (if (exact-nonnegative-integer? pos_0)
         (void)
         (raise-argument-error
          'file-truncate
          "exact-nonnegative-integer?"
          pos_0))
       (unsafe-start-atomic)
       (begin0
         (begin
           (check-not-closed 'file-truncate p_0)
           (let ((p_1 (->core-output-port.1 unsafe-undefined p_0 #f)))
             (|#%app| (file-truncate-ref p_1) p_1 pos_0)))
         (unsafe-end-atomic))))))
(define 1/file-stream-buffer-mode
  (|#%name|
   file-stream-buffer-mode
   (case-lambda
    ((p_0)
     (let ((p_1
            (if (1/input-port? p_0)
              (->core-input-port.1 unsafe-undefined p_0 #f)
              (if (1/output-port? p_0)
                (->core-output-port.1 unsafe-undefined p_0 #f)
                (raise-argument-error 'file-stream-buffer-mode "port?" p_0)))))
       (let ((buffer-mode_0
              (core-port-methods-buffer-mode.1 (core-port-vtable p_1))))
         (begin
           (unsafe-start-atomic)
           (begin0
             (begin
               (check-not-closed 'file-stream-buffer-mode p_1)
               (if buffer-mode_0 (|#%app| buffer-mode_0 p_1) #f))
             (unsafe-end-atomic))))))
    ((p_0 mode_0)
     (begin
       (if (let ((or-part_0 (1/input-port? p_0)))
             (if or-part_0 or-part_0 (1/output-port? p_0)))
         (void)
         (raise-argument-error 'file-stream-buffer-mode "port?" p_0))
       (begin
         (if (let ((or-part_0 (eq? mode_0 'none)))
               (if or-part_0
                 or-part_0
                 (let ((or-part_1 (eq? mode_0 'line)))
                   (if or-part_1 or-part_1 (eq? mode_0 'block)))))
           (void)
           (raise-argument-error
            'file-stream-buffer-mode
            "(or/c 'none 'line 'block)"
            mode_0))
         (begin
           (if (if (eq? mode_0 'line) (not (1/output-port? p_0)) #f)
             (raise-arguments-error
              'file-stream-buffer-mode
              "'line buffering not supported for an input port"
              "port"
              p_0)
             (void))
           (let ((set-buffer-mode_0
                  (|#%name|
                   set-buffer-mode
                   (lambda (p_1)
                     (begin
                       (unsafe-start-atomic)
                       (begin0
                         (begin
                           (check-not-closed 'file-stream-buffer-mode p_1)
                           (let ((buffer-mode_0
                                  (core-port-methods-buffer-mode.1
                                   (core-port-vtable p_1))))
                             (if buffer-mode_0
                               (begin (|#%app| buffer-mode_0 p_1 mode_0) #t)
                               #f)))
                         (unsafe-end-atomic)))))))
             (begin
               (if (1/input-port? p_0)
                 (let ((or-part_0
                        (set-buffer-mode_0
                         (->core-input-port.1 unsafe-undefined p_0 #f))))
                   (if or-part_0
                     or-part_0
                     (raise-arguments-error
                      'file-stream-buffer-mode
                      "buffering not supported for input port"
                      "mode"
                      mode_0
                      "input port"
                      p_0)))
                 (let ((or-part_0
                        (set-buffer-mode_0
                         (->core-output-port.1 unsafe-undefined p_0 #f))))
                   (if or-part_0
                     or-part_0
                     (raise-arguments-error
                      'file-stream-buffer-mode
                      "buffering not supported for output port"
                      "mode"
                      mode_0
                      "output port"
                      p_0))))
               (void))))))))))
(define fd-close.1
  (|#%name|
   fd-close
   (lambda (discard-errors?1_0 fd3_0 fd-refcount4_0)
     (begin
       (set-box! fd-refcount4_0 (sub1 (unbox fd-refcount4_0)))
       (if (zero? (unbox fd-refcount4_0))
         (begin
           (fd-semaphore-update! fd3_0 'remove)
           (let ((v_0
                  (|#%app| rktio_close (unsafe-place-local-ref cell.1) fd3_0)))
             (if (if (vector? v_0) (not discard-errors?1_0) #f)
               (begin
                 (unsafe-end-atomic)
                 (let ((base-msg_0 "error closing stream port"))
                   (raise
                    (let ((app_0
                           (let ((msg_0
                                  (string-append
                                   base-msg_0
                                   "\n  system error: "
                                   (format-rktio-system-error-message v_0))))
                             (error-message->adjusted-string
                              #f
                              'racket/primitive
                              msg_0
                              'racket/primitive))))
                      (|#%app| exn:fail app_0 (current-continuation-marks))))))
               (void))))
         (void))))))
(define finish_2841
  (make-struct-type-install-properties
   '(fd-input-port)
   4
   0
   struct:peek-via-read-input-port
   (list
    (cons prop:authentic #t)
    (cons
     prop:place-message
     (lambda (port_0) (lambda () (fd-port->place-message port_0))))
    (cons prop:file-stream (lambda (p_0) (fd-input-port-fd p_0))))
   (current-inspector)
   #f
   '()
   #f
   'create-fd-input-port))
(define struct:fd-input-port
  (make-record-type-descriptor
   'fd-input-port
   struct:peek-via-read-input-port
   (|#%nongenerative-uid| fd-input-port)
   #f
   #f
   '(4 . 15)))
(define effect_1979 (finish_2841 struct:fd-input-port))
(define create-fd-input-port
  (|#%name|
   create-fd-input-port
   (record-constructor
    (make-record-constructor-descriptor struct:fd-input-port #f #f))))
(define fd-input-port?
  (|#%name| fd-input-port? (record-predicate struct:fd-input-port)))
(define fd-input-port-fd
  (|#%name| fd-input-port-fd (record-accessor struct:fd-input-port 0)))
(define fd-input-port-fd-refcount
  (|#%name|
   fd-input-port-fd-refcount
   (record-accessor struct:fd-input-port 1)))
(define fd-input-port-custodian-reference
  (|#%name|
   fd-input-port-custodian-reference
   (record-accessor struct:fd-input-port 2)))
(define fd-input-port-is-converted
  (|#%name|
   fd-input-port-is-converted
   (record-accessor struct:fd-input-port 3)))
(define set-fd-input-port-fd!
  (|#%name| set-fd-input-port-fd! (record-mutator struct:fd-input-port 0)))
(define set-fd-input-port-fd-refcount!
  (|#%name|
   set-fd-input-port-fd-refcount!
   (record-mutator struct:fd-input-port 1)))
(define set-fd-input-port-custodian-reference!
  (|#%name|
   set-fd-input-port-custodian-reference!
   (record-mutator struct:fd-input-port 2)))
(define set-fd-input-port-is-converted!
  (|#%name|
   set-fd-input-port-is-converted!
   (record-mutator struct:fd-input-port 3)))
(define finish_2012
  (make-struct-type-install-properties
   '(fd-input-port-methods)
   2
   0
   struct:peek-via-read-input-port-methods.1
   null
   (current-inspector)
   #f
   '(0 1)
   #f
   'fd-input-port-methods))
(define struct:fd-input-port-methods.1
  (make-record-type-descriptor
   'fd-input-port-methods
   struct:peek-via-read-input-port-methods.1
   (|#%nongenerative-uid| fd-input-port-methods)
   #f
   #f
   '(2 . 0)))
(define effect_2420 (finish_2012 struct:fd-input-port-methods.1))
(define fd-input-port-methods6.1
  (|#%name|
   fd-input-port-methods
   (record-constructor
    (make-record-constructor-descriptor
     struct:fd-input-port-methods.1
     #f
     #f))))
(define fd-input-port-methods?.1_2579
  (|#%name|
   fd-input-port-methods?
   (record-predicate struct:fd-input-port-methods.1)))
(define fd-input-port-methods?.1
  (|#%name|
   fd-input-port-methods?
   (lambda (v)
     (if (fd-input-port-methods?.1_2579 v)
       #t
       ($value
        (if (impersonator? v)
          (fd-input-port-methods?.1_2579 (impersonator-val v))
          #f))))))
(define fd-input-port-methods-on-close.1_2944
  (|#%name|
   fd-input-port-methods-on-close
   (record-accessor struct:fd-input-port-methods.1 0)))
(define fd-input-port-methods-on-close.1
  (|#%name|
   fd-input-port-methods-on-close
   (lambda (s)
     (if (fd-input-port-methods?.1_2579 s)
       (fd-input-port-methods-on-close.1_2944 s)
       ($value
        (impersonate-ref
         fd-input-port-methods-on-close.1_2944
         struct:fd-input-port-methods.1
         0
         s
         'on-close))))))
(define fd-input-port-methods-raise-read-error.1_2306
  (|#%name|
   fd-input-port-methods-raise-read-error
   (record-accessor struct:fd-input-port-methods.1 1)))
(define fd-input-port-methods-raise-read-error.1
  (|#%name|
   fd-input-port-methods-raise-read-error
   (lambda (s)
     (if (fd-input-port-methods?.1_2579 s)
       (fd-input-port-methods-raise-read-error.1_2306 s)
       ($value
        (impersonate-ref
         fd-input-port-methods-raise-read-error.1_2306
         struct:fd-input-port-methods.1
         1
         s
         'raise-read-error))))))
(define fd-input-port-vtable.1
  (let ((app_0
         (core-port-methods-count-lines!.1 peek-via-read-input-port-vtable.1)))
    (let ((app_1
           (core-port-methods-get-location.1
            peek-via-read-input-port-vtable.1)))
      (let ((app_2
             (core-port-methods-buffer-mode.1
              peek-via-read-input-port-vtable.1)))
        (let ((app_3
               (core-input-port-methods-prepare-change.1
                peek-via-read-input-port-vtable.1)))
          (let ((app_4
                 (core-input-port-methods-read-in.1
                  peek-via-read-input-port-vtable.1)))
            (let ((app_5
                   (core-input-port-methods-peek-in.1
                    peek-via-read-input-port-vtable.1)))
              (let ((app_6
                     (core-input-port-methods-byte-ready.1
                      peek-via-read-input-port-vtable.1)))
                (let ((app_7
                       (core-input-port-methods-get-progress-evt.1
                        peek-via-read-input-port-vtable.1)))
                  (fd-input-port-methods6.1
                   (|#%name|
                    close
                    (lambda (this-id_0)
                      (begin
                        (|#%app|
                         (fd-input-port-methods-on-close.1
                          (core-port-vtable this-id_0))
                         this-id_0)
                        (let ((fd76_0 (fd-input-port-fd this-id_0)))
                          (let ((fd-refcount77_0
                                 (fd-input-port-fd-refcount this-id_0)))
                            (let ((fd76_1 fd76_0))
                              (fd-close.1 #f fd76_1 fd-refcount77_0))))
                        (|#%app|
                         1/unsafe-custodian-unregister
                         this-id_0
                         (fd-input-port-custodian-reference this-id_0))
                        (temp7.1 this-id_0))))
                   app_0
                   app_1
                   (|#%name|
                    file-position
                    (case-lambda
                     ((this-id_0)
                      (let ((pos_0
                             (get-file-position (fd-input-port-fd this-id_0))))
                        (if pos_0
                          (temp8.1
                           this-id_0
                           pos_0
                           (fd-input-port-is-converted this-id_0))
                          #f)))
                     ((this-id_0 pos78_0)
                      (begin
                        (temp6.1$1 this-id_0)
                        (set-file-position
                         (fd-input-port-fd this-id_0)
                         pos78_0)))))
                   app_2
                   app_3
                   app_4
                   app_5
                   app_6
                   app_7
                   (core-input-port-methods-commit.1
                    peek-via-read-input-port-vtable.1)
                   (|#%name|
                    read-in/inner
                    (lambda (this-id_0
                             dest-bstr136_0
                             start137_0
                             end138_0
                             copy?139_0
                             to-buffer?140_0)
                      (let ((n_0
                             (if (if to-buffer?140_0
                                   (|#%app|
                                    rktio_fd_is_text_converted
                                    (unsafe-place-local-ref cell.1)
                                    (fd-input-port-fd this-id_0))
                                   #f)
                               (begin
                                 (if (let ((or-part_0
                                            (not
                                             (fd-input-port-is-converted
                                              this-id_0))))
                                       (if or-part_0
                                         or-part_0
                                         (<
                                          (unsafe-bytes-length
                                           (fd-input-port-is-converted
                                            this-id_0))
                                          end138_0)))
                                   (let ((new-is-converted_0
                                          (make-bytes end138_0)))
                                     (begin
                                       (if (fd-input-port-is-converted
                                            this-id_0)
                                         (unsafe-bytes-copy!
                                          new-is-converted_0
                                          0
                                          (fd-input-port-is-converted
                                           this-id_0))
                                         (void))
                                       (set-fd-input-port-is-converted!
                                        this-id_0
                                        new-is-converted_0)))
                                   (void))
                                 (let ((app_8 (fd-input-port-fd this-id_0)))
                                   (|#%app|
                                    rktio_read_converted_in
                                    (unsafe-place-local-ref cell.1)
                                    app_8
                                    dest-bstr136_0
                                    start137_0
                                    end138_0
                                    (fd-input-port-is-converted this-id_0)
                                    start137_0)))
                               (|#%app|
                                rktio_read_in
                                (unsafe-place-local-ref cell.1)
                                (fd-input-port-fd this-id_0)
                                dest-bstr136_0
                                start137_0
                                end138_0))))
                        (if (vector? n_0)
                          (begin
                            (unsafe-end-atomic)
                            (|#%app|
                             (fd-input-port-methods-raise-read-error.1
                              (core-port-vtable this-id_0))
                             this-id_0
                             n_0))
                          (if (eqv? n_0 -1)
                            eof
                            (if (eqv? n_0 0)
                              (let ((or-part_0
                                     (fd-semaphore-update!
                                      (fd-input-port-fd this-id_0)
                                      'read)))
                                (if or-part_0
                                  or-part_0
                                  (fd-evt44.1
                                   (fd-input-port-fd this-id_0)
                                   1
                                   this-id_0)))
                              n_0))))))
                   (|#%name|
                    byte-ready/inner
                    (lambda (this-id_0 work-done!174_0)
                      (if (eqv?
                           (|#%app|
                            rktio_poll_read_ready
                            (unsafe-place-local-ref cell.1)
                            (fd-input-port-fd this-id_0))
                           1)
                        #t
                        (let ((or-part_0
                               (fd-semaphore-update!
                                (fd-input-port-fd this-id_0)
                                'read)))
                          (if or-part_0
                            or-part_0
                            (fd-evt44.1
                             (fd-input-port-fd this-id_0)
                             1
                             this-id_0))))))
                   (|#%name| on-close (lambda (this-id_0) (void)))
                   (|#%name|
                    raise-read-error
                    (lambda (this-id_0 n232_0)
                      (raise-filesystem-error
                       #f
                       n232_0
                       "error reading from stream port")))))))))))))
(define open-input-fd.1
  (|#%name|
   open-input-fd
   (lambda (custodian8_0 fd-refcount7_0 fd11_0 name12_0)
     (let ((fd-refcount_0
            (if (eq? fd-refcount7_0 unsafe-undefined) (box 1) fd-refcount7_0)))
       (let ((cust_0
              (if (eq? custodian8_0 unsafe-undefined)
                (current-custodian)
                custodian8_0)))
         (let ((app_0 (direct2.1 #f 0 0)))
           (let ((temp262_0
                  (create-fd-input-port
                   fd-input-port-vtable.1
                   name12_0
                   app_0
                   #f
                   #f
                   0
                   #f
                   #f
                   #f
                   #f
                   #f
                   (make-bytes 4096)
                   0
                   0
                   #f
                   'block
                   fd11_0
                   fd-refcount_0
                   #f
                   #f)))
             (finish-fd-input-port.1 cust_0 temp262_0))))))))
(define finish-fd-input-port.1
  (|#%name|
   finish-fd-input-port
   (lambda (custodian14_0 p16_0)
     (let ((cust_0
            (if (eq? custodian14_0 unsafe-undefined)
              (current-custodian)
              custodian14_0)))
       (let ((fd_0 (fd-input-port-fd p16_0)))
         (let ((fd-refcount_0 (fd-input-port-fd-refcount p16_0)))
           (begin
             (set-fd-input-port-custodian-reference!
              p16_0
              (register-fd-close cust_0 fd_0 fd-refcount_0 #f p16_0))
             (finish-port/count p16_0))))))))
(define finish_2568
  (make-struct-type-install-properties
   '(fd-output-port)
   8
   0
   struct:core-output-port
   (list
    (cons prop:authentic #t)
    (cons
     prop:place-message
     (lambda (port_0) (lambda () (fd-port->place-message port_0))))
    (cons
     prop:file-truncate
     (lambda (p_0 pos_0)
       (begin
         (temp24.1 p_0)
         (let ((result_0
                (|#%app|
                 rktio_set_file_size
                 (unsafe-place-local-ref cell.1)
                 (fd-output-port-fd p_0)
                 pos_0)))
           (if (vector? result_0)
             (begin
               (unsafe-end-atomic)
               (let ((base-msg_0 "error setting file size"))
                 (raise
                  (let ((app_0
                         (let ((msg_0
                                (string-append
                                 base-msg_0
                                 "\n  system error: "
                                 (format-rktio-system-error-message
                                  result_0))))
                           (error-message->adjusted-string
                            'file-truncate
                            'racket/primitive
                            msg_0
                            'racket/primitive))))
                    (|#%app| exn:fail app_0 (current-continuation-marks))))))
             (void))))))
    (cons prop:file-stream (lambda (p_0) (fd-output-port-fd p_0))))
   (current-inspector)
   #f
   '()
   #f
   'create-fd-output-port))
(define struct:fd-output-port
  (make-record-type-descriptor
   'fd-output-port
   struct:core-output-port
   (|#%nongenerative-uid| fd-output-port)
   #f
   #f
   '(8 . 255)))
(define effect_2896 (finish_2568 struct:fd-output-port))
(define create-fd-output-port
  (|#%name|
   create-fd-output-port
   (record-constructor
    (make-record-constructor-descriptor struct:fd-output-port #f #f))))
(define fd-output-port?
  (|#%name| fd-output-port? (record-predicate struct:fd-output-port)))
(define fd-output-port-fd
  (|#%name| fd-output-port-fd (record-accessor struct:fd-output-port 0)))
(define fd-output-port-fd-refcount
  (|#%name|
   fd-output-port-fd-refcount
   (record-accessor struct:fd-output-port 1)))
(define fd-output-port-bstr
  (|#%name| fd-output-port-bstr (record-accessor struct:fd-output-port 2)))
(define fd-output-port-start-pos
  (|#%name|
   fd-output-port-start-pos
   (record-accessor struct:fd-output-port 3)))
(define fd-output-port-end-pos
  (|#%name| fd-output-port-end-pos (record-accessor struct:fd-output-port 4)))
(define fd-output-port-flush-handle
  (|#%name|
   fd-output-port-flush-handle
   (record-accessor struct:fd-output-port 5)))
(define fd-output-port-buffer-mode
  (|#%name|
   fd-output-port-buffer-mode
   (record-accessor struct:fd-output-port 6)))
(define fd-output-port-custodian-reference
  (|#%name|
   fd-output-port-custodian-reference
   (record-accessor struct:fd-output-port 7)))
(define set-fd-output-port-fd!
  (|#%name| set-fd-output-port-fd! (record-mutator struct:fd-output-port 0)))
(define set-fd-output-port-fd-refcount!
  (|#%name|
   set-fd-output-port-fd-refcount!
   (record-mutator struct:fd-output-port 1)))
(define set-fd-output-port-bstr!
  (|#%name| set-fd-output-port-bstr! (record-mutator struct:fd-output-port 2)))
(define set-fd-output-port-start-pos!
  (|#%name|
   set-fd-output-port-start-pos!
   (record-mutator struct:fd-output-port 3)))
(define set-fd-output-port-end-pos!
  (|#%name|
   set-fd-output-port-end-pos!
   (record-mutator struct:fd-output-port 4)))
(define set-fd-output-port-flush-handle!
  (|#%name|
   set-fd-output-port-flush-handle!
   (record-mutator struct:fd-output-port 5)))
(define set-fd-output-port-buffer-mode!
  (|#%name|
   set-fd-output-port-buffer-mode!
   (record-mutator struct:fd-output-port 6)))
(define set-fd-output-port-custodian-reference!
  (|#%name|
   set-fd-output-port-custodian-reference!
   (record-mutator struct:fd-output-port 7)))
(define finish_2810
  (make-struct-type-install-properties
   '(fd-output-port-methods)
   2
   0
   struct:core-output-port-methods.1
   null
   (current-inspector)
   #f
   '(0 1)
   #f
   'fd-output-port-methods))
(define struct:fd-output-port-methods.1
  (make-record-type-descriptor
   'fd-output-port-methods
   struct:core-output-port-methods.1
   (|#%nongenerative-uid| fd-output-port-methods)
   #f
   #f
   '(2 . 0)))
(define effect_1955 (finish_2810 struct:fd-output-port-methods.1))
(define fd-output-port-methods26.1
  (|#%name|
   fd-output-port-methods
   (record-constructor
    (make-record-constructor-descriptor
     struct:fd-output-port-methods.1
     #f
     #f))))
(define fd-output-port-methods?.1_2665
  (|#%name|
   fd-output-port-methods?
   (record-predicate struct:fd-output-port-methods.1)))
(define fd-output-port-methods?.1
  (|#%name|
   fd-output-port-methods?
   (lambda (v)
     (if (fd-output-port-methods?.1_2665 v)
       #t
       ($value
        (if (impersonator? v)
          (fd-output-port-methods?.1_2665 (impersonator-val v))
          #f))))))
(define fd-output-port-methods-on-close.1_3216
  (|#%name|
   fd-output-port-methods-on-close
   (record-accessor struct:fd-output-port-methods.1 0)))
(define fd-output-port-methods-on-close.1
  (|#%name|
   fd-output-port-methods-on-close
   (lambda (s)
     (if (fd-output-port-methods?.1_2665 s)
       (fd-output-port-methods-on-close.1_3216 s)
       ($value
        (impersonate-ref
         fd-output-port-methods-on-close.1_3216
         struct:fd-output-port-methods.1
         0
         s
         'on-close))))))
(define fd-output-port-methods-raise-write-error.1_2502
  (|#%name|
   fd-output-port-methods-raise-write-error
   (record-accessor struct:fd-output-port-methods.1 1)))
(define fd-output-port-methods-raise-write-error.1
  (|#%name|
   fd-output-port-methods-raise-write-error
   (lambda (s)
     (if (fd-output-port-methods?.1_2665 s)
       (fd-output-port-methods-raise-write-error.1_2502 s)
       ($value
        (impersonate-ref
         fd-output-port-methods-raise-write-error.1_2502
         struct:fd-output-port-methods.1
         1
         s
         'raise-write-error))))))
(define fd-output-port-vtable.1
  (let ((app_0 (core-port-methods-count-lines!.1 core-output-port-vtable.1)))
    (let ((app_1 (core-port-methods-get-location.1 core-output-port-vtable.1)))
      (let ((app_2
             (core-output-port-methods-write-out-special.1
              core-output-port-vtable.1)))
        (let ((app_3
               (let ((get-write-evt_0
                      (get-write-evt-via-write-out
                       (lambda (out_0 v_0 bstr_0 start_0)
                         (port-count! out_0 v_0 bstr_0 start_0)))))
                 get-write-evt_0)))
          (fd-output-port-methods26.1
           (|#%name|
            close
            (lambda (this-id_0)
              (begin
                (temp19.1 this-id_0 #f)
                (temp21.1 this-id_0)
                (if (fd-output-port-bstr this-id_0)
                  (begin
                    (|#%app|
                     (fd-output-port-methods-on-close.1
                      (core-port-vtable this-id_0))
                     this-id_0)
                    (if (fd-output-port-flush-handle this-id_0)
                      (plumber-flush-handle-remove!
                       (fd-output-port-flush-handle this-id_0))
                      (void))
                    (set-fd-output-port-bstr! this-id_0 #f)
                    (let ((fd293_0 (fd-output-port-fd this-id_0)))
                      (let ((fd-refcount294_0
                             (fd-output-port-fd-refcount this-id_0)))
                        (let ((fd293_1 fd293_0))
                          (fd-close.1 #f fd293_1 fd-refcount294_0))))
                    (|#%app|
                     1/unsafe-custodian-unregister
                     this-id_0
                     (fd-output-port-custodian-reference this-id_0)))
                  (void)))))
           app_0
           app_1
           (|#%name|
            file-position
            (case-lambda
             ((this-id_0)
              (let ((pos_0 (get-file-position (fd-output-port-fd this-id_0))))
                (let ((b_0 (core-port-buffer this-id_0)))
                  (if pos_0
                    (+
                     pos_0
                     (let ((app_4
                            (if (direct-bstr b_0)
                              (direct-pos b_0)
                              (fd-output-port-end-pos this-id_0))))
                       (fx- app_4 (fd-output-port-start-pos this-id_0))))
                    #f))))
             ((this-id_0 pos295_0)
              (begin
                (temp19.1 this-id_0 #f)
                (if (fd-output-port-bstr this-id_0)
                  (void)
                  (check-not-closed 'file-position this-id_0))
                (set-file-position (fd-output-port-fd this-id_0) pos295_0)))))
           (|#%name|
            buffer-mode
            (case-lambda
             ((this-id_0) (fd-output-port-buffer-mode this-id_0))
             ((this-id_0 mode351_0)
              (set-fd-output-port-buffer-mode! this-id_0 mode351_0))))
           (|#%name|
            write-out
            (lambda (this-id_0
                     src-bstr407_0
                     src-start408_0
                     src-end409_0
                     nonbuffer/nonblock?410_0
                     enable-break?411_0
                     copy?412_0)
              (begin
                (temp23.1 this-id_0)
                (if (fx= src-start408_0 src-end409_0)
                  (let ((or-part_0 (if (temp18.1 this-id_0) 0 #f)))
                    (if or-part_0
                      or-part_0
                      (wrap-evt
                       (core-output-port-evt this-id_0)
                       (lambda (v_0) #f))))
                  (if (if (not
                           (eq? (fd-output-port-buffer-mode this-id_0) 'none))
                        (if (not nonbuffer/nonblock?410_0)
                          (let ((app_4 (fd-output-port-end-pos this-id_0)))
                            (fx<
                             app_4
                             (unsafe-bytes-length
                              (fd-output-port-bstr this-id_0))))
                          #f)
                        #f)
                    (let ((amt_0
                           (let ((app_4 (fx- src-end409_0 src-start408_0)))
                             (fxmin
                              app_4
                              (let ((app_5
                                     (unsafe-bytes-length
                                      (fd-output-port-bstr this-id_0))))
                                (fx-
                                 app_5
                                 (fd-output-port-end-pos this-id_0)))))))
                      (begin
                        (let ((app_4 (fd-output-port-bstr this-id_0)))
                          (let ((app_5 (fd-output-port-end-pos this-id_0)))
                            (unsafe-bytes-copy!
                             app_4
                             app_5
                             src-bstr407_0
                             src-start408_0
                             (fx+ src-start408_0 amt_0))))
                        (set-fd-output-port-end-pos!
                         this-id_0
                         (fx+ (fd-output-port-end-pos this-id_0) amt_0))
                        (if (eq? (fd-output-port-buffer-mode this-id_0) 'line)
                          (temp20.1
                           this-id_0
                           src-bstr407_0
                           src-start408_0
                           src-end409_0
                           enable-break?411_0)
                          (void))
                        (temp22.1 this-id_0 amt_0)
                        amt_0))
                    (if (not (temp18.1 this-id_0))
                      (wrap-evt
                       (core-output-port-evt this-id_0)
                       (lambda (v_0) #f))
                      (let ((n_0
                             (|#%app|
                              rktio_write_in
                              (unsafe-place-local-ref cell.1)
                              (fd-output-port-fd this-id_0)
                              src-bstr407_0
                              src-start408_0
                              src-end409_0)))
                        (if (vector? n_0)
                          (begin
                            (unsafe-end-atomic)
                            (|#%app|
                             (fd-output-port-methods-raise-write-error.1
                              (core-port-vtable this-id_0))
                             this-id_0
                             n_0))
                          (if (fx= n_0 0)
                            (wrap-evt
                             (core-output-port-evt this-id_0)
                             (lambda (v_0) #f))
                            n_0)))))))))
           app_2
           app_3
           (core-output-port-methods-get-write-special-evt.1
            core-output-port-vtable.1)
           (|#%name| on-close (lambda (this-id_0) (void)))
           (|#%name|
            raise-write-error
            (lambda (this-id_0 n473_0)
              (raise-filesystem-error
               #f
               n473_0
               "error writing to stream port")))))))))
(define temp22.1
  (|#%name|
   fast-mode!
   (lambda (this-id_0 amt502_0)
     (if (eq? (fd-output-port-buffer-mode this-id_0) 'block)
       (let ((b_0 (core-port-buffer this-id_0)))
         (let ((e_0 (fd-output-port-end-pos this-id_0)))
           (begin
             (set-direct-bstr! b_0 (fd-output-port-bstr this-id_0))
             (begin
               (set-direct-pos! b_0 e_0)
               (begin
                 (set-direct-end!
                  b_0
                  (unsafe-bytes-length (fd-output-port-bstr this-id_0)))
                 (let ((o_0 (core-port-offset this-id_0)))
                   (if o_0
                     (set-core-port-offset! this-id_0 (- (+ o_0 amt502_0) e_0))
                     (void))))))))
       (void)))))
(define temp23.1
  (|#%name|
   slow-mode!
   (lambda (this-id_0)
     (let ((b_0 (core-port-buffer this-id_0)))
       (if (direct-bstr b_0)
         (begin
           (set-direct-bstr! b_0 #f)
           (let ((pos_0 (direct-pos b_0)))
             (begin
               (set-fd-output-port-end-pos! this-id_0 pos_0)
               (let ((o_0 (core-port-offset this-id_0)))
                 (begin
                   (if o_0
                     (set-core-port-offset! this-id_0 (+ o_0 pos_0))
                     (void))
                   (set-direct-pos! b_0 (direct-end b_0)))))))
         (void))))))
(define temp24.1
  (|#%name|
   flush-buffer/external
   (lambda (this-id_0) (temp19.1 this-id_0 #f))))
(define temp25.1
  (|#%name|
   rktio-flushed?
   (lambda (this-id_0)
     (let ((or-part_0 (not (fd-output-port-bstr this-id_0))))
       (if or-part_0
         or-part_0
         (|#%app|
          rktio_poll_write_flushed
          (unsafe-place-local-ref cell.1)
          (fd-output-port-fd this-id_0)))))))
(define temp18.1
  (|#%name|
   flush-buffer
   (lambda (this-id_0)
     (begin
       (temp23.1 this-id_0)
       (if (not
            (let ((app_0 (fd-output-port-start-pos this-id_0)))
              (fx= app_0 (fd-output-port-end-pos this-id_0))))
         (let ((n_0
                (let ((app_0 (fd-output-port-fd this-id_0)))
                  (let ((app_1 (fd-output-port-bstr this-id_0)))
                    (let ((app_2 (fd-output-port-start-pos this-id_0)))
                      (|#%app|
                       rktio_write_in
                       (unsafe-place-local-ref cell.1)
                       app_0
                       app_1
                       app_2
                       (fd-output-port-end-pos this-id_0)))))))
           (if (vector? n_0)
             (begin
               (set-fd-output-port-start-pos! this-id_0 0)
               (set-fd-output-port-end-pos! this-id_0 0)
               (unsafe-end-atomic)
               (|#%app|
                (fd-output-port-methods-raise-write-error.1
                 (core-port-vtable this-id_0))
                this-id_0
                n_0))
             (if (fx= n_0 0)
               #f
               (let ((new-start-pos_0
                      (fx+ (fd-output-port-start-pos this-id_0) n_0)))
                 (if (fx= new-start-pos_0 (fd-output-port-end-pos this-id_0))
                   (begin
                     (set-fd-output-port-start-pos! this-id_0 0)
                     (set-fd-output-port-end-pos! this-id_0 0)
                     #t)
                   (begin
                     (set-fd-output-port-start-pos! this-id_0 new-start-pos_0)
                     #f))))))
         #t)))))
(define temp19.1
  (|#%name|
   flush-buffer-fully
   (lambda (this-id_0 enable-break?639_0)
     (letrec*
      ((loop_0
        (|#%name|
         loop
         (lambda ()
           (if (temp18.1 this-id_0)
             (void)
             (begin
               (unsafe-end-atomic)
               (if enable-break?639_0
                 (sync/enable-break (core-output-port-evt this-id_0))
                 (sync (core-output-port-evt this-id_0)))
               (unsafe-start-atomic)
               (if (fd-output-port-bstr this-id_0) (loop_0) (void))))))))
      (loop_0)))))
(define temp20.1
  (|#%name|
   flush-buffer-fully-if-newline
   (lambda (this-id_0
            src-bstr668_0
            src-start669_0
            src-end670_0
            enable-break?671_0)
     (begin
       (call-with-values
        (lambda ()
          (unsafe-normalise-inputs
           unsafe-bytes-length
           src-bstr668_0
           src-start669_0
           src-end670_0
           1))
        (lambda (v*_0 start*_0 stop*_0 step*_0)
          (letrec*
           ((for-loop_0
             (|#%name|
              for-loop
              (lambda (idx_0)
                (if (unsafe-fx< idx_0 stop*_0)
                  (let ((b_0 (unsafe-bytes-ref v*_0 idx_0)))
                    (let ((next-k-proc_0
                           (|#%name|
                            next-k-proc
                            (lambda () (for-loop_0 (unsafe-fx+ idx_0 1))))))
                      (let ((or-part_0 (eqv? b_0 10)))
                        (let ((newline?_0
                               (if or-part_0 or-part_0 (eqv? b_0 13))))
                          (begin
                            (if newline?_0
                              (temp19.1 this-id_0 enable-break?671_0)
                              (void))
                            (if newline?_0 (values) (next-k-proc_0)))))))
                  (values))))))
           (for-loop_0 start*_0))))
       (void)))))
(define temp21.1
  (|#%name|
   flush-rktio-buffer-fully
   (lambda (this-id_0)
     (if (temp25.1 this-id_0)
       (void)
       (begin
         (unsafe-end-atomic)
         (sync (rktio-fd-flushed-evt45.1 this-id_0))
         (unsafe-start-atomic)
         (temp21.1 this-id_0))))))
(define open-output-fd.1
  (|#%name|
   open-output-fd
   (lambda (buffer-mode27_0
            custodian30_0
            fd-refcount28_0
            plumber29_0
            fd35_0
            name36_0)
     (let ((fd-refcount_0
            (if (eq? fd-refcount28_0 unsafe-undefined)
              (box 1)
              fd-refcount28_0)))
       (let ((plumber_0
              (if (eq? plumber29_0 unsafe-undefined)
                (current-plumber)
                plumber29_0)))
         (let ((cust_0
                (if (eq? custodian30_0 unsafe-undefined)
                  (current-custodian)
                  custodian30_0)))
           (let ((app_0 (direct2.1 #f 0 0)))
             (let ((temp730_0
                    (let ((app_1 (make-bytes 4096)))
                      (create-fd-output-port
                       fd-output-port-vtable.1
                       name36_0
                       app_0
                       #f
                       #f
                       0
                       #f
                       always-evt
                       #f
                       #f
                       #f
                       fd35_0
                       fd-refcount_0
                       app_1
                       0
                       0
                       #f
                       (if (eq? buffer-mode27_0 'infer)
                         (if (|#%app|
                              rktio_fd_is_terminal
                              (unsafe-place-local-ref cell.1)
                              fd35_0)
                           'line
                           'block)
                         buffer-mode27_0)
                       #f))))
               (finish-fd-output-port.1 cust_0 plumber_0 temp730_0)))))))))
(define finish-fd-output-port.1
  (|#%name|
   finish-fd-output-port
   (lambda (custodian39_0 plumber38_0 p42_0)
     (let ((plumber_0
            (if (eq? plumber38_0 unsafe-undefined)
              (current-plumber)
              plumber38_0)))
       (let ((cust_0
              (if (eq? custodian39_0 unsafe-undefined)
                (current-custodian)
                custodian39_0)))
         (let ((fd_0 (fd-output-port-fd p42_0)))
           (let ((fd-refcount_0 (fd-output-port-fd-refcount p42_0)))
             (let ((evt_0 (fd-evt44.1 fd_0 2 p42_0)))
               (let ((flush-handle_0
                      (if plumber_0
                        (plumber-add-flush!
                         plumber_0
                         (lambda (h_0)
                           (begin
                             (unsafe-start-atomic)
                             (begin0 (temp24.1 p42_0) (unsafe-end-atomic)))))
                        #f)))
                 (let ((custodian-reference_0
                        (register-fd-close
                         cust_0
                         fd_0
                         fd-refcount_0
                         flush-handle_0
                         p42_0)))
                   (begin
                     (set-core-output-port-evt! p42_0 evt_0)
                     (set-fd-output-port-flush-handle! p42_0 flush-handle_0)
                     (set-fd-output-port-custodian-reference!
                      p42_0
                      custodian-reference_0)
                     (finish-port/count p42_0))))))))))))
(define 1/terminal-port?
  (|#%name|
   terminal-port?
   (lambda (p_0)
     (let ((fd_0 (fd-port-fd p_0)))
       (if fd_0
         (|#%app| rktio_fd_is_terminal (unsafe-place-local-ref cell.1) fd_0)
         #f)))))
(define fd-port-fd
  (lambda (p_0)
    (let ((cp_0
           (let ((or-part_0 (->core-input-port.1 #f p_0 #f)))
             (if or-part_0 or-part_0 (->core-output-port.1 #f p_0 #f)))))
      (if (fd-input-port? cp_0)
        (fd-input-port-fd cp_0)
        (if (fd-output-port? cp_0) (fd-output-port-fd cp_0) #f)))))
(define 1/port-waiting-peer?
  (|#%name|
   port-waiting-peer?
   (lambda (p_0)
     (let ((cp_0 (->core-output-port.1 #f p_0 #f)))
       (if cp_0
         (if (fd-output-port? cp_0)
           (let ((fd_0 (fd-port-fd cp_0)))
             (|#%app|
              rktio_fd_is_pending_open
              (unsafe-place-local-ref cell.1)
              fd_0))
           #f)
         (if (1/input-port? p_0)
           #f
           (raise-argument-error 'port-waiting-peer? "port?" p_0)))))))
(define get-file-position
  (lambda (fd_0)
    (let ((ppos_0
           (|#%app|
            rktio_get_file_position
            (unsafe-place-local-ref cell.1)
            fd_0)))
      (if (vector? ppos_0)
        #f
        (let ((pos_0 (|#%app| rktio_filesize_ref ppos_0)))
          (begin (|#%app| rktio_free ppos_0) pos_0))))))
(define set-file-position
  (lambda (fd_0 pos_0)
    (let ((r_0
           (|#%app|
            rktio_set_file_position
            (unsafe-place-local-ref cell.1)
            fd_0
            (if (eof-object? pos_0) 0 pos_0)
            (if (eof-object? pos_0) 1 0))))
      (if (vector? r_0)
        (begin
          (unsafe-end-atomic)
          (let ((base-msg_0 "error setting stream position"))
            (raise
             (let ((app_0
                    (let ((msg_0
                           (string-append
                            base-msg_0
                            "\n  system error: "
                            (format-rktio-system-error-message r_0))))
                      (error-message->adjusted-string
                       'file-position
                       'racket/primitive
                       msg_0
                       'racket/primitive))))
               (|#%app| exn:fail app_0 (current-continuation-marks))))))
        (void)))))
(define finish_2523
  (make-struct-type-install-properties
   '(fd-evt)
   3
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (fde_0 ctx_0)
        (if (core-port-closed? (fd-evt-closed fde_0))
          (values '(0) #f)
          (let ((mode_0 (fd-evt-mode fde_0)))
            (let ((ready?_0
                   (let ((or-part_0
                          (if (eqv? 1 (bitwise-and mode_0 1))
                            (eqv?
                             (|#%app|
                              rktio_poll_read_ready
                              (unsafe-place-local-ref cell.1)
                              (fd-evt-fd fde_0))
                             1)
                            #f)))
                     (if or-part_0
                       or-part_0
                       (if (eqv? 2 (bitwise-and mode_0 2))
                         (eqv?
                          (|#%app|
                           rktio_poll_write_ready
                           (unsafe-place-local-ref cell.1)
                           (fd-evt-fd fde_0))
                          1)
                         #f)))))
              (if ready?_0
                (values '(0) #f)
                (let ((c1_0
                       (if (not (|#%app| poll-ctx-poll? ctx_0))
                         (let ((app_0 (fd-evt-fd fde_0)))
                           (fd-semaphore-update!
                            app_0
                            (if (eqv? 1 (bitwise-and mode_0 1)) 'read 'write)))
                         #f)))
                  (if c1_0
                    (values #f (wrap-evt c1_0 (lambda (s_0) 0)))
                    (begin
                      (sandman-poll-ctx-add-poll-set-adder!
                       ctx_0
                       (lambda (ps_0)
                         (|#%app|
                          rktio_poll_add
                          (unsafe-place-local-ref cell.1)
                          (fd-evt-fd fde_0)
                          ps_0
                          mode_0)))
                      (values #f fde_0))))))))))))
   (current-inspector)
   #f
   '(0 1)
   #f
   'fd-evt))
(define struct:fd-evt
  (make-record-type-descriptor
   'fd-evt
   #f
   (|#%nongenerative-uid| fd-evt)
   #f
   #f
   '(3 . 4)))
(define effect_2660 (finish_2523 struct:fd-evt))
(define fd-evt44.1
  (|#%name|
   fd-evt
   (record-constructor
    (make-record-constructor-descriptor struct:fd-evt #f #f))))
(define fd-evt?_2860 (|#%name| fd-evt? (record-predicate struct:fd-evt)))
(define fd-evt?
  (|#%name|
   fd-evt?
   (lambda (v)
     (if (fd-evt?_2860 v)
       #t
       ($value
        (if (impersonator? v) (fd-evt?_2860 (impersonator-val v)) #f))))))
(define fd-evt-fd_2964 (|#%name| fd-evt-fd (record-accessor struct:fd-evt 0)))
(define fd-evt-fd
  (|#%name|
   fd-evt-fd
   (lambda (s)
     (if (fd-evt?_2860 s)
       (fd-evt-fd_2964 s)
       ($value (impersonate-ref fd-evt-fd_2964 struct:fd-evt 0 s 'fd))))))
(define fd-evt-mode_2993
  (|#%name| fd-evt-mode (record-accessor struct:fd-evt 1)))
(define fd-evt-mode
  (|#%name|
   fd-evt-mode
   (lambda (s)
     (if (fd-evt?_2860 s)
       (fd-evt-mode_2993 s)
       ($value (impersonate-ref fd-evt-mode_2993 struct:fd-evt 1 s 'mode))))))
(define fd-evt-closed_2690
  (|#%name| fd-evt-closed (record-accessor struct:fd-evt 2)))
(define fd-evt-closed
  (|#%name|
   fd-evt-closed
   (lambda (s)
     (if (fd-evt?_2860 s)
       (fd-evt-closed_2690 s)
       ($value
        (impersonate-ref fd-evt-closed_2690 struct:fd-evt 2 s 'closed))))))
(define set-fd-evt-closed!_2161
  (|#%name| set-fd-evt-closed! (record-mutator struct:fd-evt 2)))
(define set-fd-evt-closed!
  (|#%name|
   set-fd-evt-closed!
   (lambda (s v)
     (if (fd-evt?_2860 s)
       (set-fd-evt-closed!_2161 s v)
       ($value
        (impersonate-set!
         set-fd-evt-closed!_2161
         struct:fd-evt
         2
         2
         s
         v
         'closed))))))
(define finish_2861
  (make-struct-type-install-properties
   '(rktio-fd-flushed-evt)
   1
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (ffe_0 ctx_0)
        (let ((p_0 (rktio-fd-flushed-evt-p ffe_0)))
          (if (temp25.1 p_0)
            (values '(#t) #f)
            (begin
              (sandman-poll-ctx-add-poll-set-adder!
               ctx_0
               (lambda (ps_0)
                 (if (temp25.1 p_0)
                   (|#%app|
                    rktio_poll_set_add_nosleep
                    (unsafe-place-local-ref cell.1)
                    ps_0)
                   (|#%app|
                    rktio_poll_add
                    (unsafe-place-local-ref cell.1)
                    (fd-output-port-fd p_0)
                    ps_0
                    8))))
              (values #f (list ffe_0)))))))))
   (current-inspector)
   #f
   '(0)
   #f
   'rktio-fd-flushed-evt))
(define struct:rktio-fd-flushed-evt
  (make-record-type-descriptor
   'rktio-fd-flushed-evt
   #f
   (|#%nongenerative-uid| rktio-fd-flushed-evt)
   #f
   #f
   '(1 . 0)))
(define effect_2170 (finish_2861 struct:rktio-fd-flushed-evt))
(define rktio-fd-flushed-evt45.1
  (|#%name|
   rktio-fd-flushed-evt
   (record-constructor
    (make-record-constructor-descriptor struct:rktio-fd-flushed-evt #f #f))))
(define rktio-fd-flushed-evt?_2575
  (|#%name|
   rktio-fd-flushed-evt?
   (record-predicate struct:rktio-fd-flushed-evt)))
(define rktio-fd-flushed-evt?
  (|#%name|
   rktio-fd-flushed-evt?
   (lambda (v)
     (if (rktio-fd-flushed-evt?_2575 v)
       #t
       ($value
        (if (impersonator? v)
          (rktio-fd-flushed-evt?_2575 (impersonator-val v))
          #f))))))
(define rktio-fd-flushed-evt-p_2868
  (|#%name|
   rktio-fd-flushed-evt-p
   (record-accessor struct:rktio-fd-flushed-evt 0)))
(define rktio-fd-flushed-evt-p
  (|#%name|
   rktio-fd-flushed-evt-p
   (lambda (s)
     (if (rktio-fd-flushed-evt?_2575 s)
       (rktio-fd-flushed-evt-p_2868 s)
       ($value
        (impersonate-ref
         rktio-fd-flushed-evt-p_2868
         struct:rktio-fd-flushed-evt
         0
         s
         'p))))))
(define register-fd-close
  (lambda (custodian_0 fd_0 fd-refcount_0 flush-handle_0 port_0)
    (|#%app|
     1/unsafe-custodian-register
     custodian_0
     port_0
     (lambda (port_1)
       (begin
         (if flush-handle_0
           (plumber-flush-handle-remove! flush-handle_0)
           (void))
         (if (1/input-port? port_1)
           (|#%app|
            (fd-input-port-methods-on-close.1 (core-port-vtable port_1))
            port_1)
           (|#%app|
            (fd-output-port-methods-on-close.1 (core-port-vtable port_1))
            port_1))
         (fd-close.1 #t fd_0 fd-refcount_0)
         (set-closed-state! port_1)))
     #f
     #f)))
(define-values
 (prop:fd-place-message-opener
  fd-place-message-opener?
  fd-place-message-opener-ref)
 (make-struct-type-property 'fd-place-message-opener))
(define fd-port->place-message
  (lambda (port_0)
    (begin
      (unsafe-start-atomic)
      (if (1/port-closed? port_0)
        #f
        (let ((input?_0 (1/input-port? port_0)))
          (let ((fd-dup_0 (dup-port-fd port_0)))
            (let ((name_0 (core-port-name port_0)))
              (let ((opener_0
                     (let ((or-part_0 (fd-place-message-opener-ref port_0 #f)))
                       (if or-part_0
                         or-part_0
                         (if input?_0
                           (|#%name|
                            opener
                            (lambda (port_1 name_1)
                              (open-input-fd.1
                               unsafe-undefined
                               unsafe-undefined
                               port_1
                               name_1)))
                           (|#%name|
                            opener
                            (lambda (port_1 name_1)
                              (open-output-fd.1
                               'infer
                               unsafe-undefined
                               unsafe-undefined
                               unsafe-undefined
                               port_1
                               name_1))))))))
                (begin
                  (unsafe-end-atomic)
                  (lambda ()
                    (begin
                      (unsafe-start-atomic)
                      (begin0
                        (let ((fd_0 (claim-dup fd-dup_0)))
                          (|#%app| opener_0 fd_0 name_0))
                        (unsafe-end-atomic)))))))))))))
(define dup-port-fd
  (lambda (port_0)
    (let ((fd_0 (fd-port-fd port_0)))
      (let ((new-fd_0
             (|#%app| rktio_dup (unsafe-place-local-ref cell.1) fd_0)))
        (begin
          (if (vector? new-fd_0)
            (begin
              (unsafe-end-atomic)
              (let ((base-msg_0 "error during dup of file descriptor"))
                (raise
                 (let ((app_0
                        (let ((msg_0
                               (string-append
                                base-msg_0
                                "\n  system error: "
                                (format-rktio-system-error-message new-fd_0))))
                          (error-message->adjusted-string
                           'place-channel-put
                           'racket/primitive
                           msg_0
                           'racket/primitive))))
                   (|#%app| exn:fail app_0 (current-continuation-marks))))))
            (void))
          (let ((fd-dup_0
                 (box
                  (|#%app|
                   rktio_fd_detach
                   (unsafe-place-local-ref cell.1)
                   new-fd_0))))
            (begin
              (unsafe-add-global-finalizer
               fd-dup_0
               (lambda ()
                 (let ((fd_1 (unbox fd-dup_0)))
                   (if fd_1 (|#%app| rktio_fd_close_transfer fd_1) (void)))))
              fd-dup_0)))))))
(define claim-dup
  (lambda (fd-dup_0)
    (let ((fd_0 (unbox fd-dup_0)))
      (begin
        (set-box! fd-dup_0 #f)
        (|#%app| rktio_fd_attach (unsafe-place-local-ref cell.1) fd_0)))))
(define make-stdin
  (lambda ()
    (let ((temp1_0
           (check-rktio-error
            (|#%app| rktio_std_fd (unsafe-place-local-ref cell.1) 0)
            "error initializing stdin")))
      (open-input-fd.1 unsafe-undefined unsafe-undefined temp1_0 'stdin))))
(define make-stdout
  (lambda ()
    (let ((temp3_0
           (check-rktio-error
            (|#%app| rktio_std_fd (unsafe-place-local-ref cell.1) 1)
            "error initializing stdout")))
      (open-output-fd.1
       'infer
       unsafe-undefined
       unsafe-undefined
       unsafe-undefined
       temp3_0
       'stdout))))
(define make-stderr
  (lambda ()
    (let ((temp6_0
           (check-rktio-error
            (|#%app| rktio_std_fd (unsafe-place-local-ref cell.1) 2)
            "error initializing stderr")))
      (open-output-fd.1
       'none
       unsafe-undefined
       unsafe-undefined
       unsafe-undefined
       temp6_0
       'stderr))))
(define cell.1$9 (unsafe-make-place-local (make-stdin)))
(define cell.2$2 (unsafe-make-place-local (make-stdout)))
(define cell.3 (unsafe-make-place-local (make-stderr)))
(define 1/current-input-port
  (make-parameter
   (unsafe-place-local-ref cell.1$9)
   (lambda (v_0)
     (begin
       (if (1/input-port? v_0)
         (void)
         (raise-argument-error 'current-input-port "input-port?" v_0))
       v_0))
   'current-input-port))
(define 1/current-output-port
  (make-parameter
   (unsafe-place-local-ref cell.2$2)
   (lambda (v_0)
     (begin
       (if (1/output-port? v_0)
         (void)
         (raise-argument-error 'current-output-port "output-port?" v_0))
       v_0))
   'current-output-port))
(define 1/current-error-port
  (make-parameter
   (unsafe-place-local-ref cell.3)
   (lambda (v_0)
     (begin
       (if (1/output-port? v_0)
         (void)
         (raise-argument-error 'current-error-port "output-port?" v_0))
       v_0))
   'current-error-port))
(define init-current-ports!
  (lambda (in-fd_0 out-fd_0 err-fd_0 cust_0 plumber_0)
    (begin
      (unsafe-place-local-set!
       cell.1$9
       (let ((temp10_0 "stdin"))
         (open-input-fd.1 cust_0 unsafe-undefined in-fd_0 temp10_0)))
      (1/current-input-port (unsafe-place-local-ref cell.1$9))
      (unsafe-place-local-set!
       cell.2$2
       (let ((temp13_0 "stdout"))
         (open-output-fd.1
          'infer
          cust_0
          unsafe-undefined
          plumber_0
          out-fd_0
          temp13_0)))
      (1/current-output-port (unsafe-place-local-ref cell.2$2))
      (unsafe-place-local-set!
       cell.3
       (let ((temp17_0 "srderr"))
         (open-output-fd.1
          'infer
          cust_0
          unsafe-undefined
          plumber_0
          err-fd_0
          temp17_0)))
      (1/current-error-port (unsafe-place-local-ref cell.3)))))
(define get-original-error-port (lambda () (unsafe-place-local-ref cell.3)))
(define prepare-change
  (lambda (in_0)
    (let ((prepare-change_0
           (core-input-port-methods-prepare-change.1 (core-port-vtable in_0))))
      (if prepare-change_0 (|#%app| prepare-change_0 in_0) (void)))))
(define read-some-bytes!.1
  (|#%name|
   read-some-bytes!
   (lambda (copy-bstr?3_0
            enable-break?2_0
            keep-eof?4_0
            limit-special-arity?6_0
            special-ok?5_0
            zero-ok?1_0
            who13_0
            orig-in14_0
            bstr15_0
            start16_0
            end17_0)
     (letrec*
      ((loop_0
        (|#%name|
         loop
         (lambda (in_0 extra-count-ins_0)
           (begin
             (unsafe-start-atomic)
             (prepare-change in_0)
             (if (fx= start16_0 end17_0)
               (begin (unsafe-end-atomic) 0)
               (if (core-port-closed? in_0)
                 (check-not-closed who13_0 in_0)
                 (if (core-input-port-pending-eof? in_0)
                   (begin
                     (if keep-eof?4_0
                       (void)
                       (set-core-input-port-pending-eof?! in_0 #f))
                     (unsafe-end-atomic)
                     eof)
                   (let ((buffer_0 (core-port-buffer in_0)))
                     (let ((buf-pos_0 (direct-pos buffer_0)))
                       (let ((buf-end_0 (direct-end buffer_0)))
                         (if (fx< buf-pos_0 buf-end_0)
                           (let ((v_0
                                  (let ((app_0 (fx- buf-end_0 buf-pos_0)))
                                    (fxmin app_0 (fx- end17_0 start16_0)))))
                             (let ((new-pos_0 (fx+ buf-pos_0 v_0)))
                               (begin
                                 (unsafe-bytes-copy!
                                  bstr15_0
                                  start16_0
                                  (direct-bstr buffer_0)
                                  buf-pos_0
                                  new-pos_0)
                                 (set-direct-pos! buffer_0 new-pos_0)
                                 (if (let ((or-part_0
                                            (pair? extra-count-ins_0)))
                                       (if or-part_0
                                         or-part_0
                                         (core-port-count in_0)))
                                   (port-count-all!
                                    in_0
                                    extra-count-ins_0
                                    v_0
                                    bstr15_0
                                    start16_0)
                                   (void))
                                 (unsafe-end-atomic)
                                 v_0)))
                           (let ((read-in_0
                                  (core-input-port-methods-read-in.1
                                   (core-port-vtable in_0))))
                             (if (procedure? read-in_0)
                               (let ((v_0
                                      (|#%app|
                                       read-in_0
                                       in_0
                                       bstr15_0
                                       start16_0
                                       end17_0
                                       copy-bstr?3_0)))
                                 (letrec*
                                  ((result-loop_0
                                    (|#%name|
                                     result-loop
                                     (lambda (v_1)
                                       (begin
                                         (if (if (integer? v_1)
                                               (not (eq? v_1 0))
                                               #f)
                                           (port-count-all!
                                            in_0
                                            extra-count-ins_0
                                            v_1
                                            bstr15_0
                                            start16_0)
                                           (if (procedure? v_1)
                                             (port-count-byte-all!
                                              in_0
                                              extra-count-ins_0
                                              #f)
                                             (void)))
                                         (unsafe-end-atomic)
                                         (if (exact-nonnegative-integer? v_1)
                                           (if (zero? v_1)
                                             (if zero-ok?1_0
                                               0
                                               (loop_0 in_0 extra-count-ins_0))
                                             (if (<= v_1 (- end17_0 start16_0))
                                               v_1
                                               (raise-arguments-error
                                                who13_0
                                                "result integer is larger than the supplied byte string"
                                                "result"
                                                v_1
                                                "byte-string length"
                                                (- end17_0 start16_0))))
                                           (if (eof-object? v_1)
                                             eof
                                             (if (semaphore? v_1)
                                               (if zero-ok?1_0
                                                 (if (semaphore-try-wait? v_1)
                                                   (loop_0
                                                    in_0
                                                    extra-count-ins_0)
                                                   0)
                                                 (begin
                                                   (if enable-break?2_0
                                                     (semaphore-wait/enable-break
                                                      v_1)
                                                     (semaphore-wait v_1))
                                                   (loop_0
                                                    in_0
                                                    extra-count-ins_0)))
                                               (if (evt? v_1)
                                                 (let ((timeout_0
                                                        (if zero-ok?1_0
                                                          (|#%name|
                                                           timeout
                                                           (lambda () 0))
                                                          #f)))
                                                   (let ((next-v_0
                                                          (if enable-break?2_0
                                                            (sync/timeout/enable-break
                                                             timeout_0
                                                             v_1)
                                                            (sync/timeout
                                                             timeout_0
                                                             v_1))))
                                                     (if (if zero-ok?1_0
                                                           (evt? next-v_0)
                                                           #f)
                                                       0
                                                       (begin
                                                         (unsafe-start-atomic)
                                                         (result-loop_0
                                                          next-v_0)))))
                                                 (if (procedure? v_1)
                                                   (if special-ok?5_0
                                                     (if limit-special-arity?6_0
                                                       (lambda (a_0
                                                                b_0
                                                                c_0
                                                                d_0)
                                                         (|#%app|
                                                          v_1
                                                          a_0
                                                          b_0
                                                          c_0
                                                          d_0))
                                                       v_1)
                                                     (raise-arguments-error
                                                      who13_0
                                                      "non-character in an unsupported context"
                                                      "port"
                                                      orig-in14_0))
                                                   (internal-error
                                                    (format
                                                     "weird read-bytes result ~s"
                                                     v_1))))))))))))
                                  (result-loop_0 v_0)))
                               (begin
                                 (unsafe-end-atomic)
                                 (let ((app_0
                                        (->core-input-port.1
                                         unsafe-undefined
                                         read-in_0
                                         #f)))
                                   (loop_0
                                    app_0
                                    (cons
                                     in_0
                                     extra-count-ins_0))))))))))))))))))
      (loop_0 orig-in14_0 null)))))
(define peek-some-bytes!.1
  (|#%name|
   peek-some-bytes!
   (lambda (copy-bstr?22_0
            enable-break?21_0
            limit-special-arity?24_0
            progress-evt19_0
            special-ok?23_0
            zero-ok?20_0
            who31_0
            orig-in32_0
            bstr33_0
            start34_0
            end35_0
            skip36_0)
     (letrec*
      ((loop_0
        (|#%name|
         loop
         (lambda (in_0)
           (begin
             (unsafe-start-atomic)
             (prepare-change in_0)
             (if (= start34_0 end35_0)
               (begin (unsafe-end-atomic) 0)
               (if (if progress-evt19_0 (sync/timeout 0 progress-evt19_0) #f)
                 (begin (unsafe-end-atomic) 0)
                 (if (core-port-closed? in_0)
                   (check-not-closed who31_0 in_0)
                   (if (core-input-port-pending-eof? in_0)
                     (begin (unsafe-end-atomic) eof)
                     (let ((buffer_0 (core-port-buffer in_0)))
                       (let ((buf-pos_0 (+ (direct-pos buffer_0) skip36_0)))
                         (let ((buf-end_0 (direct-end buffer_0)))
                           (if (< buf-pos_0 buf-end_0)
                             (let ((v_0
                                    (let ((app_0 (- buf-end_0 buf-pos_0)))
                                      (min app_0 (- end35_0 start34_0)))))
                               (begin
                                 (let ((app_0 (direct-bstr buffer_0)))
                                   (unsafe-bytes-copy!
                                    bstr33_0
                                    start34_0
                                    app_0
                                    buf-pos_0
                                    (fx+ buf-pos_0 v_0)))
                                 (unsafe-end-atomic)
                                 v_0))
                             (let ((peek-in_0
                                    (core-input-port-methods-peek-in.1
                                     (core-port-vtable in_0))))
                               (if (procedure? peek-in_0)
                                 (let ((v_0
                                        (|#%app|
                                         peek-in_0
                                         in_0
                                         bstr33_0
                                         start34_0
                                         end35_0
                                         skip36_0
                                         progress-evt19_0
                                         copy-bstr?22_0)))
                                   (begin
                                     (unsafe-end-atomic)
                                     (letrec*
                                      ((result-loop_0
                                        (|#%name|
                                         result-loop
                                         (lambda (v_1)
                                           (if (exact-nonnegative-integer? v_1)
                                             (if (zero? v_1)
                                               (if zero-ok?20_0
                                                 0
                                                 (loop_0 in_0))
                                               (if (<=
                                                    v_1
                                                    (- end35_0 start34_0))
                                                 v_1
                                                 (raise-arguments-error
                                                  who31_0
                                                  "result integer is larger than the supplied byte string"
                                                  "result"
                                                  v_1
                                                  "byte-string length"
                                                  (- end35_0 start34_0))))
                                             (if (eof-object? v_1)
                                               eof
                                               (if (semaphore? v_1)
                                                 (if zero-ok?20_0
                                                   0
                                                   (begin
                                                     (if enable-break?21_0
                                                       (semaphore-wait/enable-break
                                                        v_1)
                                                       (semaphore-wait v_1))
                                                     (loop_0 in_0)))
                                                 (if (evt? v_1)
                                                   (if zero-ok?20_0
                                                     (let ((r_0
                                                            (sync/timeout
                                                             0
                                                             v_1)))
                                                       (if r_0
                                                         (result-loop_0 r_0)
                                                         0))
                                                     (result-loop_0
                                                      (if enable-break?21_0
                                                        (sync/enable-break v_1)
                                                        (sync v_1))))
                                                   (if (procedure? v_1)
                                                     (if special-ok?23_0
                                                       (if limit-special-arity?24_0
                                                         (lambda (a_0
                                                                  b_0
                                                                  c_0
                                                                  d_0)
                                                           (|#%app|
                                                            v_1
                                                            a_0
                                                            b_0
                                                            c_0
                                                            d_0))
                                                         v_1)
                                                       (raise-arguments-error
                                                        who31_0
                                                        "non-character in an unsupported context"
                                                        "port"
                                                        orig-in32_0))
                                                     (internal-error
                                                      (format
                                                       "weird peek-bytes result ~s"
                                                       v_1)))))))))))
                                      (result-loop_0 v_0))))
                                 (begin
                                   (unsafe-end-atomic)
                                   (loop_0
                                    (->core-input-port.1
                                     unsafe-undefined
                                     peek-in_0
                                     #f))))))))))))))))))
      (loop_0 orig-in32_0)))))
(define read-a-byte.1
  (|#%name|
   read-a-byte
   (lambda (special-ok?38_0 who40_0 in41_0)
     (begin
       (unsafe-start-atomic)
       (let ((buffer_0 (core-port-buffer in41_0)))
         (let ((pos_0 (direct-pos buffer_0)))
           (if (fx< pos_0 (direct-end buffer_0))
             (let ((b_0 (unsafe-bytes-ref (direct-bstr buffer_0) pos_0)))
               (begin
                 (set-direct-pos! buffer_0 (fx+ pos_0 1))
                 (if (core-port-count in41_0)
                   (port-count-byte! in41_0 b_0)
                   (void))
                 (unsafe-end-atomic)
                 b_0))
             (begin
               (unsafe-end-atomic)
               (read-byte-via-bytes.1 special-ok?38_0 who40_0 in41_0)))))))))
(define read-byte-via-bytes.1
  (|#%name|
   read-byte-via-bytes
   (lambda (special-ok?43_0 who45_0 in46_0)
     (let ((bstr_0 (make-bytes 1)))
       (let ((v_0
              (read-some-bytes!.1
               #f
               #f
               #f
               #f
               special-ok?43_0
               #f
               who45_0
               in46_0
               bstr_0
               0
               1)))
         (if (eq? v_0 1) (unsafe-bytes-ref bstr_0 0) v_0))))))
(define peek-a-byte.1
  (|#%name|
   peek-a-byte
   (lambda (special-ok?48_0 who50_0 in51_0 skip-k52_0)
     (begin
       (unsafe-start-atomic)
       (let ((buffer_0 (core-port-buffer in51_0)))
         (let ((pos_0 (+ (direct-pos buffer_0) skip-k52_0)))
           (if (< pos_0 (direct-end buffer_0))
             (let ((b_0 (unsafe-bytes-ref (direct-bstr buffer_0) pos_0)))
               (begin (unsafe-end-atomic) b_0))
             (begin
               (unsafe-end-atomic)
               (peek-byte-via-bytes.1
                #f
                special-ok?48_0
                who50_0
                in51_0
                skip-k52_0)))))))))
(define peek-byte-via-bytes.1
  (|#%name|
   peek-byte-via-bytes
   (lambda (progress-evt55_0 special-ok?54_0 who58_0 in59_0 skip-k60_0)
     (let ((bstr_0 (make-bytes 1)))
       (let ((v_0
              (peek-some-bytes!.1
               #f
               #f
               #f
               progress-evt55_0
               special-ok?54_0
               #f
               who58_0
               in59_0
               bstr_0
               0
               1
               skip-k60_0)))
         (if (eq? v_0 1) (unsafe-bytes-ref bstr_0 0) v_0))))))
(define maybe-read-a-line
  (lambda (in_0 cr?_0 lf?_0 crlf?_0 as-string?_0)
    (begin
      (unsafe-start-atomic)
      (let ((buffer_0 (core-port-buffer in_0)))
        (let ((bstr_0 (direct-bstr buffer_0)))
          (let ((pos_0 (direct-pos buffer_0)))
            (let ((end_0
                   (let ((app_0 (direct-end buffer_0)))
                     (fxmin app_0 (fx+ pos_0 4096)))))
              (let ((finish_0
                     (|#%name|
                      finish
                      (lambda (end_1 read-end_0)
                        (begin
                          (set-direct-pos! buffer_0 read-end_0)
                          (begin
                            (if (core-port-count in_0)
                              (port-count!
                               in_0
                               (fx- read-end_0 pos_0)
                               bstr_0
                               pos_0)
                              (void))
                            (let ((result_0
                                   (if as-string?_0
                                     (a-bytes->string/utf-8.1
                                      #f
                                      bstr_0
                                      pos_0
                                      end_1
                                      '#\xfffd)
                                     (subbytes bstr_0 pos_0 end_1))))
                              (begin (unsafe-end-atomic) result_0))))))))
                (letrec*
                 ((loop_0
                   (|#%name|
                    loop
                    (lambda (i_0)
                      (if (fx= i_0 end_0)
                        (begin (unsafe-end-atomic) #f)
                        (let ((b_0 (unsafe-bytes-ref bstr_0 i_0)))
                          (if (if lf?_0 (eqv? b_0 10) #f)
                            (finish_0 i_0 (fx+ i_0 1))
                            (if (if (if cr?_0 cr?_0 crlf?_0) (eqv? b_0 13) #f)
                              (if (if crlf?_0
                                    (if (fx< (fx+ i_0 1) end_0)
                                      (eqv?
                                       (unsafe-bytes-ref bstr_0 (fx+ i_0 1))
                                       10)
                                      #f)
                                    #f)
                                (finish_0 i_0 (fx+ i_0 2))
                                (if cr?_0
                                  (if (if crlf?_0 (fx= (fx+ i_0 1) end_0) #f)
                                    (begin (unsafe-end-atomic) #f)
                                    (finish_0 i_0 (fx+ i_0 1)))
                                  (loop_0 (fx+ i_0 1))))
                              (loop_0 (fx+ i_0 1))))))))))
                 (loop_0 pos_0))))))))))
(define finish_2338
  (make-struct-type-install-properties
   '(progress-evt)
   2
   0
   #f
   (list
    (cons
     prop:evt
     (lambda (pe_0) (wrap-evt (progress-evt-evt pe_0) (lambda args_0 pe_0)))))
   (current-inspector)
   #f
   '(0 1)
   #f
   'progress-evt))
(define struct:progress-evt
  (make-record-type-descriptor
   'progress-evt
   #f
   (|#%nongenerative-uid| progress-evt)
   #f
   #f
   '(2 . 0)))
(define effect_2490 (finish_2338 struct:progress-evt))
(define progress-evt1.1
  (|#%name|
   progress-evt
   (record-constructor
    (make-record-constructor-descriptor struct:progress-evt #f #f))))
(define 1/progress-evt?_3005
  (|#%name| progress-evt? (record-predicate struct:progress-evt)))
(define 1/progress-evt?
  (|#%name|
   progress-evt?
   (lambda (v)
     (if (1/progress-evt?_3005 v)
       #t
       ($value
        (if (impersonator? v)
          (1/progress-evt?_3005 (impersonator-val v))
          #f))))))
(define progress-evt-port_3267
  (|#%name| progress-evt-port (record-accessor struct:progress-evt 0)))
(define progress-evt-port
  (|#%name|
   progress-evt-port
   (lambda (s)
     (if (1/progress-evt?_3005 s)
       (progress-evt-port_3267 s)
       ($value
        (impersonate-ref
         progress-evt-port_3267
         struct:progress-evt
         0
         s
         'port))))))
(define progress-evt-evt_1640
  (|#%name| progress-evt-evt (record-accessor struct:progress-evt 1)))
(define progress-evt-evt
  (|#%name|
   progress-evt-evt
   (lambda (s)
     (if (1/progress-evt?_3005 s)
       (progress-evt-evt_1640 s)
       ($value
        (impersonate-ref
         progress-evt-evt_1640
         struct:progress-evt
         1
         s
         'evt))))))
(define progress-evt?*
  (|#%name|
   progress-evt?
   (case-lambda
    ((v_0) (1/progress-evt? v_0))
    ((v_0 port_0)
     (if (1/progress-evt? v_0) (eq? port_0 (progress-evt-port v_0)) #f)))))
(define 1/port-provides-progress-evts?
  (|#%name|
   port-provides-progress-evts?
   (lambda (in_0)
     (begin
       (if (1/input-port? in_0)
         (void)
         (raise-argument-error
          'port-provides-progress-evts?
          "input-port?"
          in_0))
       (let ((in_1 (->core-input-port.1 unsafe-undefined in_0 #f)))
         (if (core-input-port-methods-get-progress-evt.1
              (core-port-vtable in_1))
           #t
           #f))))))
(define 1/port-progress-evt
  (let ((port-progress-evt_0
         (|#%name|
          port-progress-evt
          (lambda (orig-in2_0)
            (let ((orig-in_0
                   (if (eq? orig-in2_0 unsafe-undefined)
                     (1/current-input-port)
                     orig-in2_0)))
              (begin
                (if (1/input-port? orig-in_0)
                  (void)
                  (raise-argument-error
                   'port-progress-evt
                   "input-port?"
                   orig-in_0))
                (let ((in_0
                       (->core-input-port.1 unsafe-undefined orig-in_0 #f)))
                  (let ((get-progress-evt_0
                         (core-input-port-methods-get-progress-evt.1
                          (core-port-vtable in_0))))
                    (if get-progress-evt_0
                      (progress-evt1.1
                       orig-in_0
                       (|#%app| get-progress-evt_0 in_0))
                      (raise-arguments-error
                       'port-progress-evt
                       "port does not provide progress evts"
                       "port"
                       orig-in_0))))))))))
    (|#%name|
     port-progress-evt
     (case-lambda
      (() (port-progress-evt_0 unsafe-undefined))
      ((orig-in2_0) (port-progress-evt_0 orig-in2_0))))))
(define 1/port-commit-peeked
  (let ((port-commit-peeked_0
         (|#%name|
          port-commit-peeked
          (lambda (amt4_0 progress-evt5_0 evt6_0 in3_0)
            (let ((in_0
                   (if (eq? in3_0 unsafe-undefined)
                     (1/current-input-port)
                     in3_0)))
              (begin
                (if (exact-nonnegative-integer? amt4_0)
                  (void)
                  (raise-argument-error
                   'port-commit-peeked
                   "exact-nonnegative-integer?"
                   amt4_0))
                (if (1/progress-evt? progress-evt5_0)
                  (void)
                  (raise-argument-error
                   'port-commit-peeked
                   "progress-evt?"
                   progress-evt5_0))
                (if (|#%app| sync-atomic-poll-evt? evt6_0)
                  (void)
                  (raise-argument-error
                   'port-commit-peeked
                   "(or/c channel-put-evt? channel? semaphore? semaphore-peek-evt? always-evt never-evt)"
                   evt6_0))
                (if (1/input-port? in_0)
                  (void)
                  (raise-argument-error
                   'port-commit-peeked
                   "input-port?"
                   in_0))
                (check-progress-evt 'port-commit-peeked progress-evt5_0 in_0)
                (let ((in_1 (->core-input-port.1 unsafe-undefined in_0 #f)))
                  (begin
                    (unsafe-start-atomic)
                    (begin0
                      (let ((app_0
                             (core-input-port-methods-commit.1
                              (core-port-vtable in_1))))
                        (|#%app|
                         app_0
                         in_1
                         amt4_0
                         (progress-evt-evt progress-evt5_0)
                         evt6_0
                         (lambda (bstr_0)
                           (port-count!
                            in_1
                            (unsafe-bytes-length bstr_0)
                            bstr_0
                            0))))
                      (unsafe-end-atomic))))))))))
    (|#%name|
     port-commit-peeked
     (case-lambda
      ((amt_0 progress-evt_0 evt_0)
       (port-commit-peeked_0 amt_0 progress-evt_0 evt_0 unsafe-undefined))
      ((amt_0 progress-evt_0 evt_0 in3_0)
       (port-commit-peeked_0 amt_0 progress-evt_0 evt_0 in3_0))))))
(define check-progress-evt
  (lambda (who_0 progress-evt_0 in_0)
    (if (progress-evt?* progress-evt_0 in_0)
      (void)
      (raise-arguments-error
       who_0
       "evt is not a progress evt for the given port"
       "evt"
       progress-evt_0
       "port"
       in_0))))
(define unwrap-progress-evt
  (lambda (progress-evt_0)
    (if progress-evt_0 (progress-evt-evt progress-evt_0) #f)))
(define 1/flush-output
  (let ((flush-output_0
         (|#%name|
          flush-output
          (lambda (p1_0)
            (let ((p_0
                   (if (eq? p1_0 unsafe-undefined)
                     (1/current-output-port)
                     p1_0)))
              (begin
                (if (1/output-port? p_0)
                  (void)
                  (raise-argument-error 'flush-output "output-port?" p_0))
                (letrec*
                 ((wo-loop_0
                   (|#%name|
                    wo-loop
                    (lambda (p_1)
                      (let ((out_0
                             (->core-output-port.1 unsafe-undefined p_1 #f)))
                        (let ((write-out_0
                               (core-output-port-methods-write-out.1
                                (core-port-vtable out_0))))
                          (if (procedure? write-out_0)
                            (letrec*
                             ((loop_0
                               (|#%name|
                                loop
                                (lambda ()
                                  (begin
                                    (unsafe-start-atomic)
                                    (begin
                                      (check-not-closed 'flush-output out_0)
                                      (let ((r_0
                                             (|#%app|
                                              write-out_0
                                              out_0
                                              #vu8()
                                              0
                                              0
                                              #f
                                              #f
                                              #f)))
                                        (begin
                                          (unsafe-end-atomic)
                                          (letrec*
                                           ((r-loop_0
                                             (|#%name|
                                              r-loop
                                              (lambda (r_1)
                                                (if (eq? r_1 0)
                                                  (void)
                                                  (if (not r_1)
                                                    (loop_0)
                                                    (if (evt? r_1)
                                                      (r-loop_0 (sync r_1))
                                                      (error
                                                       'flush-output
                                                       "weird result"))))))))
                                           (r-loop_0 r_0))))))))))
                             (loop_0))
                            (begin
                              (unsafe-start-atomic)
                              (begin0
                                (check-not-closed 'flush-output out_0)
                                (unsafe-end-atomic))
                              (wo-loop_0 write-out_0)))))))))
                 (wo-loop_0 p_0))))))))
    (|#%name|
     flush-output
     (case-lambda
      (() (flush-output_0 unsafe-undefined))
      ((p1_0) (flush-output_0 p1_0))))))
(define maybe-flush-stdout
  (lambda (in_0)
    (if (eq? in_0 (unsafe-place-local-ref cell.1$9))
      (begin
        (if (1/terminal-port? (unsafe-place-local-ref cell.2$2))
          (1/flush-output (unsafe-place-local-ref cell.2$2))
          (void))
        (if (1/terminal-port? (unsafe-place-local-ref cell.3))
          (1/flush-output (unsafe-place-local-ref cell.3))
          (void)))
      (void))))
(define do-read-bytes!
  (lambda (who_0 in_0 bstr_0 start_0 end_0)
    (let ((amt_0 (- end_0 start_0)))
      (let ((v_0
             (read-some-bytes!.1
              #t
              #f
              #f
              #t
              #t
              #f
              who_0
              in_0
              bstr_0
              start_0
              end_0)))
        (if (not (exact-integer? v_0))
          v_0
          (if (= v_0 amt_0)
            v_0
            (letrec*
             ((loop_0
               (|#%name|
                loop
                (lambda (got_0)
                  (let ((v_1
                         (let ((temp78_0 (+ start_0 got_0)))
                           (read-some-bytes!.1
                            #t
                            #f
                            #t
                            #t
                            #f
                            #f
                            who_0
                            in_0
                            bstr_0
                            temp78_0
                            end_0))))
                    (if (eof-object? v_1)
                      got_0
                      (let ((new-got_0 (+ got_0 v_1)))
                        (if (= new-got_0 amt_0)
                          amt_0
                          (loop_0 new-got_0)))))))))
             (loop_0 v_0))))))))
(define 1/read-byte
  (let ((read-byte_0
         (|#%name|
          read-byte
          (lambda (orig-in1_0)
            (let ((orig-in_0
                   (if (eq? orig-in1_0 unsafe-undefined)
                     (1/current-input-port)
                     orig-in1_0)))
              (let ((in_0
                     (->core-input-port.1
                      unsafe-undefined
                      orig-in_0
                      'read-byte)))
                (read-a-byte.1 #f 'read-byte in_0)))))))
    (|#%name|
     read-byte
     (case-lambda
      (() (read-byte_0 unsafe-undefined))
      ((orig-in1_0) (read-byte_0 orig-in1_0))))))
(define 1/read-bytes
  (let ((read-bytes_0
         (|#%name|
          read-bytes
          (lambda (amt3_0 in2_0)
            (let ((in_0
                   (if (eq? in2_0 unsafe-undefined)
                     (1/current-input-port)
                     in2_0)))
              (begin
                (if (exact-nonnegative-integer? amt3_0)
                  (void)
                  (raise-argument-error
                   'read-bytes
                   "exact-nonnegative-integer?"
                   amt3_0))
                (if (1/input-port? in_0)
                  (void)
                  (raise-argument-error 'read-bytes "input-port?" in_0))
                (maybe-flush-stdout in_0)
                (let ((in_1 (->core-input-port.1 unsafe-undefined in_0 #f)))
                  (let ((bstr_0 (make-bytes amt3_0)))
                    (let ((v_0
                           (do-read-bytes! 'read-bytes in_1 bstr_0 0 amt3_0)))
                      (if (exact-integer? v_0)
                        (if (= v_0 amt3_0) bstr_0 (subbytes bstr_0 0 v_0))
                        v_0))))))))))
    (|#%name|
     read-bytes
     (case-lambda
      ((amt_0) (read-bytes_0 amt_0 unsafe-undefined))
      ((amt_0 in2_0) (read-bytes_0 amt_0 in2_0))))))
(define 1/read-bytes!
  (let ((read-bytes!_0
         (|#%name|
          read-bytes!
          (lambda (bstr7_0 in4_0 start-pos5_0 end-pos6_0)
            (let ((in_0
                   (if (eq? in4_0 unsafe-undefined)
                     (1/current-input-port)
                     in4_0)))
              (let ((end-pos_0
                     (if (eq? end-pos6_0 unsafe-undefined)
                       (if (bytes? bstr7_0) (unsafe-bytes-length bstr7_0) #f)
                       end-pos6_0)))
                (begin
                  (if (bytes? bstr7_0)
                    (void)
                    (raise-argument-error 'read-bytes! "bytes?" bstr7_0))
                  (if (1/input-port? in_0)
                    (void)
                    (raise-argument-error 'read-bytes! "input-port?" in_0))
                  (if (exact-nonnegative-integer? start-pos5_0)
                    (void)
                    (raise-argument-error
                     'read-bytes!
                     "exact-nonnegative-integer?"
                     start-pos5_0))
                  (if (exact-nonnegative-integer? end-pos_0)
                    (void)
                    (raise-argument-error
                     'read-bytes!
                     "exact-nonnegative-integer?"
                     end-pos_0))
                  (check-range$1
                   'read-bytes!
                   start-pos5_0
                   end-pos_0
                   (unsafe-bytes-length bstr7_0)
                   bstr7_0)
                  (maybe-flush-stdout in_0)
                  (let ((in_1 (->core-input-port.1 unsafe-undefined in_0 #f)))
                    (do-read-bytes!
                     'read-bytes!
                     in_1
                     bstr7_0
                     start-pos5_0
                     end-pos_0)))))))))
    (|#%name|
     read-bytes!
     (case-lambda
      ((bstr_0) (read-bytes!_0 bstr_0 unsafe-undefined 0 unsafe-undefined))
      ((bstr_0 in_0 start-pos_0 end-pos6_0)
       (read-bytes!_0 bstr_0 in_0 start-pos_0 end-pos6_0))
      ((bstr_0 in_0 start-pos5_0)
       (read-bytes!_0 bstr_0 in_0 start-pos5_0 unsafe-undefined))
      ((bstr_0 in4_0) (read-bytes!_0 bstr_0 in4_0 0 unsafe-undefined))))))
(define do-read-bytes-avail!.1
  (|#%name|
   do-read-bytes-avail!
   (lambda (enable-break?9_0
            zero-ok?8_0
            who12_0
            bstr13_0
            in14_0
            start-pos15_0
            end-pos16_0)
     (begin
       (if (bytes? bstr13_0)
         (void)
         (raise-argument-error who12_0 "bytes?" bstr13_0))
       (if (1/input-port? in14_0)
         (void)
         (raise-argument-error who12_0 "input-port?" in14_0))
       (if (exact-nonnegative-integer? start-pos15_0)
         (void)
         (raise-argument-error
          who12_0
          "exact-nonnegative-integer?"
          start-pos15_0))
       (if (exact-nonnegative-integer? end-pos16_0)
         (void)
         (raise-argument-error
          who12_0
          "exact-nonnegative-integer?"
          end-pos16_0))
       (check-range$1
        who12_0
        start-pos15_0
        end-pos16_0
        (unsafe-bytes-length bstr13_0)
        bstr13_0)
       (maybe-flush-stdout in14_0)
       (let ((in_0 (->core-input-port.1 unsafe-undefined in14_0 #f)))
         (read-some-bytes!.1
          #t
          enable-break?9_0
          #f
          #t
          #t
          zero-ok?8_0
          who12_0
          in_0
          bstr13_0
          start-pos15_0
          end-pos16_0))))))
(define 1/read-bytes-avail!
  (let ((read-bytes-avail!_0
         (|#%name|
          read-bytes-avail!
          (lambda (bstr21_0 in18_0 start-pos19_0 end-pos20_0)
            (let ((in_0
                   (if (eq? in18_0 unsafe-undefined)
                     (1/current-input-port)
                     in18_0)))
              (let ((end-pos_0
                     (if (eq? end-pos20_0 unsafe-undefined)
                       (if (bytes? bstr21_0) (unsafe-bytes-length bstr21_0) #f)
                       end-pos20_0)))
                (do-read-bytes-avail!.1
                 #f
                 #f
                 'read-bytes-avail!
                 bstr21_0
                 in_0
                 start-pos19_0
                 end-pos_0)))))))
    (|#%name|
     read-bytes-avail!
     (case-lambda
      ((bstr_0)
       (read-bytes-avail!_0 bstr_0 unsafe-undefined 0 unsafe-undefined))
      ((bstr_0 in_0 start-pos_0 end-pos20_0)
       (read-bytes-avail!_0 bstr_0 in_0 start-pos_0 end-pos20_0))
      ((bstr_0 in_0 start-pos19_0)
       (read-bytes-avail!_0 bstr_0 in_0 start-pos19_0 unsafe-undefined))
      ((bstr_0 in18_0)
       (read-bytes-avail!_0 bstr_0 in18_0 0 unsafe-undefined))))))
(define 1/read-bytes-avail!*
  (let ((read-bytes-avail!*_0
         (|#%name|
          read-bytes-avail!*
          (lambda (bstr25_0 in22_0 start-pos23_0 end-pos24_0)
            (let ((in_0
                   (if (eq? in22_0 unsafe-undefined)
                     (1/current-input-port)
                     in22_0)))
              (let ((end-pos_0
                     (if (eq? end-pos24_0 unsafe-undefined)
                       (if (bytes? bstr25_0) (unsafe-bytes-length bstr25_0) #f)
                       end-pos24_0)))
                (do-read-bytes-avail!.1
                 #f
                 #t
                 'read-bytes-avail!*
                 bstr25_0
                 in_0
                 start-pos23_0
                 end-pos_0)))))))
    (|#%name|
     read-bytes-avail!*
     (case-lambda
      ((bstr_0)
       (read-bytes-avail!*_0 bstr_0 unsafe-undefined 0 unsafe-undefined))
      ((bstr_0 in_0 start-pos_0 end-pos24_0)
       (read-bytes-avail!*_0 bstr_0 in_0 start-pos_0 end-pos24_0))
      ((bstr_0 in_0 start-pos23_0)
       (read-bytes-avail!*_0 bstr_0 in_0 start-pos23_0 unsafe-undefined))
      ((bstr_0 in22_0)
       (read-bytes-avail!*_0 bstr_0 in22_0 0 unsafe-undefined))))))
(define 1/read-bytes-avail!/enable-break
  (let ((read-bytes-avail!/enable-break_0
         (|#%name|
          read-bytes-avail!/enable-break
          (lambda (bstr29_0 in26_0 start-pos27_0 end-pos28_0)
            (let ((in_0
                   (if (eq? in26_0 unsafe-undefined)
                     (1/current-input-port)
                     in26_0)))
              (let ((end-pos_0
                     (if (eq? end-pos28_0 unsafe-undefined)
                       (if (bytes? bstr29_0) (unsafe-bytes-length bstr29_0) #f)
                       end-pos28_0)))
                (do-read-bytes-avail!.1
                 #t
                 #f
                 'read-bytes-avail!/enable-break
                 bstr29_0
                 in_0
                 start-pos27_0
                 end-pos_0)))))))
    (|#%name|
     read-bytes-avail!/enable-break
     (case-lambda
      ((bstr_0)
       (read-bytes-avail!/enable-break_0
        bstr_0
        unsafe-undefined
        0
        unsafe-undefined))
      ((bstr_0 in_0 start-pos_0 end-pos28_0)
       (read-bytes-avail!/enable-break_0 bstr_0 in_0 start-pos_0 end-pos28_0))
      ((bstr_0 in_0 start-pos27_0)
       (read-bytes-avail!/enable-break_0
        bstr_0
        in_0
        start-pos27_0
        unsafe-undefined))
      ((bstr_0 in26_0)
       (read-bytes-avail!/enable-break_0 bstr_0 in26_0 0 unsafe-undefined))))))
(define do-peek-bytes!
  (lambda (who_0 in_0 bstr_0 start_0 end_0 skip_0)
    (let ((amt_0 (- end_0 start_0)))
      (let ((v_0
             (peek-some-bytes!.1
              #t
              #f
              #t
              #f
              #t
              #f
              who_0
              in_0
              bstr_0
              start_0
              end_0
              skip_0)))
        (if (exact-integer? v_0)
          (if (= v_0 amt_0)
            v_0
            (letrec*
             ((loop_0
               (|#%name|
                loop
                (lambda (got_0)
                  (let ((v_1
                         (let ((temp130_0 (+ got_0 skip_0)))
                           (peek-some-bytes!.1
                            #f
                            #f
                            #t
                            #f
                            #f
                            #f
                            who_0
                            in_0
                            bstr_0
                            got_0
                            amt_0
                            temp130_0))))
                    (if (eof-object? v_1)
                      got_0
                      (let ((new-got_0 (+ got_0 v_1)))
                        (if (= new-got_0 amt_0)
                          amt_0
                          (loop_0 new-got_0)))))))))
             (loop_0 v_0)))
          v_0)))))
(define 1/peek-byte
  (let ((peek-byte_0
         (|#%name|
          peek-byte
          (lambda (orig-in30_0 skip-k31_0)
            (let ((orig-in_0
                   (if (eq? orig-in30_0 unsafe-undefined)
                     (1/current-input-port)
                     orig-in30_0)))
              (let ((in_0
                     (->core-input-port.1
                      unsafe-undefined
                      orig-in_0
                      'peek-byte)))
                (begin
                  (if (exact-nonnegative-integer? skip-k31_0)
                    (void)
                    (raise-argument-error
                     'peek-byte
                     "exact-nonnegative-integer?"
                     skip-k31_0))
                  (peek-a-byte.1 #f 'peek-byte in_0 skip-k31_0))))))))
    (|#%name|
     peek-byte
     (case-lambda
      (() (peek-byte_0 unsafe-undefined 0))
      ((orig-in_0 skip-k31_0) (peek-byte_0 orig-in_0 skip-k31_0))
      ((orig-in30_0) (peek-byte_0 orig-in30_0 0))))))
(define 1/peek-bytes
  (let ((peek-bytes_0
         (|#%name|
          peek-bytes
          (lambda (amt33_0 skip-k34_0 in32_0)
            (let ((in_0
                   (if (eq? in32_0 unsafe-undefined)
                     (1/current-input-port)
                     in32_0)))
              (begin
                (if (exact-nonnegative-integer? amt33_0)
                  (void)
                  (raise-argument-error
                   'peek-bytes
                   "exact-nonnegative-integer?"
                   amt33_0))
                (if (exact-nonnegative-integer? skip-k34_0)
                  (void)
                  (raise-argument-error
                   'peek-bytes
                   "exact-nonnegative-integer?"
                   skip-k34_0))
                (if (1/input-port? in_0)
                  (void)
                  (raise-argument-error 'peek-bytes "input-port?" in_0))
                (maybe-flush-stdout in_0)
                (let ((in_1 (->core-input-port.1 unsafe-undefined in_0 #f)))
                  (let ((bstr_0 (make-bytes amt33_0)))
                    (let ((v_0
                           (do-peek-bytes!
                            'peek-bytes
                            in_1
                            bstr_0
                            0
                            amt33_0
                            skip-k34_0)))
                      (if (exact-integer? v_0)
                        (if (= v_0 amt33_0) bstr_0 (subbytes bstr_0 0 v_0))
                        v_0))))))))))
    (|#%name|
     peek-bytes
     (case-lambda
      ((amt_0 skip-k_0) (peek-bytes_0 amt_0 skip-k_0 unsafe-undefined))
      ((amt_0 skip-k_0 in32_0) (peek-bytes_0 amt_0 skip-k_0 in32_0))))))
(define 1/peek-bytes!
  (let ((peek-bytes!_0
         (|#%name|
          peek-bytes!
          (lambda (bstr38_0 skip-k39_0 in35_0 start-pos36_0 end-pos37_0)
            (let ((in_0
                   (if (eq? in35_0 unsafe-undefined)
                     (1/current-input-port)
                     in35_0)))
              (let ((end-pos_0
                     (if (eq? end-pos37_0 unsafe-undefined)
                       (if (bytes? bstr38_0) (unsafe-bytes-length bstr38_0) #f)
                       end-pos37_0)))
                (begin
                  (if (bytes? bstr38_0)
                    (void)
                    (raise-argument-error 'peek-bytes! "bytes?" bstr38_0))
                  (if (exact-nonnegative-integer? skip-k39_0)
                    (void)
                    (raise-argument-error
                     'peek-bytes!
                     "exact-nonnegative-integer?"
                     skip-k39_0))
                  (if (1/input-port? in_0)
                    (void)
                    (raise-argument-error 'peek-bytes! "input-port?" in_0))
                  (if (exact-nonnegative-integer? start-pos36_0)
                    (void)
                    (raise-argument-error
                     'peek-bytes!
                     "exact-nonnegative-integer?"
                     start-pos36_0))
                  (if (exact-nonnegative-integer? end-pos_0)
                    (void)
                    (raise-argument-error
                     'peek-bytes!
                     "exact-nonnegative-integer?"
                     end-pos_0))
                  (check-range$1
                   'peek-bytes!
                   start-pos36_0
                   end-pos_0
                   (unsafe-bytes-length bstr38_0)
                   bstr38_0)
                  (maybe-flush-stdout in_0)
                  (let ((in_1 (->core-input-port.1 unsafe-undefined in_0 #f)))
                    (do-peek-bytes!
                     'peek-bytes!
                     in_1
                     bstr38_0
                     start-pos36_0
                     end-pos_0
                     skip-k39_0)))))))))
    (|#%name|
     peek-bytes!
     (case-lambda
      ((bstr_0 skip-k_0)
       (peek-bytes!_0 bstr_0 skip-k_0 unsafe-undefined 0 unsafe-undefined))
      ((bstr_0 skip-k_0 in_0 start-pos_0 end-pos37_0)
       (peek-bytes!_0 bstr_0 skip-k_0 in_0 start-pos_0 end-pos37_0))
      ((bstr_0 skip-k_0 in_0 start-pos36_0)
       (peek-bytes!_0 bstr_0 skip-k_0 in_0 start-pos36_0 unsafe-undefined))
      ((bstr_0 skip-k_0 in35_0)
       (peek-bytes!_0 bstr_0 skip-k_0 in35_0 0 unsafe-undefined))))))
(define do-peek-bytes-avail!.1
  (|#%name|
   do-peek-bytes-avail!
   (lambda (enable-break?41_0
            zero-ok?40_0
            who44_0
            bstr45_0
            skip-k46_0
            progress-evt47_0
            in48_0
            start-pos49_0
            end-pos50_0)
     (begin
       (if (bytes? bstr45_0)
         (void)
         (raise-argument-error who44_0 "bytes?" bstr45_0))
       (if (exact-nonnegative-integer? skip-k46_0)
         (void)
         (raise-argument-error
          who44_0
          "exact-nonnegative-integer?"
          skip-k46_0))
       (if (let ((or-part_0 (not progress-evt47_0)))
             (if or-part_0 or-part_0 (progress-evt?* progress-evt47_0)))
         (void)
         (raise-argument-error
          who44_0
          "(or/c #f progress-evt?)"
          progress-evt47_0))
       (if (1/input-port? in48_0)
         (void)
         (raise-argument-error who44_0 "input-port?" in48_0))
       (if (exact-nonnegative-integer? start-pos49_0)
         (void)
         (raise-argument-error
          who44_0
          "exact-nonnegative-integer?"
          start-pos49_0))
       (if (exact-nonnegative-integer? end-pos50_0)
         (void)
         (raise-argument-error
          who44_0
          "exact-nonnegative-integer?"
          end-pos50_0))
       (if progress-evt47_0
         (check-progress-evt who44_0 progress-evt47_0 in48_0)
         (void))
       (check-range$1
        who44_0
        start-pos49_0
        end-pos50_0
        (unsafe-bytes-length bstr45_0)
        bstr45_0)
       (maybe-flush-stdout in48_0)
       (let ((in_0 (->core-input-port.1 unsafe-undefined in48_0 #f)))
         (let ((temp150_0 (unwrap-progress-evt progress-evt47_0)))
           (peek-some-bytes!.1
            #t
            enable-break?41_0
            #t
            temp150_0
            #t
            zero-ok?40_0
            who44_0
            in_0
            bstr45_0
            start-pos49_0
            end-pos50_0
            skip-k46_0)))))))
(define 1/peek-bytes-avail!
  (let ((peek-bytes-avail!_0
         (|#%name|
          peek-bytes-avail!
          (lambda (bstr56_0
                   skip-k57_0
                   progress-evt52_0
                   in53_0
                   start-pos54_0
                   end-pos55_0)
            (let ((in_0
                   (if (eq? in53_0 unsafe-undefined)
                     (1/current-input-port)
                     in53_0)))
              (let ((end-pos_0
                     (if (eq? end-pos55_0 unsafe-undefined)
                       (if (bytes? bstr56_0) (unsafe-bytes-length bstr56_0) #f)
                       end-pos55_0)))
                (do-peek-bytes-avail!.1
                 #f
                 #f
                 'peek-bytes-avail!
                 bstr56_0
                 skip-k57_0
                 progress-evt52_0
                 in_0
                 start-pos54_0
                 end-pos_0)))))))
    (|#%name|
     peek-bytes-avail!
     (case-lambda
      ((bstr_0 skip-k_0)
       (peek-bytes-avail!_0
        bstr_0
        skip-k_0
        #f
        unsafe-undefined
        0
        unsafe-undefined))
      ((bstr_0 skip-k_0 progress-evt_0 in_0 start-pos_0 end-pos55_0)
       (peek-bytes-avail!_0
        bstr_0
        skip-k_0
        progress-evt_0
        in_0
        start-pos_0
        end-pos55_0))
      ((bstr_0 skip-k_0 progress-evt_0 in_0 start-pos54_0)
       (peek-bytes-avail!_0
        bstr_0
        skip-k_0
        progress-evt_0
        in_0
        start-pos54_0
        unsafe-undefined))
      ((bstr_0 skip-k_0 progress-evt_0 in53_0)
       (peek-bytes-avail!_0
        bstr_0
        skip-k_0
        progress-evt_0
        in53_0
        0
        unsafe-undefined))
      ((bstr_0 skip-k_0 progress-evt52_0)
       (peek-bytes-avail!_0
        bstr_0
        skip-k_0
        progress-evt52_0
        unsafe-undefined
        0
        unsafe-undefined))))))
(define 1/peek-bytes-avail!*
  (let ((peek-bytes-avail!*_0
         (|#%name|
          peek-bytes-avail!*
          (lambda (bstr62_0
                   skip-k63_0
                   progress-evt58_0
                   in59_0
                   start-pos60_0
                   end-pos61_0)
            (let ((in_0
                   (if (eq? in59_0 unsafe-undefined)
                     (1/current-input-port)
                     in59_0)))
              (let ((end-pos_0
                     (if (eq? end-pos61_0 unsafe-undefined)
                       (if (bytes? bstr62_0) (unsafe-bytes-length bstr62_0) #f)
                       end-pos61_0)))
                (do-peek-bytes-avail!.1
                 #f
                 #t
                 'peek-bytes-avail!*
                 bstr62_0
                 skip-k63_0
                 progress-evt58_0
                 in_0
                 start-pos60_0
                 end-pos_0)))))))
    (|#%name|
     peek-bytes-avail!*
     (case-lambda
      ((bstr_0 skip-k_0)
       (peek-bytes-avail!*_0
        bstr_0
        skip-k_0
        #f
        unsafe-undefined
        0
        unsafe-undefined))
      ((bstr_0 skip-k_0 progress-evt_0 in_0 start-pos_0 end-pos61_0)
       (peek-bytes-avail!*_0
        bstr_0
        skip-k_0
        progress-evt_0
        in_0
        start-pos_0
        end-pos61_0))
      ((bstr_0 skip-k_0 progress-evt_0 in_0 start-pos60_0)
       (peek-bytes-avail!*_0
        bstr_0
        skip-k_0
        progress-evt_0
        in_0
        start-pos60_0
        unsafe-undefined))
      ((bstr_0 skip-k_0 progress-evt_0 in59_0)
       (peek-bytes-avail!*_0
        bstr_0
        skip-k_0
        progress-evt_0
        in59_0
        0
        unsafe-undefined))
      ((bstr_0 skip-k_0 progress-evt58_0)
       (peek-bytes-avail!*_0
        bstr_0
        skip-k_0
        progress-evt58_0
        unsafe-undefined
        0
        unsafe-undefined))))))
(define 1/peek-bytes-avail!/enable-break
  (let ((peek-bytes-avail!/enable-break_0
         (|#%name|
          peek-bytes-avail!/enable-break
          (lambda (bstr68_0
                   skip-k69_0
                   progress-evt64_0
                   in65_0
                   start-pos66_0
                   end-pos67_0)
            (let ((in_0
                   (if (eq? in65_0 unsafe-undefined)
                     (1/current-input-port)
                     in65_0)))
              (let ((end-pos_0
                     (if (eq? end-pos67_0 unsafe-undefined)
                       (if (bytes? bstr68_0) (unsafe-bytes-length bstr68_0) #f)
                       end-pos67_0)))
                (do-peek-bytes-avail!.1
                 #t
                 #f
                 'peek-bytes-avail!/enable-break
                 bstr68_0
                 skip-k69_0
                 progress-evt64_0
                 in_0
                 start-pos66_0
                 end-pos_0)))))))
    (|#%name|
     peek-bytes-avail!/enable-break
     (case-lambda
      ((bstr_0 skip-k_0)
       (peek-bytes-avail!/enable-break_0
        bstr_0
        skip-k_0
        #f
        unsafe-undefined
        0
        unsafe-undefined))
      ((bstr_0 skip-k_0 progress-evt_0 in_0 start-pos_0 end-pos67_0)
       (peek-bytes-avail!/enable-break_0
        bstr_0
        skip-k_0
        progress-evt_0
        in_0
        start-pos_0
        end-pos67_0))
      ((bstr_0 skip-k_0 progress-evt_0 in_0 start-pos66_0)
       (peek-bytes-avail!/enable-break_0
        bstr_0
        skip-k_0
        progress-evt_0
        in_0
        start-pos66_0
        unsafe-undefined))
      ((bstr_0 skip-k_0 progress-evt_0 in65_0)
       (peek-bytes-avail!/enable-break_0
        bstr_0
        skip-k_0
        progress-evt_0
        in65_0
        0
        unsafe-undefined))
      ((bstr_0 skip-k_0 progress-evt64_0)
       (peek-bytes-avail!/enable-break_0
        bstr_0
        skip-k_0
        progress-evt64_0
        unsafe-undefined
        0
        unsafe-undefined))))))
(define read-some-chars!.1
  (|#%name|
   read-some-chars!
   (lambda (extra-bytes-amt2_0
            just-peek?4_0
            keep-eof?3_0
            skip5_0
            special-ok?6_0
            zero-ok?1_0
            who13_0
            orig-in14_0
            str15_0
            start16_0
            end17_0)
     (let ((amt_0 (- end17_0 start16_0)))
       (let ((bstr_0 (make-bytes amt_0)))
         (let ((consumed-v_0
                (if just-peek?4_0
                  0
                  (read-some-bytes!.1
                   #f
                   #f
                   keep-eof?3_0
                   #t
                   special-ok?6_0
                   zero-ok?1_0
                   who13_0
                   orig-in14_0
                   bstr_0
                   0
                   amt_0))))
           (let ((v_0
                  (if just-peek?4_0
                    (peek-some-bytes!.1
                     #f
                     #f
                     #t
                     #f
                     #t
                     zero-ok?1_0
                     who13_0
                     orig-in14_0
                     bstr_0
                     consumed-v_0
                     amt_0
                     skip5_0)
                    consumed-v_0)))
             (if (not (exact-integer? v_0))
               (values v_0 0)
               (if (zero? v_0)
                 (values 0 0)
                 (call-with-values
                  (lambda ()
                    (let ((temp95_0 (+ start16_0 amt_0)))
                      (utf-8-decode!.1
                       'state
                       '#\xfffd
                       #f
                       bstr_0
                       0
                       v_0
                       str15_0
                       start16_0
                       temp95_0)))
                  (lambda (used-bytes_0 got-chars_0 state_0)
                    (let ((actually-used-bytes_0
                           (-
                            used-bytes_0
                            (if (utf-8-state? state_0)
                              (utf-8-state-pending-amt state_0)
                              0))))
                      (if (let ((or-part_0 (zero? got-chars_0)))
                            (if or-part_0
                              or-part_0
                              (< actually-used-bytes_0 consumed-v_0)))
                        (letrec*
                         ((loop_0
                           (|#%name|
                            loop
                            (lambda (skip-k_0
                                     total-used-bytes_0
                                     state_1
                                     total-chars_0
                                     start_0
                                     amt_1)
                              (let ((v_1
                                     (peek-some-bytes!.1
                                      #t
                                      #f
                                      #t
                                      #f
                                      special-ok?6_0
                                      zero-ok?1_0
                                      who13_0
                                      orig-in14_0
                                      bstr_0
                                      0
                                      1
                                      skip-k_0)))
                                (if (if (eq? v_1 0) (zero? consumed-v_0) #f)
                                  (values 0 0)
                                  (call-with-values
                                   (lambda ()
                                     (if (eq? v_1 0)
                                       (values 0 0 state_1)
                                       (let ((temp108_0
                                              (if (integer? v_1) v_1 0)))
                                         (let ((temp111_0 (+ start_0 amt_1)))
                                           (let ((temp113_0
                                                  (if (utf-8-state? state_1)
                                                    state_1
                                                    #f)))
                                             (let ((temp114_0
                                                    (if (integer? v_1)
                                                      'state
                                                      'error)))
                                               (let ((temp113_1 temp113_0)
                                                     (temp111_1 temp111_0)
                                                     (temp108_1 temp108_0))
                                                 (utf-8-decode!.1
                                                  temp114_0
                                                  '#\xfffd
                                                  temp113_1
                                                  bstr_0
                                                  0
                                                  temp108_1
                                                  str15_0
                                                  start_0
                                                  temp111_1))))))))
                                   (lambda (used-bytes_1
                                            got-chars_1
                                            new-state_0)
                                     (if (zero? got-chars_1)
                                       (let ((app_0 (+ skip-k_0 v_1)))
                                         (loop_0
                                          app_0
                                          (+ total-used-bytes_0 used-bytes_1)
                                          new-state_0
                                          total-chars_0
                                          start_0
                                          amt_1))
                                       (let ((actually-used-bytes_1
                                              (let ((app_0
                                                     (+
                                                      total-used-bytes_0
                                                      used-bytes_1)))
                                                (-
                                                 app_0
                                                 (if (utf-8-state? new-state_0)
                                                   (utf-8-state-pending-amt
                                                    new-state_0)
                                                   0)))))
                                         (if (<
                                              actually-used-bytes_1
                                              consumed-v_0)
                                           (let ((app_0 (+ skip-k_0 v_1)))
                                             (let ((app_1
                                                    (+
                                                     total-used-bytes_0
                                                     used-bytes_1)))
                                               (let ((app_2
                                                      (+
                                                       total-chars_0
                                                       got-chars_1)))
                                                 (let ((app_3
                                                        (+
                                                         start_0
                                                         got-chars_1)))
                                                   (loop_0
                                                    app_0
                                                    app_1
                                                    new-state_0
                                                    app_2
                                                    app_3
                                                    (- amt_1 got-chars_1))))))
                                           (begin
                                             (if just-peek?4_0
                                               (void)
                                               (let ((discard-bytes_0
                                                      (-
                                                       actually-used-bytes_1
                                                       consumed-v_0)))
                                                 (let ((finish-bstr_0
                                                        (if (<=
                                                             discard-bytes_0
                                                             (unsafe-bytes-length
                                                              bstr_0))
                                                          bstr_0
                                                          (make-bytes
                                                           discard-bytes_0))))
                                                   (do-read-bytes!
                                                    who13_0
                                                    orig-in14_0
                                                    finish-bstr_0
                                                    0
                                                    discard-bytes_0))))
                                             (values
                                              (+ total-chars_0 got-chars_1)
                                              actually-used-bytes_1)))))))))))))
                         (let ((app_0 (+ skip5_0 (- v_0 consumed-v_0))))
                           (let ((app_1 (+ start16_0 got-chars_0)))
                             (loop_0
                              app_0
                              used-bytes_0
                              state_0
                              got-chars_0
                              app_1
                              (- amt_0 got-chars_0)))))
                        (begin
                          (if (if just-peek?4_0
                                just-peek?4_0
                                (= actually-used-bytes_0 consumed-v_0))
                            (void)
                            (do-read-bytes!
                             who13_0
                             orig-in14_0
                             bstr_0
                             0
                             (- actually-used-bytes_0 consumed-v_0)))
                          (values
                           got-chars_0
                           actually-used-bytes_0)))))))))))))))
(define do-read-string!.1
  (|#%name|
   do-read-string!
   (lambda (just-peek?19_0
            skip20_0
            special-ok?21_0
            who25_0
            in26_0
            str27_0
            start28_0
            end29_0)
     (let ((amt_0 (- end29_0 start28_0)))
       (call-with-values
        (lambda ()
          (read-some-chars!.1
           0
           just-peek?19_0
           #f
           skip20_0
           special-ok?21_0
           #f
           who25_0
           in26_0
           str27_0
           start28_0
           end29_0))
        (lambda (v_0 used-bytes_0)
          (if (not (exact-integer? v_0))
            v_0
            (if (= v_0 amt_0)
              v_0
              (letrec*
               ((loop_0
                 (|#%name|
                  loop
                  (lambda (got_0 total-used-bytes_0)
                    (call-with-values
                     (lambda ()
                       (let ((temp126_0 (+ start28_0 got_0)))
                         (let ((temp130_0
                                (if just-peek?19_0
                                  (+ skip20_0 total-used-bytes_0)
                                  0)))
                           (let ((temp126_1 temp126_0))
                             (read-some-chars!.1
                              0
                              just-peek?19_0
                              #t
                              temp130_0
                              #f
                              #f
                              who25_0
                              in26_0
                              str27_0
                              temp126_1
                              end29_0)))))
                     (lambda (v_1 used-bytes_1)
                       (if (eof-object? v_1)
                         got_0
                         (let ((new-got_0 (+ got_0 v_1)))
                           (if (= new-got_0 amt_0)
                             amt_0
                             (loop_0
                              new-got_0
                              (+ total-used-bytes_0 used-bytes_1)))))))))))
               (loop_0 v_0 used-bytes_0))))))))))
(define read-char-via-read-byte.1
  (|#%name|
   read-char-via-read-byte
   (lambda (special-ok?31_0 who33_0 in34_0)
     (let ((b_0 (read-a-byte.1 special-ok?31_0 who33_0 in34_0)))
       (if (eof-object? b_0)
         b_0
         (if (if special-ok?31_0 (procedure? b_0) #f)
           b_0
           (if (fx< b_0 128)
             (integer->char b_0)
             (call-with-values
              (lambda () (utf-8-decode-byte b_0 0 0))
              (lambda (accum_0 remaining_0 state_0)
                (if (eq? state_0 'error)
                  '#\xfffd
                  (letrec*
                   ((loop_0
                     (|#%name|
                      loop
                      (lambda (skip-k_0 accum_1 remaining_1)
                        (let ((b_1 (peek-a-byte.1 #f who33_0 in34_0 skip-k_0)))
                          (if (eof-object? b_1)
                            '#\xfffd
                            (call-with-values
                             (lambda ()
                               (utf-8-decode-byte b_1 accum_1 remaining_1))
                             (lambda (next-accum_0 next-remaining_0 state_1)
                               (if (eq? state_1 'complete)
                                 (begin
                                   (letrec*
                                    ((loop_1
                                      (|#%name|
                                       loop
                                       (lambda (skip-k_1)
                                         (begin
                                           (read-a-byte.1 #f who33_0 in34_0)
                                           (if (fx= 0 skip-k_1)
                                             (void)
                                             (loop_1 (fx- skip-k_1 1))))))))
                                    (loop_1 skip-k_0))
                                   (integer->char next-accum_0))
                                 (if (eq? state_1 'error)
                                   '#\xfffd
                                   (loop_0
                                    (fx+ 1 skip-k_0)
                                    next-accum_0
                                    next-remaining_0)))))))))))
                   (loop_0 0 accum_0 remaining_0))))))))))))
(define read-a-char.1
  (|#%name|
   read-a-char
   (lambda (special-ok?36_0 who38_0 in39_0)
     (read-char-via-read-byte.1 special-ok?36_0 who38_0 in39_0))))
(define 1/read-char
  (let ((read-char_0
         (|#%name|
          read-char
          (lambda (in41_0)
            (let ((in_0
                   (if (eq? in41_0 unsafe-undefined)
                     (1/current-input-port)
                     in41_0)))
              (let ((in_1
                     (->core-input-port.1 unsafe-undefined in_0 'read-char)))
                (read-a-char.1 #f 'read-char in_1)))))))
    (|#%name|
     read-char
     (case-lambda
      (() (read-char_0 unsafe-undefined))
      ((in41_0) (read-char_0 in41_0))))))
(define 1/read-string
  (let ((read-string_0
         (|#%name|
          read-string
          (lambda (amt43_0 in42_0)
            (let ((in_0
                   (if (eq? in42_0 unsafe-undefined)
                     (1/current-input-port)
                     in42_0)))
              (begin
                (if (exact-nonnegative-integer? amt43_0)
                  (void)
                  (raise-argument-error
                   'read-string
                   "exact-nonnegative-integer?"
                   amt43_0))
                (if (1/input-port? in_0)
                  (void)
                  (raise-argument-error 'read-string "input-port?" in_0))
                (maybe-flush-stdout in_0)
                (let ((in_1 (->core-input-port.1 unsafe-undefined in_0 #f)))
                  (let ((bstr_0 (make-string amt43_0)))
                    (let ((v_0
                           (do-read-string!.1
                            #f
                            0
                            #f
                            'read-string
                            in_1
                            bstr_0
                            0
                            amt43_0)))
                      (if (exact-integer? v_0)
                        (if (= v_0 amt43_0) bstr_0 (substring bstr_0 0 v_0))
                        v_0))))))))))
    (|#%name|
     read-string
     (case-lambda
      ((amt_0) (read-string_0 amt_0 unsafe-undefined))
      ((amt_0 in42_0) (read-string_0 amt_0 in42_0))))))
(define 1/read-string!
  (let ((read-string!_0
         (|#%name|
          read-string!
          (lambda (str47_0 in44_0 start-pos45_0 end-pos46_0)
            (let ((in_0
                   (if (eq? in44_0 unsafe-undefined)
                     (1/current-input-port)
                     in44_0)))
              (let ((end-pos_0
                     (if (eq? end-pos46_0 unsafe-undefined)
                       (if (string? str47_0) (string-length str47_0) #f)
                       end-pos46_0)))
                (begin
                  (if (string? str47_0)
                    (void)
                    (raise-argument-error 'read-string! "string?" str47_0))
                  (if (1/input-port? in_0)
                    (void)
                    (raise-argument-error 'read-string! "input-port?" in_0))
                  (if (exact-nonnegative-integer? start-pos45_0)
                    (void)
                    (raise-argument-error
                     'read-string!
                     "exact-nonnegative-integer?"
                     start-pos45_0))
                  (if (exact-nonnegative-integer? end-pos_0)
                    (void)
                    (raise-argument-error
                     'read-string!
                     "exact-nonnegative-integer?"
                     end-pos_0))
                  (check-range$1
                   'read-string!
                   start-pos45_0
                   end-pos_0
                   (string-length str47_0)
                   str47_0)
                  (maybe-flush-stdout in_0)
                  (let ((in_1 (->core-input-port.1 unsafe-undefined in_0 #f)))
                    (do-read-string!.1
                     #f
                     0
                     #f
                     'read-string!
                     in_1
                     str47_0
                     start-pos45_0
                     end-pos_0)))))))))
    (|#%name|
     read-string!
     (case-lambda
      ((str_0) (read-string!_0 str_0 unsafe-undefined 0 unsafe-undefined))
      ((str_0 in_0 start-pos_0 end-pos46_0)
       (read-string!_0 str_0 in_0 start-pos_0 end-pos46_0))
      ((str_0 in_0 start-pos45_0)
       (read-string!_0 str_0 in_0 start-pos45_0 unsafe-undefined))
      ((str_0 in44_0) (read-string!_0 str_0 in44_0 0 unsafe-undefined))))))
(define do-peek-string!.1
  (|#%name|
   do-peek-string!
   (lambda (special-ok?48_0 who50_0 in51_0 str52_0 start53_0 end54_0 skip55_0)
     (do-read-string!.1
      #t
      skip55_0
      special-ok?48_0
      who50_0
      in51_0
      str52_0
      start53_0
      end54_0))))
(define peek-a-char.1
  (|#%name|
   peek-a-char
   (lambda (special-ok?57_0 who59_0 in60_0 skip-k61_0)
     (let ((b_0 (peek-a-byte.1 special-ok?57_0 who59_0 in60_0 skip-k61_0)))
       (if (if b_0
             (let ((or-part_0 (eof-object? b_0)))
               (if or-part_0
                 or-part_0
                 (let ((or-part_1 (if (byte? b_0) (< b_0 128) #f)))
                   (if or-part_1 or-part_1 (procedure? b_0)))))
             #f)
         (if (fixnum? b_0) (integer->char b_0) b_0)
         (let ((bstr_0 (make-string 1)))
           (let ((v_0
                  (do-peek-string!.1
                   special-ok?57_0
                   who59_0
                   in60_0
                   bstr_0
                   0
                   1
                   skip-k61_0)))
             (if (eq? v_0 1) (string-ref bstr_0 0) v_0))))))))
(define 1/peek-char
  (let ((peek-char_0
         (|#%name|
          peek-char
          (lambda (in63_0 skip-k64_0)
            (let ((in_0
                   (if (eq? in63_0 unsafe-undefined)
                     (1/current-input-port)
                     in63_0)))
              (let ((in_1
                     (->core-input-port.1 unsafe-undefined in_0 'peek-char)))
                (begin
                  (if (exact-nonnegative-integer? skip-k64_0)
                    (void)
                    (raise-argument-error
                     'peek-char
                     "exact-nonnegative-integer?"
                     skip-k64_0))
                  (peek-a-char.1 #f 'peek-char in_1 skip-k64_0))))))))
    (|#%name|
     peek-char
     (case-lambda
      (() (peek-char_0 unsafe-undefined 0))
      ((in_0 skip-k64_0) (peek-char_0 in_0 skip-k64_0))
      ((in63_0) (peek-char_0 in63_0 0))))))
(define 1/peek-string
  (let ((peek-string_0
         (|#%name|
          peek-string
          (lambda (amt66_0 skip-k67_0 in65_0)
            (let ((in_0
                   (if (eq? in65_0 unsafe-undefined)
                     (1/current-input-port)
                     in65_0)))
              (begin
                (if (exact-nonnegative-integer? amt66_0)
                  (void)
                  (raise-argument-error
                   'peek-string
                   "exact-nonnegative-integer?"
                   amt66_0))
                (if (exact-nonnegative-integer? skip-k67_0)
                  (void)
                  (raise-argument-error
                   'peek-string
                   "exact-nonnegative-integer?"
                   skip-k67_0))
                (if (1/input-port? in_0)
                  (void)
                  (raise-argument-error 'peek-string "input-port?" in_0))
                (maybe-flush-stdout in_0)
                (let ((in_1 (->core-input-port.1 unsafe-undefined in_0 #f)))
                  (let ((bstr_0 (make-string amt66_0)))
                    (let ((v_0
                           (do-peek-string!.1
                            #f
                            'peek-string
                            in_1
                            bstr_0
                            0
                            amt66_0
                            skip-k67_0)))
                      (if (exact-integer? v_0)
                        (if (= v_0 amt66_0) bstr_0 (substring bstr_0 0 v_0))
                        v_0))))))))))
    (|#%name|
     peek-string
     (case-lambda
      ((amt_0 skip-k_0) (peek-string_0 amt_0 skip-k_0 unsafe-undefined))
      ((amt_0 skip-k_0 in65_0) (peek-string_0 amt_0 skip-k_0 in65_0))))))
(define 1/peek-string!
  (let ((peek-string!_0
         (|#%name|
          peek-string!
          (lambda (str71_0 skip-k72_0 in68_0 start-pos69_0 end-pos70_0)
            (let ((in_0
                   (if (eq? in68_0 unsafe-undefined)
                     (1/current-input-port)
                     in68_0)))
              (let ((end-pos_0
                     (if (eq? end-pos70_0 unsafe-undefined)
                       (if (string? str71_0) (string-length str71_0) #f)
                       end-pos70_0)))
                (begin
                  (if (string? str71_0)
                    (void)
                    (raise-argument-error 'peek-string! "string?" str71_0))
                  (if (exact-nonnegative-integer? skip-k72_0)
                    (void)
                    (raise-argument-error
                     'peek-string!
                     "exact-nonnegative-integer?"
                     skip-k72_0))
                  (if (1/input-port? in_0)
                    (void)
                    (raise-argument-error 'peek-string! "input-port?" in_0))
                  (if (exact-nonnegative-integer? start-pos69_0)
                    (void)
                    (raise-argument-error
                     'peek-string!
                     "exact-nonnegative-integer?"
                     start-pos69_0))
                  (if (exact-nonnegative-integer? end-pos_0)
                    (void)
                    (raise-argument-error
                     'peek-string!
                     "exact-nonnegative-integer?"
                     end-pos_0))
                  (check-range$1
                   'peek-string!
                   start-pos69_0
                   end-pos_0
                   (string-length str71_0)
                   str71_0)
                  (maybe-flush-stdout in_0)
                  (let ((in_1 (->core-input-port.1 unsafe-undefined in_0 #f)))
                    (do-peek-string!.1
                     #f
                     'peek-string!
                     in_1
                     str71_0
                     start-pos69_0
                     end-pos_0
                     skip-k72_0)))))))))
    (|#%name|
     peek-string!
     (case-lambda
      ((str_0 skip-k_0)
       (peek-string!_0 str_0 skip-k_0 unsafe-undefined 0 unsafe-undefined))
      ((str_0 skip-k_0 in_0 start-pos_0 end-pos70_0)
       (peek-string!_0 str_0 skip-k_0 in_0 start-pos_0 end-pos70_0))
      ((str_0 skip-k_0 in_0 start-pos69_0)
       (peek-string!_0 str_0 skip-k_0 in_0 start-pos69_0 unsafe-undefined))
      ((str_0 skip-k_0 in68_0)
       (peek-string!_0 str_0 skip-k_0 in68_0 0 unsafe-undefined))))))
(define 1/read-byte-or-special
  (let ((read-byte-or-special_0
         (|#%name|
          read-byte-or-special
          (lambda (orig-in1_0 special-wrap2_0 source-name3_0)
            (let ((orig-in_0
                   (if (eq? orig-in1_0 unsafe-undefined)
                     (1/current-input-port)
                     orig-in1_0)))
              (begin
                (if (1/input-port? orig-in_0)
                  (void)
                  (raise-argument-error
                   'read-byte-or-special
                   "input-port?"
                   orig-in_0))
                (if (let ((or-part_0 (not special-wrap2_0)))
                      (if or-part_0
                        or-part_0
                        (if (procedure? special-wrap2_0)
                          (procedure-arity-includes? special-wrap2_0 1)
                          #f)))
                  (void)
                  (raise-argument-error
                   'read-byte-or-special
                   "(or/c #f (procedure-arity-includes/c 1))"
                   special-wrap2_0))
                (let ((in_0
                       (->core-input-port.1 unsafe-undefined orig-in_0 #f)))
                  (let ((v_0 (read-a-byte.1 #t 'read-byte-or-special in_0)))
                    (if (fixnum? v_0)
                      v_0
                      (extract-special-value
                       v_0
                       in_0
                       source-name3_0
                       -1
                       special-wrap2_0))))))))))
    (|#%name|
     read-byte-or-special
     (case-lambda
      (() (read-byte-or-special_0 unsafe-undefined #f #f))
      ((orig-in_0 special-wrap_0 source-name3_0)
       (read-byte-or-special_0 orig-in_0 special-wrap_0 source-name3_0))
      ((orig-in_0 special-wrap2_0)
       (read-byte-or-special_0 orig-in_0 special-wrap2_0 #f))
      ((orig-in1_0) (read-byte-or-special_0 orig-in1_0 #f #f))))))
(define 1/peek-byte-or-special
  (let ((peek-byte-or-special_0
         (|#%name|
          peek-byte-or-special
          (lambda (orig-in4_0
                   skip-k5_0
                   progress-evt6_0
                   special-wrap7_0
                   source-name8_0)
            (let ((orig-in_0
                   (if (eq? orig-in4_0 unsafe-undefined)
                     (1/current-input-port)
                     orig-in4_0)))
              (begin
                (if (1/input-port? orig-in_0)
                  (void)
                  (raise-argument-error
                   'peek-byte-or-special
                   "input-port?"
                   orig-in_0))
                (if (exact-nonnegative-integer? skip-k5_0)
                  (void)
                  (raise-argument-error
                   'peek-byte-or-special
                   "exact-nonnegative-integer?"
                   skip-k5_0))
                (if (let ((or-part_0 (not progress-evt6_0)))
                      (if or-part_0 or-part_0 (evt? progress-evt6_0)))
                  (void)
                  (raise-argument-error
                   'peek-byte-or-special
                   "(or/c #f evt?)"
                   progress-evt6_0))
                (if (special-wrap-for-peek? special-wrap7_0)
                  (void)
                  (raise-argument-error
                   'peek-byte-or-special
                   special-wrap-for-peek/c-str
                   special-wrap7_0))
                (if progress-evt6_0
                  (check-progress-evt
                   'peek-byte-or-special
                   progress-evt6_0
                   orig-in_0)
                  (void))
                (let ((in_0
                       (->core-input-port.1 unsafe-undefined orig-in_0 #f)))
                  (if (not progress-evt6_0)
                    (let ((v_0
                           (peek-a-byte.1
                            #t
                            'peek-byte-or-special
                            in_0
                            skip-k5_0)))
                      (if (fixnum? v_0)
                        v_0
                        (extract-special-value
                         v_0
                         in_0
                         source-name8_0
                         skip-k5_0
                         special-wrap7_0)))
                    (extract-special-value
                     (peek-byte-via-bytes.1
                      progress-evt6_0
                      #t
                      'peek-byte-or-special
                      in_0
                      skip-k5_0)
                     in_0
                     source-name8_0
                     skip-k5_0
                     special-wrap7_0)))))))))
    (|#%name|
     peek-byte-or-special
     (case-lambda
      (() (peek-byte-or-special_0 unsafe-undefined 0 #f #f #f))
      ((orig-in_0 skip-k_0 progress-evt_0 special-wrap_0 source-name8_0)
       (peek-byte-or-special_0
        orig-in_0
        skip-k_0
        progress-evt_0
        special-wrap_0
        source-name8_0))
      ((orig-in_0 skip-k_0 progress-evt_0 special-wrap7_0)
       (peek-byte-or-special_0
        orig-in_0
        skip-k_0
        progress-evt_0
        special-wrap7_0
        #f))
      ((orig-in_0 skip-k_0 progress-evt6_0)
       (peek-byte-or-special_0 orig-in_0 skip-k_0 progress-evt6_0 #f #f))
      ((orig-in_0 skip-k5_0)
       (peek-byte-or-special_0 orig-in_0 skip-k5_0 #f #f #f))
      ((orig-in4_0) (peek-byte-or-special_0 orig-in4_0 0 #f #f #f))))))
(define 1/read-char-or-special
  (let ((read-char-or-special_0
         (|#%name|
          read-char-or-special
          (lambda (in9_0 special-wrap10_0 source-name11_0)
            (let ((in_0
                   (if (eq? in9_0 unsafe-undefined)
                     (1/current-input-port)
                     in9_0)))
              (let ((in_1
                     (->core-input-port.1
                      unsafe-undefined
                      in_0
                      'read-char-or-special)))
                (begin
                  (if (let ((or-part_0 (not special-wrap10_0)))
                        (if or-part_0
                          or-part_0
                          (if (procedure? special-wrap10_0)
                            (procedure-arity-includes? special-wrap10_0 1)
                            #f)))
                    (void)
                    (raise-argument-error
                     'read-char-or-special
                     "(or/c #f (procedure-arity-includes/c 1))"
                     special-wrap10_0))
                  (let ((c_0 (read-a-char.1 #t 'read-char-or-special in_1)))
                    (if (char? c_0)
                      c_0
                      (extract-special-value
                       c_0
                       in_1
                       source-name11_0
                       -1
                       special-wrap10_0))))))))))
    (|#%name|
     read-char-or-special
     (case-lambda
      (() (read-char-or-special_0 unsafe-undefined #f #f))
      ((in_0 special-wrap_0 source-name11_0)
       (read-char-or-special_0 in_0 special-wrap_0 source-name11_0))
      ((in_0 special-wrap10_0)
       (read-char-or-special_0 in_0 special-wrap10_0 #f))
      ((in9_0) (read-char-or-special_0 in9_0 #f #f))))))
(define 1/peek-char-or-special
  (let ((peek-char-or-special_0
         (|#%name|
          peek-char-or-special
          (lambda (in12_0 skip-k13_0 special-wrap14_0 source-name15_0)
            (let ((in_0
                   (if (eq? in12_0 unsafe-undefined)
                     (1/current-input-port)
                     in12_0)))
              (let ((in_1
                     (->core-input-port.1
                      unsafe-undefined
                      in_0
                      'peek-char-or-special)))
                (begin
                  (if (exact-nonnegative-integer? skip-k13_0)
                    (void)
                    (raise-argument-error
                     'peek-char-or-special
                     "exact-nonnegative-integer?"
                     skip-k13_0))
                  (begin
                    (if (special-wrap-for-peek? special-wrap14_0)
                      (void)
                      (raise-argument-error
                       'peek-char-or-special
                       special-wrap-for-peek/c-str
                       special-wrap14_0))
                    (let ((c_0
                           (peek-a-char.1
                            #t
                            'peek-char-or-special
                            in_1
                            skip-k13_0)))
                      (if (char? c_0)
                        c_0
                        (extract-special-value
                         c_0
                         in_1
                         source-name15_0
                         skip-k13_0
                         special-wrap14_0)))))))))))
    (|#%name|
     peek-char-or-special
     (case-lambda
      (() (peek-char-or-special_0 unsafe-undefined 0 #f #f))
      ((in_0 skip-k_0 special-wrap_0 source-name15_0)
       (peek-char-or-special_0 in_0 skip-k_0 special-wrap_0 source-name15_0))
      ((in_0 skip-k_0 special-wrap14_0)
       (peek-char-or-special_0 in_0 skip-k_0 special-wrap14_0 #f))
      ((in_0 skip-k13_0) (peek-char-or-special_0 in_0 skip-k13_0 #f #f))
      ((in12_0) (peek-char-or-special_0 in12_0 0 #f #f))))))
(define extract-special-value
  (lambda (v_0 in_0 source-name_0 delta_0 special-wrap_0)
    (if (procedure? v_0)
      (if (eq? special-wrap_0 'special)
        'special
        (let ((special_0
               (call-with-values
                (lambda () (1/port-next-location in_0))
                (lambda (line_0 col_0 pos_0)
                  (let ((app_0 (if col_0 (+ col_0 delta_0) #f)))
                    (|#%app|
                     v_0
                     source-name_0
                     line_0
                     app_0
                     (if pos_0 (+ pos_0 delta_0) #f)))))))
          (if special-wrap_0 (|#%app| special-wrap_0 special_0) special_0)))
      v_0)))
(define special-wrap-for-peek?
  (lambda (w_0)
    (let ((or-part_0 (not w_0)))
      (if or-part_0
        or-part_0
        (let ((or-part_1 (eq? w_0 'special)))
          (if or-part_1
            or-part_1
            (if (procedure? w_0) (procedure-arity-includes? w_0 1) #f)))))))
(define special-wrap-for-peek/c-str "(or/c (any/c -> any/c) #f 'special)")
(define write-some-bytes.1
  (|#%name|
   write-some-bytes
   (lambda (buffer-ok?2_0
            copy-bstr?1_0
            enable-break?4_0
            zero-ok?3_0
            who9_0
            out10_0
            bstr11_0
            start12_0
            end13_0)
     (letrec*
      ((try-again_0
        (|#%name|
         try-again
         (lambda (out_0 extra-count-outs_0)
           (begin
             (unsafe-start-atomic)
             (if (fx= start12_0 end13_0)
               (begin (check-not-closed who9_0 out_0) (unsafe-end-atomic) 0)
               (let ((buffer_0 (core-port-buffer out_0)))
                 (let ((buf-pos_0 (direct-pos buffer_0)))
                   (let ((buf-end_0 (direct-end buffer_0)))
                     (if (fx< buf-pos_0 buf-end_0)
                       (let ((v_0
                              (let ((app_0 (fx- buf-end_0 buf-pos_0)))
                                (fxmin app_0 (fx- end13_0 start12_0)))))
                         (begin
                           (let ((app_0 (direct-bstr buffer_0)))
                             (unsafe-bytes-copy!
                              app_0
                              buf-pos_0
                              bstr11_0
                              start12_0
                              (fx+ start12_0 v_0)))
                           (set-direct-pos! buffer_0 (fx+ buf-pos_0 v_0))
                           (if (let ((or-part_0 (pair? extra-count-outs_0)))
                                 (if or-part_0
                                   or-part_0
                                   (core-port-count out_0)))
                             (port-count-all!
                              out_0
                              extra-count-outs_0
                              v_0
                              bstr11_0
                              start12_0)
                             (void))
                           (unsafe-end-atomic)
                           v_0))
                       (begin
                         (check-not-closed who9_0 out_0)
                         (let ((write-out_0
                                (core-output-port-methods-write-out.1
                                 (core-port-vtable out_0))))
                           (if (procedure? write-out_0)
                             (let ((v_0
                                    (|#%app|
                                     write-out_0
                                     out_0
                                     bstr11_0
                                     start12_0
                                     end13_0
                                     (not buffer-ok?2_0)
                                     enable-break?4_0
                                     copy-bstr?1_0)))
                               (letrec*
                                ((result-loop_0
                                  (|#%name|
                                   result-loop
                                   (lambda (v_1)
                                     (if (not v_1)
                                       (begin
                                         (unsafe-end-atomic)
                                         (if zero-ok?3_0
                                           0
                                           (try-again_0
                                            out_0
                                            extra-count-outs_0)))
                                       (if (exact-positive-integer? v_1)
                                         (begin
                                           (port-count-all!
                                            out_0
                                            extra-count-outs_0
                                            v_1
                                            bstr11_0
                                            start12_0)
                                           (unsafe-end-atomic)
                                           v_1)
                                         (if (evt? v_1)
                                           (begin
                                             (unsafe-end-atomic)
                                             (if zero-ok?3_0
                                               0
                                               (let ((new-v_0
                                                      (if enable-break?4_0
                                                        (sync/enable-break v_1)
                                                        (sync v_1))))
                                                 (begin
                                                   (unsafe-start-atomic)
                                                   (result-loop_0 new-v_0)))))
                                           (begin
                                             (unsafe-end-atomic)
                                             (internal-error
                                              (format
                                               "write-some-bytes: weird result ~s for ~s ~s ~s at ~s"
                                               v_1
                                               bstr11_0
                                               start12_0
                                               end13_0
                                               out_0))))))))))
                                (result-loop_0 v_0)))
                             (begin
                               (unsafe-end-atomic)
                               (let ((app_0
                                      (->core-output-port.1
                                       unsafe-undefined
                                       write-out_0
                                       #f)))
                                 (try-again_0
                                  app_0
                                  (cons
                                   out_0
                                   extra-count-outs_0)))))))))))))))))
      (try-again_0 out10_0 null)))))
(define 1/write-byte
  (let ((write-byte_0
         (|#%name|
          write-byte
          (lambda (b2_0 out1_0)
            (let ((out_0
                   (if (eq? out1_0 unsafe-undefined)
                     (1/current-output-port)
                     out1_0)))
              (begin
                (if (byte? b2_0)
                  (void)
                  (raise-argument-error 'write-byte "byte?" b2_0))
                (do-write-byte
                 b2_0
                 (->core-output-port.1
                  unsafe-undefined
                  out_0
                  'write-byte))))))))
    (|#%name|
     write-byte
     (case-lambda
      ((b_0) (write-byte_0 b_0 unsafe-undefined))
      ((b_0 out1_0) (write-byte_0 b_0 out1_0))))))
(define do-write-byte
  (lambda (b_0 out_0)
    (begin
      (unsafe-start-atomic)
      (let ((buffer_0 (core-port-buffer out_0)))
        (let ((pos_0 (direct-pos buffer_0)))
          (begin
            (if (fx< pos_0 (direct-end buffer_0))
              (begin
                (unsafe-bytes-set! (direct-bstr buffer_0) pos_0 b_0)
                (set-direct-pos! buffer_0 (fx+ pos_0 1))
                (if (core-port-count out_0)
                  (port-count-byte! out_0 b_0)
                  (void))
                (unsafe-end-atomic))
              (begin
                (unsafe-end-atomic)
                (let ((temp34_0 (bytes b_0)))
                  (write-some-bytes.1
                   #t
                   #f
                   #f
                   #f
                   'write-byte
                   out_0
                   temp34_0
                   0
                   1))))
            (void)))))))
(define do-write-bytes
  (lambda (who_0 out_0 bstr_0 start_0 end_0)
    (letrec*
     ((loop_0
       (|#%name|
        loop
        (lambda (i_0)
          (if (fx= i_0 end_0)
            (fx- i_0 start_0)
            (let ((n_0
                   (write-some-bytes.1
                    #t
                    #t
                    #f
                    #f
                    who_0
                    out_0
                    bstr_0
                    i_0
                    end_0)))
              (loop_0 (fx+ n_0 i_0))))))))
     (loop_0 start_0))))
(define 1/write-bytes
  (|#%name|
   write-bytes
   (case-lambda
    ((bstr_0)
     (begin
       (if (bytes? bstr_0)
         (void)
         (raise-argument-error 'write-bytes "bytes?" bstr_0))
       (let ((out_0
              (let ((temp46_0 (1/current-output-port)))
                (->core-output-port.1 unsafe-undefined temp46_0 #f))))
         (do-write-bytes
          'write-bytes
          out_0
          bstr_0
          0
          (unsafe-bytes-length bstr_0)))))
    ((bstr_0 out_0)
     (begin
       (if (bytes? bstr_0)
         (void)
         (raise-argument-error 'write-bytes "bytes?" bstr_0))
       (let ((out_1
              (->core-output-port.1 unsafe-undefined out_0 'write-bytes)))
         (do-write-bytes
          'write-bytes
          out_1
          bstr_0
          0
          (unsafe-bytes-length bstr_0)))))
    ((bstr_0 out_0 start-pos_0)
     (1/write-bytes
      bstr_0
      out_0
      start-pos_0
      (if (bytes? bstr_0) (unsafe-bytes-length bstr_0) #f)))
    ((bstr_0 out_0 start-pos_0 end-pos_0)
     (begin
       (if (bytes? bstr_0)
         (void)
         (raise-argument-error 'write-bytes "bytes?" bstr_0))
       (let ((out_1
              (->core-output-port.1 unsafe-undefined out_0 'write-bytes)))
         (begin
           (if (exact-nonnegative-integer? start-pos_0)
             (void)
             (raise-argument-error
              'write-bytes
              "exact-nonnegative-integer?"
              start-pos_0))
           (if (exact-nonnegative-integer? end-pos_0)
             (void)
             (raise-argument-error
              'write-bytes
              "exact-nonnegative-integer?"
              end-pos_0))
           (check-range$1
            'write-bytes
            start-pos_0
            end-pos_0
            (unsafe-bytes-length bstr_0)
            bstr_0)
           (do-write-bytes
            'write-bytes
            out_1
            bstr_0
            start-pos_0
            end-pos_0))))))))
(define unsafe-write-bytes
  (lambda (who_0 bstr_0 o_0)
    (do-write-bytes who_0 o_0 bstr_0 0 (unsafe-bytes-length bstr_0))))
(define do-write-bytes-avail.1
  (|#%name|
   do-write-bytes-avail
   (lambda (enable-break?4_0
            zero-ok?3_0
            who7_0
            bstr8_0
            out9_0
            start-pos10_0
            end-pos11_0)
     (begin
       (if (bytes? bstr8_0)
         (void)
         (raise-argument-error who7_0 "bytes?" bstr8_0))
       (if (1/output-port? out9_0)
         (void)
         (raise-argument-error who7_0 "output-port?" out9_0))
       (if (exact-nonnegative-integer? start-pos10_0)
         (void)
         (raise-argument-error
          who7_0
          "exact-nonnegative-integer?"
          start-pos10_0))
       (if (exact-nonnegative-integer? end-pos11_0)
         (void)
         (raise-argument-error
          who7_0
          "exact-nonnegative-integer?"
          end-pos11_0))
       (check-range$1
        who7_0
        start-pos10_0
        end-pos11_0
        (unsafe-bytes-length bstr8_0)
        bstr8_0)
       (let ((out_0 (->core-output-port.1 unsafe-undefined out9_0 #f)))
         (write-some-bytes.1
          #f
          #t
          enable-break?4_0
          zero-ok?3_0
          who7_0
          out_0
          bstr8_0
          start-pos10_0
          end-pos11_0))))))
(define 1/write-bytes-avail
  (let ((write-bytes-avail_0
         (|#%name|
          write-bytes-avail
          (lambda (bstr16_0 out13_0 start-pos14_0 end-pos15_0)
            (let ((out_0
                   (if (eq? out13_0 unsafe-undefined)
                     (1/current-output-port)
                     out13_0)))
              (let ((end-pos_0
                     (if (eq? end-pos15_0 unsafe-undefined)
                       (if (bytes? bstr16_0) (unsafe-bytes-length bstr16_0) #f)
                       end-pos15_0)))
                (do-write-bytes-avail.1
                 #f
                 #f
                 'write-bytes-avail
                 bstr16_0
                 out_0
                 start-pos14_0
                 end-pos_0)))))))
    (|#%name|
     write-bytes-avail
     (case-lambda
      ((bstr_0)
       (write-bytes-avail_0 bstr_0 unsafe-undefined 0 unsafe-undefined))
      ((bstr_0 out_0 start-pos_0 end-pos15_0)
       (write-bytes-avail_0 bstr_0 out_0 start-pos_0 end-pos15_0))
      ((bstr_0 out_0 start-pos14_0)
       (write-bytes-avail_0 bstr_0 out_0 start-pos14_0 unsafe-undefined))
      ((bstr_0 out13_0)
       (write-bytes-avail_0 bstr_0 out13_0 0 unsafe-undefined))))))
(define 1/write-bytes-avail*
  (let ((write-bytes-avail*_0
         (|#%name|
          write-bytes-avail*
          (lambda (bstr20_0 out17_0 start-pos18_0 end-pos19_0)
            (let ((out_0
                   (if (eq? out17_0 unsafe-undefined)
                     (1/current-output-port)
                     out17_0)))
              (let ((end-pos_0
                     (if (eq? end-pos19_0 unsafe-undefined)
                       (if (bytes? bstr20_0) (unsafe-bytes-length bstr20_0) #f)
                       end-pos19_0)))
                (do-write-bytes-avail.1
                 #f
                 #t
                 'write-bytes-avail*
                 bstr20_0
                 out_0
                 start-pos18_0
                 end-pos_0)))))))
    (|#%name|
     write-bytes-avail*
     (case-lambda
      ((bstr_0)
       (write-bytes-avail*_0 bstr_0 unsafe-undefined 0 unsafe-undefined))
      ((bstr_0 out_0 start-pos_0 end-pos19_0)
       (write-bytes-avail*_0 bstr_0 out_0 start-pos_0 end-pos19_0))
      ((bstr_0 out_0 start-pos18_0)
       (write-bytes-avail*_0 bstr_0 out_0 start-pos18_0 unsafe-undefined))
      ((bstr_0 out17_0)
       (write-bytes-avail*_0 bstr_0 out17_0 0 unsafe-undefined))))))
(define 1/write-bytes-avail/enable-break
  (let ((write-bytes-avail/enable-break_0
         (|#%name|
          write-bytes-avail/enable-break
          (lambda (bstr24_0 out21_0 start-pos22_0 end-pos23_0)
            (let ((out_0
                   (if (eq? out21_0 unsafe-undefined)
                     (1/current-output-port)
                     out21_0)))
              (let ((end-pos_0
                     (if (eq? end-pos23_0 unsafe-undefined)
                       (if (bytes? bstr24_0) (unsafe-bytes-length bstr24_0) #f)
                       end-pos23_0)))
                (do-write-bytes-avail.1
                 #t
                 #f
                 'write-bytes-avail/enable-break
                 bstr24_0
                 out_0
                 start-pos22_0
                 end-pos_0)))))))
    (|#%name|
     write-bytes-avail/enable-break
     (case-lambda
      ((bstr_0)
       (write-bytes-avail/enable-break_0
        bstr_0
        unsafe-undefined
        0
        unsafe-undefined))
      ((bstr_0 out_0 start-pos_0 end-pos23_0)
       (write-bytes-avail/enable-break_0 bstr_0 out_0 start-pos_0 end-pos23_0))
      ((bstr_0 out_0 start-pos22_0)
       (write-bytes-avail/enable-break_0
        bstr_0
        out_0
        start-pos22_0
        unsafe-undefined))
      ((bstr_0 out21_0)
       (write-bytes-avail/enable-break_0
        bstr_0
        out21_0
        0
        unsafe-undefined))))))
(define 1/write-bytes-avail-evt
  (let ((write-bytes-avail-evt_0
         (|#%name|
          write-bytes-avail-evt
          (lambda (bstr28_0 out25_0 start-pos26_0 end-pos27_0)
            (let ((out_0
                   (if (eq? out25_0 unsafe-undefined)
                     (1/current-output-port)
                     out25_0)))
              (let ((end-pos_0
                     (if (eq? end-pos27_0 unsafe-undefined)
                       (if (bytes? bstr28_0) (unsafe-bytes-length bstr28_0) #f)
                       end-pos27_0)))
                (begin
                  (if (bytes? bstr28_0)
                    (void)
                    (raise-argument-error
                     'write-bytes-avail-evt
                     "bytes?"
                     bstr28_0))
                  (if (1/output-port? out_0)
                    (void)
                    (raise-argument-error
                     'write-bytes-avail-evt
                     "output-port?"
                     out_0))
                  (if (exact-nonnegative-integer? start-pos26_0)
                    (void)
                    (raise-argument-error
                     'write-bytes-avail-evt
                     "exact-nonnegative-integer?"
                     start-pos26_0))
                  (if (exact-nonnegative-integer? end-pos_0)
                    (void)
                    (raise-argument-error
                     'write-bytes-avail-evt
                     "exact-nonnegative-integer?"
                     end-pos_0))
                  (check-range$1
                   'write-bytes-avail-evt
                   start-pos26_0
                   end-pos_0
                   (unsafe-bytes-length bstr28_0)
                   bstr28_0)
                  (let ((out_1
                         (->core-output-port.1 unsafe-undefined out_0 #f)))
                    (begin
                      (unsafe-start-atomic)
                      (begin0
                        (begin
                          (check-not-closed 'write-bytes-avail-evt out_1)
                          (let ((get-write-evt_0
                                 (core-output-port-methods-get-write-evt.1
                                  (core-port-vtable out_1))))
                            (begin
                              (if get-write-evt_0
                                (void)
                                (begin
                                  (unsafe-end-atomic)
                                  (raise-arguments-error
                                   'write-bytes-avail-evt
                                   "port does not support output events"
                                   "port"
                                   out_1)))
                              (|#%app|
                               get-write-evt_0
                               out_1
                               bstr28_0
                               start-pos26_0
                               end-pos_0))))
                        (unsafe-end-atomic)))))))))))
    (|#%name|
     write-bytes-avail-evt
     (case-lambda
      ((bstr_0)
       (write-bytes-avail-evt_0 bstr_0 unsafe-undefined 0 unsafe-undefined))
      ((bstr_0 out_0 start-pos_0 end-pos27_0)
       (write-bytes-avail-evt_0 bstr_0 out_0 start-pos_0 end-pos27_0))
      ((bstr_0 out_0 start-pos26_0)
       (write-bytes-avail-evt_0 bstr_0 out_0 start-pos26_0 unsafe-undefined))
      ((bstr_0 out25_0)
       (write-bytes-avail-evt_0 bstr_0 out25_0 0 unsafe-undefined))))))
(define 1/port-writes-atomic?
  (|#%name|
   port-writes-atomic?
   (lambda (out_0)
     (begin
       (if (1/output-port? out_0)
         (void)
         (raise-argument-error 'port-writes-atomic? "output-port?" out_0))
       (let ((out_1 (->core-output-port.1 unsafe-undefined out_0 #f)))
         (if (core-output-port-methods-get-write-evt.1
              (core-port-vtable out_1))
           #t
           #f))))))
(define 1/write-char
  (let ((write-char_0
         (|#%name|
          write-char
          (lambda (ch2_0 out1_0)
            (let ((out_0
                   (if (eq? out1_0 unsafe-undefined)
                     (1/current-output-port)
                     out1_0)))
              (begin
                (if (char? ch2_0)
                  (void)
                  (raise-argument-error 'write-char "char?" ch2_0))
                (let ((out_1
                       (->core-output-port.1
                        unsafe-undefined
                        out_0
                        'write-char)))
                  (let ((v_0 (char->integer ch2_0)))
                    (if (< v_0 128)
                      (do-write-byte v_0 out_1)
                      (do-write-string 'write-char (string ch2_0) out_1 0 1))))
                (void)))))))
    (|#%name|
     write-char
     (case-lambda
      ((ch_0) (write-char_0 ch_0 unsafe-undefined))
      ((ch_0 out1_0) (write-char_0 ch_0 out1_0))))))
(define 1/write-string
  (let ((write-string_0
         (|#%name|
          write-string
          (lambda (str6_0 out3_0 start4_0 end5_0)
            (let ((out_0
                   (if (eq? out3_0 unsafe-undefined)
                     (1/current-output-port)
                     out3_0)))
              (let ((end_0
                     (if (eq? end5_0 unsafe-undefined)
                       (if (string? str6_0) (string-length str6_0) #f)
                       end5_0)))
                (begin
                  (if (string? str6_0)
                    (void)
                    (raise-argument-error 'write-string "string?" str6_0))
                  (let ((out_1
                         (->core-output-port.1
                          unsafe-undefined
                          out_0
                          'write-string)))
                    (begin
                      (if (exact-nonnegative-integer? start4_0)
                        (void)
                        (raise-argument-error
                         'write-string
                         "exact-nonnegative-integer?"
                         start4_0))
                      (if (exact-nonnegative-integer? end_0)
                        (void)
                        (raise-argument-error
                         'write-string
                         "exact-nonnegative-integer?"
                         end_0))
                      (check-range$1
                       'write-string
                       start4_0
                       end_0
                       (string-length str6_0)
                       str6_0)
                      (do-write-string
                       'write-string
                       str6_0
                       out_1
                       start4_0
                       end_0))))))))))
    (|#%name|
     write-string
     (case-lambda
      ((str_0) (write-string_0 str_0 unsafe-undefined 0 unsafe-undefined))
      ((str_0 out_0 start_0 end5_0)
       (write-string_0 str_0 out_0 start_0 end5_0))
      ((str_0 out_0 start4_0)
       (write-string_0 str_0 out_0 start4_0 unsafe-undefined))
      ((str_0 out3_0) (write-string_0 str_0 out3_0 0 unsafe-undefined))))))
(define do-write-string
  (lambda (who_0 str_0 out_0 start_0 end_0)
    (letrec*
     ((loop_0
       (|#%name|
        loop
        (lambda (i_0)
          (if (= i_0 end_0)
            (- i_0 start_0)
            (let ((next-i_0 (min end_0 (+ i_0 4096))))
              (let ((bstr_0 (1/string->bytes/utf-8 str_0 0 i_0 next-i_0)))
                (begin
                  (do-write-bytes
                   who_0
                   out_0
                   bstr_0
                   0
                   (unsafe-bytes-length bstr_0))
                  (loop_0 next-i_0)))))))))
     (loop_0 start_0))))
(define 1/port-writes-special?
  (|#%name|
   port-writes-special?
   (lambda (o_0)
     (begin
       (if (1/output-port? o_0)
         (void)
         (raise-argument-error 'port-writes-special? "output-port?" o_0))
       (let ((o_1 (->core-output-port.1 unsafe-undefined o_0 #f)))
         (if (core-output-port-methods-write-out-special.1
              (core-port-vtable o_1))
           #t
           #f))))))
(define do-write-special.1
  (|#%name|
   do-write-special
   (lambda (retry?1_0 who3_0 v4_0 orig-o5_0)
     (begin
       (if (1/output-port? orig-o5_0)
         (void)
         (raise-argument-error who3_0 "output-port?" orig-o5_0))
       (letrec*
        ((port-loop_0
          (|#%name|
           port-loop
           (lambda (o_0 extra-count-os_0)
             (let ((o_1 (->core-output-port.1 unsafe-undefined o_0 #f)))
               (let ((write-out-special_0
                      (core-output-port-methods-write-out-special.1
                       (core-port-vtable o_1))))
                 (begin
                   (if write-out-special_0
                     (void)
                     (raise-arguments-error
                      who3_0
                      "port does not support special values"
                      "port"
                      orig-o5_0))
                   (if (1/output-port? write-out-special_0)
                     (port-loop_0
                      write-out-special_0
                      (cons o_1 extra-count-os_0))
                     (letrec*
                      ((loop_0
                        (|#%name|
                         loop
                         (lambda ()
                           (begin
                             (unsafe-start-atomic)
                             (let ((r_0
                                    (|#%app|
                                     write-out-special_0
                                     o_1
                                     v4_0
                                     (not retry?1_0)
                                     #f)))
                               (letrec*
                                ((result-loop_0
                                  (|#%name|
                                   result-loop
                                   (lambda (r_1)
                                     (if (not r_1)
                                       (begin
                                         (unsafe-end-atomic)
                                         (if retry?1_0 (loop_0) #f))
                                       (if (evt? r_1)
                                         (begin
                                           (unsafe-end-atomic)
                                           (if retry?1_0
                                             (result-loop_0 (sync r_1))
                                             #f))
                                         (begin
                                           (port-count-all!
                                            o_1
                                            extra-count-os_0
                                            1
                                            #vu8(120)
                                            0)
                                           (unsafe-end-atomic)
                                           #t)))))))
                                (result-loop_0 r_0))))))))
                      (loop_0))))))))))
        (port-loop_0 orig-o5_0 null))))))
(define 1/write-special
  (let ((write-special_0
         (|#%name|
          write-special
          (lambda (v8_0 o7_0)
            (let ((o_0
                   (if (eq? o7_0 unsafe-undefined)
                     (1/current-output-port)
                     o7_0)))
              (do-write-special.1 #t 'write-special v8_0 o_0))))))
    (|#%name|
     write-special
     (case-lambda
      ((v_0) (write-special_0 v_0 unsafe-undefined))
      ((v_0 o7_0) (write-special_0 v_0 o7_0))))))
(define 1/write-special-avail*
  (let ((write-special-avail*_0
         (|#%name|
          write-special-avail*
          (lambda (v10_0 o9_0)
            (let ((o_0
                   (if (eq? o9_0 unsafe-undefined)
                     (1/current-output-port)
                     o9_0)))
              (do-write-special.1 #f 'write-special-avail* v10_0 o_0))))))
    (|#%name|
     write-special-avail*
     (case-lambda
      ((v_0) (write-special-avail*_0 v_0 unsafe-undefined))
      ((v_0 o9_0) (write-special-avail*_0 v_0 o9_0))))))
(define 1/write-special-evt
  (let ((write-special-evt_0
         (|#%name|
          write-special-evt
          (lambda (v12_0 o11_0)
            (let ((o_0
                   (if (eq? o11_0 unsafe-undefined)
                     (1/current-output-port)
                     o11_0)))
              (begin
                (if (1/output-port? o_0)
                  (void)
                  (raise-argument-error 'write-special-evt "output-port?" o_0))
                (let ((o_1 (->core-output-port.1 unsafe-undefined o_0 #f)))
                  (let ((get-write-special-evt_0
                         (core-output-port-methods-get-write-special-evt.1
                          (core-port-vtable o_1))))
                    (begin
                      (if get-write-special-evt_0
                        (void)
                        (raise-arguments-error
                         'write-special-evt
                         "port does not support special-value events"
                         "port"
                         o_1))
                      (|#%app| get-write-special-evt_0 o_1 v12_0))))))))))
    (|#%name|
     write-special-evt
     (case-lambda
      ((v_0) (write-special-evt_0 v_0 unsafe-undefined))
      ((v_0 o11_0) (write-special-evt_0 v_0 o11_0))))))
(define ok-mode?
  (lambda (v_0)
    (if (if (eq? v_0 'linefeed)
          #t
          (if (eq? v_0 'return)
            #t
            (if (eq? v_0 'return-linefeed)
              #t
              (if (eq? v_0 'any) #t (eq? v_0 'any-one)))))
      #t
      #f)))
(define ok-mode-str "(or/c 'linefeed 'return 'return-linefeed 'any 'any-one)")
(define 1/read-line
  (let ((read-line_0
         (|#%name|
          read-line
          (lambda (orig-in1_0 mode2_0)
            (let ((orig-in_0
                   (if (eq? orig-in1_0 unsafe-undefined)
                     (1/current-input-port)
                     orig-in1_0)))
              (let ((in_0
                     (->core-input-port.1
                      unsafe-undefined
                      orig-in_0
                      'read-line)))
                (begin
                  (if (ok-mode? mode2_0)
                    (void)
                    (raise-argument-error 'read-line ok-mode-str mode2_0))
                  (begin
                    (maybe-flush-stdout orig-in_0)
                    (let ((cr?_0
                           (if (if (eq? mode2_0 'return)
                                 #t
                                 (if (eq? mode2_0 'any)
                                   #t
                                   (eq? mode2_0 'any-one)))
                             #t
                             #f)))
                      (let ((lf?_0
                             (if (if (eq? mode2_0 'linefeed)
                                   #t
                                   (if (eq? mode2_0 'any)
                                     #t
                                     (eq? mode2_0 'any-one)))
                               #t
                               #f)))
                        (let ((crlf?_0
                               (if (if (eq? mode2_0 'return-linefeed)
                                     #t
                                     (eq? mode2_0 'any))
                                 #t
                                 #f)))
                          (let ((c1_0
                                 (maybe-read-a-line
                                  in_0
                                  cr?_0
                                  lf?_0
                                  crlf?_0
                                  #t)))
                            (if c1_0
                              c1_0
                              (letrec*
                               ((loop_0
                                 (|#%name|
                                  loop
                                  (lambda (str_0 len_0 pos_0)
                                    (let ((ch_0
                                           (read-a-char.1 #f 'read-line in_0)))
                                      (let ((keep-char_0
                                             (|#%name|
                                              keep-char
                                              (lambda ()
                                                (if (fx< pos_0 len_0)
                                                  (begin
                                                    (string-set!
                                                     str_0
                                                     pos_0
                                                     ch_0)
                                                    (loop_0
                                                     str_0
                                                     len_0
                                                     (fx+ pos_0 1)))
                                                  (let ((new-len_0
                                                         (fx* len_0 2)))
                                                    (let ((new-str_0
                                                           (make-string
                                                            new-len_0)))
                                                      (begin
                                                        (string-copy!
                                                         new-str_0
                                                         0
                                                         str_0
                                                         0)
                                                        (string-set!
                                                         new-str_0
                                                         pos_0
                                                         ch_0)
                                                        (loop_0
                                                         new-str_0
                                                         new-len_0
                                                         (fx+ pos_0 1))))))))))
                                        (if (eof-object? ch_0)
                                          (if (fx= pos_0 0)
                                            eof
                                            (substring str_0 0 pos_0))
                                          (if (if (if cr?_0 cr?_0 crlf?_0)
                                                (eqv? ch_0 (values '#\xd))
                                                #f)
                                            (if (if crlf?_0
                                                  (eqv?
                                                   (peek-a-char.1
                                                    #f
                                                    'read-line
                                                    in_0
                                                    0)
                                                   (values '#\xa))
                                                  #f)
                                              (begin
                                                (read-a-char.1
                                                 #f
                                                 'read-line
                                                 in_0)
                                                (substring str_0 0 pos_0))
                                              (if cr?_0
                                                (substring str_0 0 pos_0)
                                                (keep-char_0)))
                                            (if (if lf?_0
                                                  (eqv? ch_0 (values '#\xa))
                                                  #f)
                                              (substring str_0 0 pos_0)
                                              (keep-char_0))))))))))
                               (loop_0 (make-string 32) 32 0)))))))))))))))
    (|#%name|
     read-line
     (case-lambda
      (() (read-line_0 unsafe-undefined 'linefeed))
      ((orig-in_0 mode2_0) (read-line_0 orig-in_0 mode2_0))
      ((orig-in1_0) (read-line_0 orig-in1_0 'linefeed))))))
(define 1/read-bytes-line
  (let ((read-bytes-line_0
         (|#%name|
          read-bytes-line
          (lambda (orig-in3_0 mode4_0)
            (let ((orig-in_0
                   (if (eq? orig-in3_0 unsafe-undefined)
                     (1/current-input-port)
                     orig-in3_0)))
              (let ((in_0
                     (->core-input-port.1
                      unsafe-undefined
                      orig-in_0
                      'read-bytes-line)))
                (begin
                  (if (ok-mode? mode4_0)
                    (void)
                    (raise-argument-error
                     'read-bytes-line
                     ok-mode-str
                     mode4_0))
                  (begin
                    (maybe-flush-stdout orig-in_0)
                    (let ((cr?_0
                           (if (if (eq? mode4_0 'return)
                                 #t
                                 (if (eq? mode4_0 'any)
                                   #t
                                   (eq? mode4_0 'any-one)))
                             #t
                             #f)))
                      (let ((lf?_0
                             (if (if (eq? mode4_0 'linefeed)
                                   #t
                                   (if (eq? mode4_0 'any)
                                     #t
                                     (eq? mode4_0 'any-one)))
                               #t
                               #f)))
                        (let ((crlf?_0
                               (if (if (eq? mode4_0 'return-linefeed)
                                     #t
                                     (eq? mode4_0 'any))
                                 #t
                                 #f)))
                          (let ((c2_0
                                 (maybe-read-a-line
                                  in_0
                                  cr?_0
                                  lf?_0
                                  crlf?_0
                                  #f)))
                            (if c2_0
                              c2_0
                              (letrec*
                               ((loop_0
                                 (|#%name|
                                  loop
                                  (lambda (str_0 len_0 pos_0)
                                    (let ((ch_0
                                           (read-a-byte.1
                                            #f
                                            'read-bytes-line
                                            in_0)))
                                      (let ((keep-char_0
                                             (|#%name|
                                              keep-char
                                              (lambda ()
                                                (if (fx< pos_0 len_0)
                                                  (begin
                                                    (unsafe-bytes-set!
                                                     str_0
                                                     pos_0
                                                     ch_0)
                                                    (loop_0
                                                     str_0
                                                     len_0
                                                     (fx+ pos_0 1)))
                                                  (let ((new-len_0
                                                         (fx* len_0 2)))
                                                    (let ((new-str_0
                                                           (make-bytes
                                                            new-len_0)))
                                                      (begin
                                                        (unsafe-bytes-copy!
                                                         new-str_0
                                                         0
                                                         str_0
                                                         0)
                                                        (unsafe-bytes-set!
                                                         new-str_0
                                                         pos_0
                                                         ch_0)
                                                        (loop_0
                                                         new-str_0
                                                         new-len_0
                                                         (fx+ pos_0 1))))))))))
                                        (if (eof-object? ch_0)
                                          (if (fx= pos_0 0)
                                            eof
                                            (subbytes str_0 0 pos_0))
                                          (if (if (if cr?_0 cr?_0 crlf?_0)
                                                (eqv? ch_0 13)
                                                #f)
                                            (if (if crlf?_0
                                                  (eqv?
                                                   (peek-a-byte.1
                                                    #f
                                                    'read-bytes-line
                                                    in_0
                                                    0)
                                                   10)
                                                  #f)
                                              (begin
                                                (read-a-byte.1
                                                 #f
                                                 'read-bytes-line
                                                 in_0)
                                                (subbytes str_0 0 pos_0))
                                              (if cr?_0
                                                (subbytes str_0 0 pos_0)
                                                (keep-char_0)))
                                            (if (if lf?_0 (eqv? ch_0 10) #f)
                                              (subbytes str_0 0 pos_0)
                                              (keep-char_0))))))))))
                               (loop_0 (make-bytes 32) 32 0)))))))))))))))
    (|#%name|
     read-bytes-line
     (case-lambda
      (() (read-bytes-line_0 unsafe-undefined 'linefeed))
      ((orig-in_0 mode4_0) (read-bytes-line_0 orig-in_0 mode4_0))
      ((orig-in3_0) (read-bytes-line_0 orig-in3_0 'linefeed))))))
(define-values
 (1/prop:custom-write 1/custom-write? 1/custom-write-accessor)
 (make-struct-type-property
  'custom-write
  (lambda (v_0 info_0)
    (begin
      (if (if (procedure? v_0) (procedure-arity-includes? v_0 3) #f)
        (void)
        (raise-argument-error
         'guard-for-prop:custom-write
         "(procedure-arity-includes?/c 3)"
         v_0))
      v_0))))
(define-values
 (1/prop:custom-print-quotable
  1/custom-print-quotable?
  1/custom-print-quotable-accessor)
 (make-struct-type-property
  'custom-print-quotable
  (lambda (v_0 info_0)
    (begin
      (if (let ((or-part_0 (eq? v_0 'self)))
            (if or-part_0
              or-part_0
              (let ((or-part_1 (eq? v_0 'never)))
                (if or-part_1
                  or-part_1
                  (let ((or-part_2 (eq? v_0 'maybe)))
                    (if or-part_2 or-part_2 (eq? v_0 'always)))))))
        (void)
        (raise-argument-error
         'guard-for-prop:custom-print-quotable
         "(or/c 'self 'never 'maybe 'always)"
         v_0))
      v_0))))
(define 1/current-locale
  (make-parameter
   (string->immutable-string "")
   (lambda (v_0)
     (begin
       (if (let ((or-part_0 (not v_0))) (if or-part_0 or-part_0 (string? v_0)))
         (void)
         (raise-argument-error 'current-locale "(or/c #f string?)" v_0))
       (if v_0 (string->immutable-string v_0) #f)))
   'current-locale))
(define cell.1$8 (unsafe-make-place-local #f))
(define sync-locale!
  (lambda ()
    (let ((loc_0 (1/current-locale)))
      (if (let ((or-part_0 (not loc_0)))
            (if or-part_0
              or-part_0
              (equal? (unsafe-place-local-ref cell.1$8) loc_0)))
        (void)
        (begin
          (unsafe-place-local-set! cell.1$8 (1/current-locale))
          (|#%app|
           rktio_set_locale
           (unsafe-place-local-ref cell.1)
           (1/string->bytes/utf-8 (unsafe-place-local-ref cell.1$8))))))))
(define effect_2455 (begin (void (|#%app| rktio_set_default_locale #vu8())) (void)))
(define effect_2454 (begin (void (sync-locale!)) (void)))
(define locale-encoding-is-utf-8?
  (lambda ()
    (let ((t_0 (system-type)))
      (let ((loc_0 (1/current-locale)))
        (let ((or-part_0 (not loc_0)))
          (if or-part_0
            or-part_0
            (let ((or-part_1
                   (if (let ((or-part_1 (eq? t_0 'macosx)))
                         (if or-part_1 or-part_1 (eq? t_0 'windows)))
                     (equal? loc_0 "")
                     #f)))
              (if or-part_1
                or-part_1
                (zero?
                 (bitwise-and
                  (|#%app|
                   rktio_convert_properties
                   (unsafe-place-local-ref cell.1))
                  1))))))))))
(define locale-string-encoding/bytes
  (lambda ()
    (if (locale-encoding-is-utf-8?)
      #vu8(85 84 70 45 56)
      (begin
        (sync-locale!)
        (let ((e_0
               (|#%app|
                rktio_locale_encoding
                (unsafe-place-local-ref cell.1))))
          (if (vector? e_0)
            (begin
              (unsafe-end-atomic)
              (let ((base-msg_0 "error getting locale encoding"))
                (raise
                 (let ((app_0
                        (let ((msg_0
                               (string-append
                                base-msg_0
                                "\n  system error: "
                                (format-rktio-system-error-message e_0))))
                          (error-message->adjusted-string
                           'locale-string-encoding
                           'racket/primitive
                           msg_0
                           'racket/primitive))))
                   (|#%app| exn:fail app_0 (current-continuation-marks))))))
            (begin0
              (|#%app| rktio_to_bytes e_0)
              (|#%app| rktio_free e_0))))))))
(define 1/locale-string-encoding
  (|#%name|
   locale-string-encoding
   (lambda ()
     (1/bytes->string/utf-8
      (begin
        (unsafe-start-atomic)
        (begin0 (locale-string-encoding/bytes) (unsafe-end-atomic)))
      '#\x3f))))
(define 1/system-language+country
  (|#%name|
   system-language+country
   (lambda ()
     (begin
       (unsafe-start-atomic)
       (let ((c_0
              (|#%app|
               rktio_system_language_country
               (unsafe-place-local-ref cell.1))))
         (if (vector? c_0)
           (begin
             (unsafe-end-atomic)
             (let ((base-msg_0
                    "error getting language and country information"))
               (raise
                (let ((app_0
                       (let ((msg_0
                              (string-append
                               base-msg_0
                               "\n  system error: "
                               (format-rktio-system-error-message c_0))))
                         (error-message->adjusted-string
                          'system-language+country
                          'racket/primitive
                          msg_0
                          'racket/primitive))))
                  (|#%app| exn:fail app_0 (current-continuation-marks))))))
           (1/bytes->string/utf-8
            (begin0
              (|#%app| rktio_to_bytes c_0)
              (|#%app| rktio_free c_0)
              (unsafe-end-atomic))
            '#\x3f)))))))
(define encoding->bytes
  (lambda (who_0 str_0)
    (if (equal? str_0 "")
      (locale-string-encoding/bytes)
      (1/string->bytes/utf-8 str_0 63))))
(define big-endian?$2 (system-big-endian?))
(define bytes-set-two!
  (lambda (out-bstr_0 j_0 hi_0 lo_0)
    (if big-endian?$2
      (begin
        (unsafe-bytes-set! out-bstr_0 j_0 hi_0)
        (unsafe-bytes-set! out-bstr_0 (+ j_0 1) lo_0))
      (begin
        (unsafe-bytes-set! out-bstr_0 j_0 lo_0)
        (unsafe-bytes-set! out-bstr_0 (+ j_0 1) hi_0)))))
(define finish_2760
  (make-struct-type-install-properties
   '(utf-8-converter)
   2
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1)
   #f
   'utf-8-converter))
(define struct:utf-8-converter
  (make-record-type-descriptor
   'utf-8-converter
   #f
   (|#%nongenerative-uid| utf-8-converter)
   #f
   #f
   '(2 . 0)))
(define effect_2402 (finish_2760 struct:utf-8-converter))
(define utf-8-converter1.1
  (|#%name|
   utf-8-converter
   (record-constructor
    (make-record-constructor-descriptor struct:utf-8-converter #f #f))))
(define utf-8-converter?_2501
  (|#%name| utf-8-converter? (record-predicate struct:utf-8-converter)))
(define utf-8-converter?
  (|#%name|
   utf-8-converter?
   (lambda (v)
     (if (utf-8-converter?_2501 v)
       #t
       ($value
        (if (impersonator? v)
          (utf-8-converter?_2501 (impersonator-val v))
          #f))))))
(define utf-8-converter-from_2292
  (|#%name| utf-8-converter-from (record-accessor struct:utf-8-converter 0)))
(define utf-8-converter-from
  (|#%name|
   utf-8-converter-from
   (lambda (s)
     (if (utf-8-converter?_2501 s)
       (utf-8-converter-from_2292 s)
       ($value
        (impersonate-ref
         utf-8-converter-from_2292
         struct:utf-8-converter
         0
         s
         'from))))))
(define utf-8-converter-to_2267
  (|#%name| utf-8-converter-to (record-accessor struct:utf-8-converter 1)))
(define utf-8-converter-to
  (|#%name|
   utf-8-converter-to
   (lambda (s)
     (if (utf-8-converter?_2501 s)
       (utf-8-converter-to_2267 s)
       ($value
        (impersonate-ref
         utf-8-converter-to_2267
         struct:utf-8-converter
         1
         s
         'to))))))
(define big-endian?$1 (system-big-endian?))
(define utf-8-convert-in
  (lambda (c_0 src_0 src-start_0 src-end_0 dest_0 dest-start_0 dest-end_0)
    (let ((from_0 (utf-8-converter-from c_0)))
      (let ((to_0 (utf-8-converter-to c_0)))
        (call-with-values
         (lambda ()
           (if (let ((or-part_0 (eq? from_0 'utf-16)))
                 (if or-part_0
                   or-part_0
                   (let ((or-part_1 (eq? from_0 'wtf-16)))
                     (if or-part_1 or-part_1 (eq? from_0 'utf-16-assume)))))
             (let ((temp33_0 (eq? from_0 'wtf-16)))
               (let ((temp34_0 (eq? from_0 'utf-16-assume)))
                 (utf-16-ish-reencode!.1
                  temp34_0
                  temp33_0
                  src_0
                  src-start_0
                  src-end_0
                  dest_0
                  dest-start_0
                  dest-end_0)))
             (let ((or-part_0 (eq? from_0 'utf-8-permissive)))
               (let ((temp41_0
                      (if or-part_0 or-part_0 (eq? from_0 'wtf-8-permissive))))
                 (let ((temp42_0
                        (let ((or-part_1 (eq? from_0 'wtf-8)))
                          (if or-part_1
                            or-part_1
                            (eq? from_0 'wtf-8-permissive)))))
                   (let ((temp43_0
                          (let ((or-part_1 (eq? to_0 'utf-16)))
                            (if or-part_1
                              or-part_1
                              (let ((or-part_2 (eq? to_0 'wtf-16)))
                                (if or-part_2
                                  or-part_2
                                  (eq? to_0 'utf-16-assume)))))))
                     (utf-8-ish-reencode!.1
                      temp42_0
                      temp41_0
                      temp43_0
                      src_0
                      src-start_0
                      src-end_0
                      dest_0
                      dest-start_0
                      dest-end_0)))))))
         (lambda (in-consumed_0 out-produced_0 status_0)
           (values
            in-consumed_0
            out-produced_0
            (if (eq? status_0 'error)
              29
              (if (eq? status_0 'aborts)
                30
                (if (eq? status_0 'continues) 28 #f))))))))))
(define utf-8-ish-reencode!.1
  (|#%name|
   utf-8-ish-reencode!
   (lambda (from-wtf-8?3_0
            permissive?2_0
            to-utf-16?4_0
            in-bstr8_0
            in-start9_0
            in-end10_0
            out-bstr11_0
            out-start12_0
            out-end13_0)
     (letrec*
      ((loop_0
        (|#%name|
         loop
         (lambda (i_0 j_0 base-i_0 accum_0 remaining_0 pending-surrogate_0)
           (let ((encoding-failure_0
                  (|#%name|
                   encoding-failure
                   (lambda ()
                     (if permissive?2_0
                       (let ((continue-after-permissive_0
                              (|#%name|
                               continue-after-permissive
                               (lambda (next-j_0)
                                 (let ((next-i_0 (add1 base-i_0)))
                                   (if (= next-j_0 out-end13_0)
                                     (let ((app_0 (- next-i_0 in-start9_0)))
                                       (values
                                        app_0
                                        (- next-j_0 out-start12_0)
                                        'continues))
                                     (loop_0
                                      next-i_0
                                      next-j_0
                                      next-i_0
                                      0
                                      0
                                      #f)))))))
                         (if (if pending-surrogate_0
                               (> (+ j_0 2) out-end13_0)
                               #f)
                           (let ((app_0 (- base-i_0 in-start9_0)))
                             (values app_0 (- j_0 out-start12_0) 'continues))
                           (let ((j_1
                                  (if pending-surrogate_0
                                    (begin
                                      (let ((app_0
                                             (arithmetic-shift
                                              pending-surrogate_0
                                              -8)))
                                        (bytes-set-two!
                                         out-bstr11_0
                                         j_0
                                         app_0
                                         (bitwise-and
                                          pending-surrogate_0
                                          255)))
                                      (+ j_0 2))
                                    j_0)))
                             (let ((base-i_1
                                    (if pending-surrogate_0
                                      (+ base-i_0 3)
                                      base-i_0)))
                               (let ((j_2 j_1))
                                 (if (if (not to-utf-16?4_0)
                                       (<= (+ j_2 3) out-end13_0)
                                       #f)
                                   (begin
                                     (unsafe-bytes-set! out-bstr11_0 j_2 239)
                                     (unsafe-bytes-set!
                                      out-bstr11_0
                                      (+ j_2 1)
                                      191)
                                     (unsafe-bytes-set!
                                      out-bstr11_0
                                      (+ j_2 2)
                                      189)
                                     (continue-after-permissive_0 (+ j_2 3)))
                                   (if (if to-utf-16?4_0
                                         (<= (+ j_2 2) out-end13_0)
                                         #f)
                                     (begin
                                       (bytes-set-two!
                                        out-bstr11_0
                                        j_2
                                        255
                                        253)
                                       (continue-after-permissive_0 (+ j_2 2)))
                                     (let ((app_0 (- base-i_1 in-start9_0)))
                                       (values
                                        app_0
                                        (- j_2 out-start12_0)
                                        'continues)))))))))
                       (let ((app_0 (- base-i_0 in-start9_0)))
                         (values app_0 (- j_0 out-start12_0) 'error)))))))
             (let ((continue_0
                    (|#%name|
                     continue
                     (lambda (next-j_0)
                       (let ((next-i_0 (add1 i_0)))
                         (if (= next-j_0 out-end13_0)
                           (let ((app_0 (- next-i_0 in-start9_0)))
                             (let ((app_1 (- next-j_0 out-start12_0)))
                               (values
                                app_0
                                app_1
                                (if (= next-i_0 in-end10_0)
                                  'complete
                                  'continues))))
                           (loop_0 next-i_0 next-j_0 next-i_0 0 0 #f)))))))
               (if (= i_0 in-end10_0)
                 (if (zero? remaining_0)
                   (if pending-surrogate_0
                     (let ((app_0 (- base-i_0 in-start9_0)))
                       (let ((app_1 (- j_0 out-start12_0)))
                         (values
                          app_0
                          app_1
                          (if (= j_0 out-end13_0) 'continues 'aborts))))
                     (let ((app_0 (- base-i_0 in-start9_0)))
                       (values app_0 (- j_0 out-start12_0) 'complete)))
                   (let ((app_0 (- base-i_0 in-start9_0)))
                     (values app_0 (- j_0 out-start12_0) 'aborts)))
                 (let ((b_0 (unsafe-bytes-ref in-bstr8_0 i_0)))
                   (if (< b_0 128)
                     (if (zero? remaining_0)
                       (if (if pending-surrogate_0
                             (> (+ j_0 2) out-end13_0)
                             #f)
                         (let ((app_0 (- base-i_0 in-start9_0)))
                           (values app_0 (- j_0 out-start12_0) 'continues))
                         (let ((j_1
                                (if pending-surrogate_0
                                  (begin
                                    (let ((app_0
                                           (arithmetic-shift
                                            pending-surrogate_0
                                            -8)))
                                      (bytes-set-two!
                                       out-bstr11_0
                                       j_0
                                       app_0
                                       (bitwise-and pending-surrogate_0 255)))
                                    (+ j_0 2))
                                  j_0)))
                           (let ((base-i_1
                                  (if pending-surrogate_0
                                    (+ base-i_0 3)
                                    base-i_0)))
                             (let ((j_2 j_1))
                               (if (if (not to-utf-16?4_0)
                                     (< j_2 out-end13_0)
                                     #f)
                                 (begin
                                   (unsafe-bytes-set! out-bstr11_0 j_2 b_0)
                                   (continue_0 (add1 j_2)))
                                 (if (< (add1 j_2) out-end13_0)
                                   (begin
                                     (bytes-set-two! out-bstr11_0 j_2 0 b_0)
                                     (continue_0 (+ j_2 2)))
                                   (let ((app_0 (- base-i_1 in-start9_0)))
                                     (values
                                      app_0
                                      (- j_2 out-start12_0)
                                      'continues))))))))
                       (encoding-failure_0))
                     (if (= 128 (bitwise-and b_0 192))
                       (if (zero? remaining_0)
                         (encoding-failure_0)
                         (let ((next_0 (bitwise-and b_0 63)))
                           (let ((next-accum_0
                                  (+ (arithmetic-shift accum_0 6) next_0)))
                             (if (= 1 remaining_0)
                               (if (> next-accum_0 1114111)
                                 (encoding-failure_0)
                                 (if (< next-accum_0 128)
                                   (encoding-failure_0)
                                   (if (if (>= next-accum_0 55296)
                                         (<= next-accum_0 57343)
                                         #f)
                                     (if from-wtf-8?3_0
                                       (if (= i_0 in-end10_0)
                                         (let ((app_0
                                                (- base-i_0 in-start9_0)))
                                           (values
                                            app_0
                                            (- j_0 out-start12_0)
                                            'aborts))
                                         (if (if pending-surrogate_0
                                               (=
                                                (bitwise-and
                                                 next-accum_0
                                                 56320)
                                                56320)
                                               #f)
                                           (if permissive?2_0
                                             (if (<= (+ j_0 12) out-end13_0)
                                               (begin
                                                 (letrec*
                                                  ((for-loop_0
                                                    (|#%name|
                                                     for-loop
                                                     (lambda (pos_0)
                                                       (if (unsafe-fx< pos_0 6)
                                                         (begin
                                                           (bytes-set-two!
                                                            out-bstr11_0
                                                            (+ j_0 (* pos_0 2))
                                                            255
                                                            253)
                                                           (for-loop_0
                                                            (unsafe-fx+
                                                             pos_0
                                                             1)))
                                                         (values))))))
                                                  (for-loop_0 0))
                                                 (void)
                                                 (continue_0 (+ j_0 12)))
                                               (let ((app_0
                                                      (-
                                                       base-i_0
                                                       in-start9_0)))
                                                 (values
                                                  app_0
                                                  (- j_0 out-start12_0)
                                                  'continues)))
                                             (encoding-failure_0))
                                           (if (=
                                                (bitwise-and
                                                 next-accum_0
                                                 56320)
                                                55296)
                                             (let ((next-i_0 (add1 i_0)))
                                               (if (if pending-surrogate_0
                                                     (> (+ j_0 2) out-end13_0)
                                                     #f)
                                                 (let ((app_0
                                                        (-
                                                         base-i_0
                                                         in-start9_0)))
                                                   (values
                                                    app_0
                                                    (- j_0 out-start12_0)
                                                    'continues))
                                                 (let ((j_1
                                                        (if pending-surrogate_0
                                                          (begin
                                                            (let ((app_0
                                                                   (arithmetic-shift
                                                                    pending-surrogate_0
                                                                    -8)))
                                                              (bytes-set-two!
                                                               out-bstr11_0
                                                               j_0
                                                               app_0
                                                               (bitwise-and
                                                                pending-surrogate_0
                                                                255)))
                                                            (+ j_0 2))
                                                          j_0)))
                                                   (let ((base-i_1
                                                          (if pending-surrogate_0
                                                            (+ base-i_0 3)
                                                            base-i_0)))
                                                     (let ((j_2 j_1))
                                                       (loop_0
                                                        next-i_0
                                                        j_2
                                                        base-i_1
                                                        0
                                                        0
                                                        next-accum_0))))))
                                             (if (<= (+ j_0 2) out-end13_0)
                                               (begin
                                                 (let ((app_0
                                                        (arithmetic-shift
                                                         next-accum_0
                                                         -8)))
                                                   (bytes-set-two!
                                                    out-bstr11_0
                                                    j_0
                                                    app_0
                                                    (bitwise-and
                                                     next-accum_0
                                                     255)))
                                                 (continue_0 (+ j_0 2)))
                                               (let ((app_0
                                                      (-
                                                       base-i_0
                                                       in-start9_0)))
                                                 (values
                                                  app_0
                                                  (- j_0 out-start12_0)
                                                  'continues))))))
                                       (encoding-failure_0))
                                     (if to-utf-16?4_0
                                       (if (if pending-surrogate_0
                                             (> (+ j_0 2) out-end13_0)
                                             #f)
                                         (let ((app_0
                                                (- base-i_0 in-start9_0)))
                                           (values
                                            app_0
                                            (- j_0 out-start12_0)
                                            'continues))
                                         (let ((j_1
                                                (if pending-surrogate_0
                                                  (begin
                                                    (let ((app_0
                                                           (arithmetic-shift
                                                            pending-surrogate_0
                                                            -8)))
                                                      (bytes-set-two!
                                                       out-bstr11_0
                                                       j_0
                                                       app_0
                                                       (bitwise-and
                                                        pending-surrogate_0
                                                        255)))
                                                    (+ j_0 2))
                                                  j_0)))
                                           (let ((base-i_1
                                                  (if pending-surrogate_0
                                                    (+ base-i_0 3)
                                                    base-i_0)))
                                             (let ((j_2 j_1))
                                               (if (if (< next-accum_0 65536)
                                                     (<= (+ j_2 2) out-end13_0)
                                                     #f)
                                                 (begin
                                                   (let ((app_0
                                                          (arithmetic-shift
                                                           next-accum_0
                                                           -8)))
                                                     (bytes-set-two!
                                                      out-bstr11_0
                                                      j_2
                                                      app_0
                                                      (bitwise-and
                                                       next-accum_0
                                                       255)))
                                                   (continue_0 (+ j_2 2)))
                                                 (if (<= (+ j_2 4) out-end13_0)
                                                   (let ((av_0
                                                          (-
                                                           next-accum_0
                                                           65536)))
                                                     (let ((hi_0
                                                            (bitwise-ior
                                                             55296
                                                             (bitwise-and
                                                              (arithmetic-shift
                                                               av_0
                                                               -10)
                                                              1023))))
                                                       (let ((lo_0
                                                              (bitwise-ior
                                                               56320
                                                               (bitwise-and
                                                                av_0
                                                                1023))))
                                                         (begin
                                                           (let ((app_0
                                                                  (arithmetic-shift
                                                                   hi_0
                                                                   -8)))
                                                             (bytes-set-two!
                                                              out-bstr11_0
                                                              j_2
                                                              app_0
                                                              (bitwise-and
                                                               hi_0
                                                               255)))
                                                           (let ((app_0
                                                                  (+ j_2 2)))
                                                             (let ((app_1
                                                                    (arithmetic-shift
                                                                     lo_0
                                                                     -8)))
                                                               (bytes-set-two!
                                                                out-bstr11_0
                                                                app_0
                                                                app_1
                                                                (bitwise-and
                                                                 lo_0
                                                                 255))))
                                                           (continue_0
                                                            (+ j_2 4))))))
                                                   (let ((app_0
                                                          (-
                                                           base-i_1
                                                           in-start9_0)))
                                                     (values
                                                      app_0
                                                      (- j_2 out-start12_0)
                                                      'continues))))))))
                                       (let ((next-i_0 (add1 i_0)))
                                         (letrec*
                                          ((loop_1
                                            (|#%name|
                                             loop
                                             (lambda (from-i_0 to-j_0)
                                               (if (= from-i_0 next-i_0)
                                                 (continue_0 to-j_0)
                                                 (if (= to-j_0 out-end13_0)
                                                   (let ((app_0
                                                          (-
                                                           base-i_0
                                                           in-start9_0)))
                                                     (values
                                                      app_0
                                                      (- j_0 out-start12_0)
                                                      'continues))
                                                   (begin
                                                     (unsafe-bytes-set!
                                                      out-bstr11_0
                                                      to-j_0
                                                      (unsafe-bytes-ref
                                                       in-bstr8_0
                                                       from-i_0))
                                                     (let ((app_0
                                                            (add1 from-i_0)))
                                                       (loop_1
                                                        app_0
                                                        (add1 to-j_0))))))))))
                                          (loop_1 base-i_0 j_0)))))))
                               (if (if (= 2 remaining_0)
                                     (<= next-accum_0 31)
                                     #f)
                                 (encoding-failure_0)
                                 (if (if (= 3 remaining_0)
                                       (<= next-accum_0 15)
                                       #f)
                                   (encoding-failure_0)
                                   (let ((app_0 (add1 i_0)))
                                     (loop_0
                                      app_0
                                      j_0
                                      base-i_0
                                      next-accum_0
                                      (sub1 remaining_0)
                                      pending-surrogate_0))))))))
                       (if (not (zero? remaining_0))
                         (encoding-failure_0)
                         (if (= 192 (bitwise-and b_0 224))
                           (let ((accum_1 (bitwise-and b_0 31)))
                             (if (zero? accum_1)
                               (encoding-failure_0)
                               (loop_0
                                (add1 i_0)
                                j_0
                                base-i_0
                                accum_1
                                1
                                pending-surrogate_0)))
                           (if (= 224 (bitwise-and b_0 240))
                             (let ((accum_1 (bitwise-and b_0 15)))
                               (loop_0
                                (add1 i_0)
                                j_0
                                base-i_0
                                accum_1
                                2
                                pending-surrogate_0))
                             (if (= 240 (bitwise-and b_0 248))
                               (let ((accum_1 (bitwise-and b_0 7)))
                                 (if (> accum_1 4)
                                   (encoding-failure_0)
                                   (loop_0
                                    (add1 i_0)
                                    j_0
                                    base-i_0
                                    accum_1
                                    3
                                    pending-surrogate_0)))
                               (encoding-failure_0)))))))))))))))
      (loop_0 in-start9_0 out-start12_0 in-start9_0 0 0 #f)))))
(define utf-16-ish-reencode!.1
  (|#%name|
   utf-16-ish-reencode!
   (lambda (assume-paired-surrogates?16_0
            from-wtf-16?15_0
            in-bstr19_0
            in-start20_0
            in-end21_0
            out-bstr22_0
            out-start23_0
            out-end24_0)
     (letrec*
      ((loop_0
        (|#%name|
         loop
         (lambda (i_0 j_0)
           (let ((done_0
                  (|#%name|
                   done
                   (lambda (status_0)
                     (let ((app_0 (- i_0 in-start20_0)))
                       (values app_0 (- j_0 out-start23_0) status_0))))))
             (if (= i_0 in-end21_0)
               (done_0 'complete)
               (if (> (+ i_0 2) in-end21_0)
                 (done_0 'aborts)
                 (let ((a_0 (unsafe-bytes-ref in-bstr19_0 i_0)))
                   (let ((b_0 (unsafe-bytes-ref in-bstr19_0 (add1 i_0))))
                     (let ((v_0
                            (if big-endian?$1
                              (+ (arithmetic-shift a_0 8) b_0)
                              (+ (arithmetic-shift b_0 8) a_0))))
                       (let ((continue_0
                              (|#%name|
                               continue
                               (lambda (v_1 next-i_0)
                                 (let ((continue_0
                                        (|#%name|
                                         continue
                                         (lambda (next-j_0)
                                           (loop_0 next-i_0 next-j_0)))))
                                   (if (fx<= v_1 127)
                                     (if (if out-end24_0
                                           (fx= j_0 out-end24_0)
                                           #f)
                                       (let ((app_0 (fx- i_0 in-start20_0)))
                                         (values
                                          app_0
                                          (fx- j_0 out-start23_0)
                                          'continues))
                                       (begin
                                         (if out-bstr22_0
                                           (unsafe-bytes-set!
                                            out-bstr22_0
                                            j_0
                                            v_1)
                                           (void))
                                         (let ((next-j_0 (fx+ j_0 1)))
                                           (loop_0 next-i_0 next-j_0))))
                                     (if (fx<= v_1 2047)
                                       (if (if out-end24_0
                                             (fx>= (fx+ j_0 1) out-end24_0)
                                             #f)
                                         (let ((app_0 (fx- i_0 in-start20_0)))
                                           (values
                                            app_0
                                            (fx- j_0 out-start23_0)
                                            'continues))
                                         (begin
                                           (if out-bstr22_0
                                             (begin
                                               (unsafe-bytes-set!
                                                out-bstr22_0
                                                j_0
                                                (fxior
                                                 192
                                                 (unsafe-fxrshift v_1 6)))
                                               (let ((app_0 (fx+ j_0 1)))
                                                 (unsafe-bytes-set!
                                                  out-bstr22_0
                                                  app_0
                                                  (fxior 128 (fxand v_1 63)))))
                                             (void))
                                           (let ((next-j_0 (+ j_0 2)))
                                             (loop_0 next-i_0 next-j_0))))
                                       (if (fx<= v_1 65535)
                                         (if (if out-end24_0
                                               (fx>= (fx+ j_0 2) out-end24_0)
                                               #f)
                                           (let ((app_0
                                                  (fx- i_0 in-start20_0)))
                                             (values
                                              app_0
                                              (fx- j_0 out-start23_0)
                                              'continues))
                                           (begin
                                             (if out-bstr22_0
                                               (begin
                                                 (unsafe-bytes-set!
                                                  out-bstr22_0
                                                  j_0
                                                  (fxior
                                                   224
                                                   (unsafe-fxrshift v_1 12)))
                                                 (let ((app_0 (fx+ j_0 1)))
                                                   (unsafe-bytes-set!
                                                    out-bstr22_0
                                                    app_0
                                                    (fxior
                                                     128
                                                     (fxand
                                                      (unsafe-fxrshift v_1 6)
                                                      63))))
                                                 (let ((app_0 (fx+ j_0 2)))
                                                   (unsafe-bytes-set!
                                                    out-bstr22_0
                                                    app_0
                                                    (fxior
                                                     128
                                                     (fxand v_1 63)))))
                                               (void))
                                             (let ((next-j_0 (fx+ j_0 3)))
                                               (loop_0 next-i_0 next-j_0))))
                                         (if (if out-end24_0
                                               (fx>= (fx+ j_0 3) out-end24_0)
                                               #f)
                                           (let ((app_0
                                                  (fx- i_0 in-start20_0)))
                                             (values
                                              app_0
                                              (fx- j_0 out-start23_0)
                                              'continues))
                                           (begin
                                             (if out-bstr22_0
                                               (begin
                                                 (unsafe-bytes-set!
                                                  out-bstr22_0
                                                  j_0
                                                  (fxior
                                                   240
                                                   (unsafe-fxrshift v_1 18)))
                                                 (let ((app_0 (fx+ j_0 1)))
                                                   (unsafe-bytes-set!
                                                    out-bstr22_0
                                                    app_0
                                                    (fxior
                                                     128
                                                     (fxand
                                                      (unsafe-fxrshift v_1 12)
                                                      63))))
                                                 (let ((app_0 (fx+ j_0 2)))
                                                   (unsafe-bytes-set!
                                                    out-bstr22_0
                                                    app_0
                                                    (fxior
                                                     128
                                                     (fxand
                                                      (unsafe-fxrshift v_1 6)
                                                      63))))
                                                 (let ((app_0 (fx+ j_0 3)))
                                                   (unsafe-bytes-set!
                                                    out-bstr22_0
                                                    app_0
                                                    (fxior
                                                     128
                                                     (fxand v_1 63)))))
                                               (void))
                                             (let ((next-j_0 (fx+ j_0 4)))
                                               (loop_0
                                                next-i_0
                                                next-j_0))))))))))))
                         (if (if (>= v_0 55296) (<= v_0 57343) #f)
                           (if (if assume-paired-surrogates?16_0
                                 assume-paired-surrogates?16_0
                                 (<= v_0 56319))
                             (if (> (+ i_0 4) in-end21_0)
                               (done_0 'aborts)
                               (let ((a_1
                                      (unsafe-bytes-ref
                                       in-bstr19_0
                                       (+ i_0 2))))
                                 (let ((b_1
                                        (unsafe-bytes-ref
                                         in-bstr19_0
                                         (+ i_0 3))))
                                   (let ((v2_0
                                          (if big-endian?$1
                                            (+ (arithmetic-shift a_1 8) b_1)
                                            (+ (arithmetic-shift b_1 8) a_1))))
                                     (if (if assume-paired-surrogates?16_0
                                           assume-paired-surrogates?16_0
                                           (if (>= v2_0 56320)
                                             (<= v2_0 57343)
                                             #f))
                                       (let ((v3_0
                                              (+
                                               65536
                                               (let ((app_0
                                                      (arithmetic-shift
                                                       (bitwise-and v_0 1023)
                                                       10)))
                                                 (bitwise-ior
                                                  app_0
                                                  (bitwise-and v2_0 1023))))))
                                         (continue_0 v3_0 (+ i_0 4)))
                                       (if from-wtf-16?15_0
                                         (continue_0 v_0 (+ i_0 2))
                                         (done_0 'error)))))))
                             (if from-wtf-16?15_0
                               (continue_0 v_0 (+ i_0 2))
                               (done_0 'error)))
                           (continue_0 v_0 (+ i_0 2))))))))))))))
      (loop_0 in-start20_0 out-start23_0)))))
(define finish_2770
  (make-struct-type-install-properties
   '(bytes-converter)
   2
   0
   #f
   null
   (current-inspector)
   #f
   '()
   #f
   'bytes-converter))
(define struct:bytes-converter
  (make-record-type-descriptor
   'bytes-converter
   #f
   (|#%nongenerative-uid| bytes-converter)
   #f
   #f
   '(2 . 3)))
(define effect_2496 (finish_2770 struct:bytes-converter))
(define bytes-converter1.1
  (|#%name|
   bytes-converter
   (record-constructor
    (make-record-constructor-descriptor struct:bytes-converter #f #f))))
(define 1/bytes-converter?_1964
  (|#%name| bytes-converter? (record-predicate struct:bytes-converter)))
(define 1/bytes-converter?
  (|#%name|
   bytes-converter?
   (lambda (v)
     (if (1/bytes-converter?_1964 v)
       #t
       ($value
        (if (impersonator? v)
          (1/bytes-converter?_1964 (impersonator-val v))
          #f))))))
(define bytes-converter-c_3301
  (|#%name| bytes-converter-c (record-accessor struct:bytes-converter 0)))
(define bytes-converter-c
  (|#%name|
   bytes-converter-c
   (lambda (s)
     (if (1/bytes-converter?_1964 s)
       (bytes-converter-c_3301 s)
       ($value
        (impersonate-ref
         bytes-converter-c_3301
         struct:bytes-converter
         0
         s
         'c))))))
(define bytes-converter-custodian-reference_2648
  (|#%name|
   bytes-converter-custodian-reference
   (record-accessor struct:bytes-converter 1)))
(define bytes-converter-custodian-reference
  (|#%name|
   bytes-converter-custodian-reference
   (lambda (s)
     (if (1/bytes-converter?_1964 s)
       (bytes-converter-custodian-reference_2648 s)
       ($value
        (impersonate-ref
         bytes-converter-custodian-reference_2648
         struct:bytes-converter
         1
         s
         'custodian-reference))))))
(define set-bytes-converter-c!_2380
  (|#%name| set-bytes-converter-c! (record-mutator struct:bytes-converter 0)))
(define set-bytes-converter-c!
  (|#%name|
   set-bytes-converter-c!
   (lambda (s v)
     (if (1/bytes-converter?_1964 s)
       (set-bytes-converter-c!_2380 s v)
       ($value
        (impersonate-set!
         set-bytes-converter-c!_2380
         struct:bytes-converter
         0
         0
         s
         v
         'c))))))
(define set-bytes-converter-custodian-reference!_2613
  (|#%name|
   set-bytes-converter-custodian-reference!
   (record-mutator struct:bytes-converter 1)))
(define set-bytes-converter-custodian-reference!
  (|#%name|
   set-bytes-converter-custodian-reference!
   (lambda (s v)
     (if (1/bytes-converter?_1964 s)
       (set-bytes-converter-custodian-reference!_2613 s v)
       ($value
        (impersonate-set!
         set-bytes-converter-custodian-reference!_2613
         struct:bytes-converter
         1
         1
         s
         v
         'custodian-reference))))))
(define windows? (eq? 'windows (system-type)))
(define platform-utf-8 (if windows? 'wtf-8 'utf-8))
(define platform-utf-8-permissive
  (if windows? 'wtf-8-permissive 'utf-8-permissive))
(define platform-utf-16 (if windows? 'wtf-16 'utf-16-assume))
(define bytes-open-converter-in-custodian
  (lambda (who_0 cust_0 from-str_0 to-str_0)
    (begin
      (if (string? from-str_0)
        (void)
        (raise-argument-error who_0 "string?" from-str_0))
      (if (string? to-str_0)
        (void)
        (raise-argument-error who_0 "string?" to-str_0))
      (if (if (string=? from-str_0 "UTF-8") (string=? to-str_0 "UTF-8") #f)
        (bytes-converter1.1 (utf-8-converter1.1 'utf-8 'utf-8) #f)
        (if (if (string=? from-str_0 "UTF-8-permissive")
              (string=? to-str_0 "UTF-8")
              #f)
          (bytes-converter1.1 (utf-8-converter1.1 'utf-8-permissive 'utf-8) #f)
          (if (if (string=? from-str_0 "platform-UTF-8")
                (string=? to-str_0 "platform-UTF-16")
                #f)
            (bytes-converter1.1
             (utf-8-converter1.1 platform-utf-8 platform-utf-16)
             #f)
            (if (if (string=? from-str_0 "platform-UTF-8-permissive")
                  (string=? to-str_0 "platform-UTF-16")
                  #f)
              (bytes-converter1.1
               (utf-8-converter1.1 platform-utf-8-permissive platform-utf-16)
               #f)
              (if (if (string=? from-str_0 "platform-UTF-16")
                    (string=? to-str_0 "platform-UTF-8")
                    #f)
                (bytes-converter1.1
                 (utf-8-converter1.1 platform-utf-16 platform-utf-8)
                 #f)
                (if (if (string=? from-str_0 "WTF-8")
                      (string=? to-str_0 "WTF-16")
                      #f)
                  (bytes-converter1.1 (utf-8-converter1.1 'wtf-8 'wtf-16) #f)
                  (if (if (string=? from-str_0 "WTF-8-permissive")
                        (string=? to-str_0 "WTF-16")
                        #f)
                    (bytes-converter1.1
                     (utf-8-converter1.1 'wtf-8-permissive 'wtf-16)
                     #f)
                    (if (if (string=? from-str_0 "WTF-16")
                          (string=? to-str_0 "WTF-8")
                          #f)
                      (bytes-converter1.1
                       (utf-8-converter1.1 'wtf-16 'wtf-8)
                       #f)
                      (if (if (let ((or-part_0
                                     (if (string=? from-str_0 "UTF-8")
                                       (string=? to-str_0 "")
                                       #f)))
                                (if or-part_0
                                  or-part_0
                                  (if (string=? from-str_0 "")
                                    (string=? to-str_0 "UTF-8")
                                    #f)))
                            (locale-encoding-is-utf-8?)
                            #f)
                        (bytes-converter1.1
                         (utf-8-converter1.1 'utf-8 'utf-8)
                         #f)
                        (let ((props_0
                               (|#%app|
                                rktio_convert_properties
                                (unsafe-place-local-ref cell.1))))
                          (if (zero? (bitwise-and props_0 1))
                            #f
                            (begin
                              (unsafe-start-atomic)
                              (begin
                                (if cust_0
                                  (void)
                                  (check-current-custodian who_0))
                                (let ((c_0
                                       (let ((app_0
                                              (encoding->bytes
                                               who_0
                                               to-str_0)))
                                         (|#%app|
                                          rktio_converter_open
                                          (unsafe-place-local-ref cell.1)
                                          app_0
                                          (encoding->bytes
                                           who_0
                                           from-str_0)))))
                                  (if (vector? c_0)
                                    (begin (unsafe-end-atomic) #f)
                                    (let ((converter_0
                                           (bytes-converter1.1 c_0 #f)))
                                      (let ((cref_0
                                             (|#%app|
                                              1/unsafe-custodian-register
                                              (if cust_0
                                                cust_0
                                                (current-custodian))
                                              converter_0
                                              close-converter
                                              #f
                                              #f)))
                                        (begin
                                          (set-bytes-converter-custodian-reference!
                                           converter_0
                                           cref_0)
                                          (unsafe-end-atomic)
                                          converter_0)))))))))))))))))))))
(define 1/bytes-open-converter
  (|#%name|
   bytes-open-converter
   (lambda (from-str_0 to-str_0)
     (bytes-open-converter-in-custodian
      'bytes-open-converter
      #f
      from-str_0
      to-str_0))))
(define close-converter
  (lambda (converter_0)
    (let ((c_0 (bytes-converter-c converter_0)))
      (if c_0
        (begin
          (if (utf-8-converter? c_0)
            (void)
            (begin
              (|#%app|
               rktio_converter_close
               (unsafe-place-local-ref cell.1)
               c_0)
              (|#%app|
               1/unsafe-custodian-unregister
               converter_0
               (bytes-converter-custodian-reference converter_0))))
          (set-bytes-converter-c! converter_0 #f))
        (void)))))
(define 1/bytes-close-converter
  (|#%name|
   bytes-close-converter
   (lambda (converter_0)
     (begin
       (if (1/bytes-converter? converter_0)
         (void)
         (raise-argument-error
          'bytes-close-converter
          "bytes-converter?"
          converter_0))
       (unsafe-start-atomic)
       (begin0 (close-converter converter_0) (unsafe-end-atomic))))))
(define 1/bytes-convert
  (let ((bytes-convert_0
         (|#%name|
          bytes-convert
          (lambda (converter7_0
                   src-bstr8_0
                   src-start-pos2_0
                   src-end-pos3_0
                   dest-bstr4_0
                   dest-start-pos5_0
                   dest-end-pos6_0)
            (let ((src-end-pos_0
                   (if (eq? src-end-pos3_0 unsafe-undefined)
                     (if (bytes? src-bstr8_0)
                       (unsafe-bytes-length src-bstr8_0)
                       #f)
                     src-end-pos3_0)))
              (let ((dest-end-pos_0
                     (if (eq? dest-end-pos6_0 unsafe-undefined)
                       (if (bytes? dest-bstr4_0)
                         (unsafe-bytes-length dest-bstr4_0)
                         #f)
                       dest-end-pos6_0)))
                (begin
                  (if (1/bytes-converter? converter7_0)
                    (void)
                    (raise-argument-error
                     'bytes-convert
                     "bytes-converter?"
                     converter7_0))
                  (if (bytes? src-bstr8_0)
                    (void)
                    (raise-argument-error 'bytes-convert "bytes?" src-bstr8_0))
                  (if (exact-nonnegative-integer? src-start-pos2_0)
                    (void)
                    (raise-argument-error
                     'bytes-convert
                     "exact-nonnegative-integer?"
                     src-start-pos2_0))
                  (if (exact-nonnegative-integer? src-end-pos_0)
                    (void)
                    (raise-argument-error
                     'bytes-convert
                     "exact-nonnegative-integer?"
                     src-end-pos_0))
                  (if (let ((or-part_0 (not dest-bstr4_0)))
                        (if or-part_0
                          or-part_0
                          (if (bytes? dest-bstr4_0)
                            (not (immutable? dest-bstr4_0))
                            #f)))
                    (void)
                    (raise-argument-error
                     'bytes-convert
                     "(or/c (and/c bytes? (not/c immutable?)) #f)"
                     dest-bstr4_0))
                  (if (exact-nonnegative-integer? dest-start-pos5_0)
                    (void)
                    (raise-argument-error
                     'bytes-convert
                     "exact-nonnegative-integer?"
                     dest-start-pos5_0))
                  (if (let ((or-part_0 (not dest-end-pos_0)))
                        (if or-part_0
                          or-part_0
                          (exact-nonnegative-integer? dest-end-pos_0)))
                    (void)
                    (raise-argument-error
                     'bytes-convert
                     "(or/c #f exact-nonnegative-integer?)"
                     dest-end-pos_0))
                  (check-range$1
                   'bytes-convert
                   src-start-pos2_0
                   src-end-pos_0
                   (unsafe-bytes-length src-bstr8_0)
                   src-bstr8_0)
                  (check-dest-range
                   'bytes-convert
                   dest-bstr4_0
                   dest-start-pos5_0
                   dest-end-pos_0)
                  (do-convert
                   'bytes-convert
                   converter7_0
                   src-bstr8_0
                   src-start-pos2_0
                   src-end-pos_0
                   dest-bstr4_0
                   dest-start-pos5_0
                   dest-end-pos_0
                   (if (not dest-bstr4_0)
                     (max 1 (- src-end-pos_0 src-start-pos2_0))
                     1)))))))))
    (|#%name|
     bytes-convert
     (case-lambda
      ((converter_0 src-bstr_0)
       (bytes-convert_0
        converter_0
        src-bstr_0
        0
        unsafe-undefined
        #f
        0
        unsafe-undefined))
      ((converter_0
        src-bstr_0
        src-start-pos_0
        src-end-pos_0
        dest-bstr_0
        dest-start-pos_0
        dest-end-pos6_0)
       (bytes-convert_0
        converter_0
        src-bstr_0
        src-start-pos_0
        src-end-pos_0
        dest-bstr_0
        dest-start-pos_0
        dest-end-pos6_0))
      ((converter_0
        src-bstr_0
        src-start-pos_0
        src-end-pos_0
        dest-bstr_0
        dest-start-pos5_0)
       (bytes-convert_0
        converter_0
        src-bstr_0
        src-start-pos_0
        src-end-pos_0
        dest-bstr_0
        dest-start-pos5_0
        unsafe-undefined))
      ((converter_0 src-bstr_0 src-start-pos_0 src-end-pos_0 dest-bstr4_0)
       (bytes-convert_0
        converter_0
        src-bstr_0
        src-start-pos_0
        src-end-pos_0
        dest-bstr4_0
        0
        unsafe-undefined))
      ((converter_0 src-bstr_0 src-start-pos_0 src-end-pos3_0)
       (bytes-convert_0
        converter_0
        src-bstr_0
        src-start-pos_0
        src-end-pos3_0
        #f
        0
        unsafe-undefined))
      ((converter_0 src-bstr_0 src-start-pos2_0)
       (bytes-convert_0
        converter_0
        src-bstr_0
        src-start-pos2_0
        unsafe-undefined
        #f
        0
        unsafe-undefined))))))
(define 1/bytes-convert-end
  (let ((bytes-convert-end_0
         (|#%name|
          bytes-convert-end
          (lambda (converter12_0
                   dest-bstr9_0
                   dest-start-pos10_0
                   dest-end-pos11_0)
            (let ((dest-end-pos_0
                   (if (eq? dest-end-pos11_0 unsafe-undefined)
                     (if (bytes? dest-bstr9_0)
                       (unsafe-bytes-length dest-bstr9_0)
                       #f)
                     dest-end-pos11_0)))
              (begin
                (if (1/bytes-converter? converter12_0)
                  (void)
                  (raise-argument-error
                   'bytes-convert-end
                   "bytes-converter?"
                   converter12_0))
                (begin
                  (if (let ((or-part_0 (not dest-bstr9_0)))
                        (if or-part_0 or-part_0 (bytes? dest-bstr9_0)))
                    (void)
                    (raise-argument-error
                     'bytes-convert-end
                     "(or/c #f bytes?)"
                     dest-bstr9_0))
                  (begin
                    (if (exact-nonnegative-integer? dest-start-pos10_0)
                      (void)
                      (raise-argument-error
                       'bytes-convert-end
                       "exact-nonnegative-integer?"
                       dest-start-pos10_0))
                    (begin
                      (if (let ((or-part_0 (not dest-end-pos_0)))
                            (if or-part_0
                              or-part_0
                              (exact-nonnegative-integer? dest-end-pos_0)))
                        (void)
                        (raise-argument-error
                         'bytes-convert-end
                         "(or/c #f exact-nonnegative-integer?)"
                         dest-end-pos_0))
                      (begin
                        (check-dest-range
                         'bytes-convert-end
                         dest-bstr9_0
                         dest-start-pos10_0
                         dest-end-pos_0)
                        (call-with-values
                         (lambda ()
                           (do-convert
                            'bytes-convert-end
                            converter12_0
                            #f
                            0
                            0
                            dest-bstr9_0
                            dest-start-pos10_0
                            dest-end-pos_0
                            6))
                         (lambda (bstr_0 used_0 status_0)
                           (values bstr_0 status_0)))))))))))))
    (|#%name|
     bytes-convert-end
     (case-lambda
      ((converter_0) (bytes-convert-end_0 converter_0 #f 0 unsafe-undefined))
      ((converter_0 dest-bstr_0 dest-start-pos_0 dest-end-pos11_0)
       (bytes-convert-end_0
        converter_0
        dest-bstr_0
        dest-start-pos_0
        dest-end-pos11_0))
      ((converter_0 dest-bstr_0 dest-start-pos10_0)
       (bytes-convert-end_0
        converter_0
        dest-bstr_0
        dest-start-pos10_0
        unsafe-undefined))
      ((converter_0 dest-bstr9_0)
       (bytes-convert-end_0 converter_0 dest-bstr9_0 0 unsafe-undefined))))))
(define check-dest-range
  (lambda (who_0 dest-bstr_0 dest-start-pos_0 dest-end-pos_0)
    (if dest-bstr_0
      (let ((len_0 (unsafe-bytes-length dest-bstr_0)))
        (check-range$1
         who_0
         dest-start-pos_0
         (if dest-end-pos_0 dest-end-pos_0 len_0)
         len_0
         dest-bstr_0))
      (if dest-end-pos_0
        (if (<= dest-start-pos_0 dest-end-pos_0)
          (void)
          (raise-arguments-error
           who_0
           "ending index is less than the starting index"
           "staring index"
           dest-start-pos_0
           "ending index"
           dest-end-pos_0))
        (void)))))
(define do-convert
  (lambda (who_0
           converter_0
           src-bstr_0
           src-start-pos_0
           src-end-pos_0
           dest-bstr_0
           dest-start-pos_0
           dest-end-pos_0
           guess-dest-size_0)
    (begin
      (unsafe-start-atomic)
      (let ((c_0 (bytes-converter-c converter_0)))
        (begin
          (if c_0
            (void)
            (begin
              (unsafe-end-atomic)
              (raise-arguments-error
               who_0
               "converter is closed"
               "converter"
               converter_0)))
          (let ((use-dest-bstr_0
                 (if dest-bstr_0
                   dest-bstr_0
                   (make-bytes
                    (if dest-end-pos_0
                      (- dest-end-pos_0 dest-start-pos_0)
                      guess-dest-size_0)))))
            (letrec*
             ((loop_0
               (|#%name|
                loop
                (lambda (use-dest-bstr_1
                         src-start-pos_1
                         use-dest-start-pos_0
                         use-dest-end-pos_0
                         in-already-consumed_0
                         out-already-produced_0)
                  (call-with-values
                   (lambda ()
                     (convert-in
                      c_0
                      src-bstr_0
                      src-start-pos_1
                      src-end-pos_0
                      use-dest-bstr_1
                      use-dest-start-pos_0
                      use-dest-end-pos_0))
                   (lambda (in-consumed_0 out-produced_0 err_0)
                     (if (if (eqv? err_0 28)
                           (if (not dest-bstr_0) (not dest-end-pos_0) #f)
                           #f)
                       (let ((all-out-produced_0
                              (+ out-produced_0 out-already-produced_0)))
                         (let ((new-dest-bstr_0
                                (make-bytes
                                 (* 2 (unsafe-bytes-length use-dest-bstr_1)))))
                           (begin
                             (unsafe-bytes-copy!
                              new-dest-bstr_0
                              0
                              use-dest-bstr_1
                              0
                              all-out-produced_0)
                             (let ((app_0 (+ src-start-pos_1 in-consumed_0)))
                               (loop_0
                                new-dest-bstr_0
                                app_0
                                all-out-produced_0
                                (unsafe-bytes-length new-dest-bstr_0)
                                (+ in-consumed_0 in-already-consumed_0)
                                all-out-produced_0)))))
                       (let ((all-out-produced_0
                              (+ out-produced_0 out-already-produced_0)))
                         (begin
                           (unsafe-end-atomic)
                           (let ((app_0
                                  (if dest-bstr_0
                                    all-out-produced_0
                                    (subbytes
                                     use-dest-bstr_1
                                     0
                                     all-out-produced_0))))
                             (values
                              app_0
                              (+ in-already-consumed_0 in-consumed_0)
                              (if (eqv? err_0 29)
                                'error
                                (if (eqv? err_0 30)
                                  'aborts
                                  (if (eqv? err_0 28)
                                    'continues
                                    (if (eqv? err_0 31)
                                      'error
                                      'complete)))))))))))))))
             (loop_0
              use-dest-bstr_0
              src-start-pos_0
              (if dest-bstr_0 dest-start-pos_0 0)
              (let ((or-part_0 (if dest-bstr_0 dest-end-pos_0 #f)))
                (if or-part_0 or-part_0 (unsafe-bytes-length use-dest-bstr_0)))
              0
              0))))))))
(define convert-in
  (lambda (c_0 src_0 src-start_0 src-end_0 dest_0 dest-start_0 dest-end_0)
    (if (utf-8-converter? c_0)
      (utf-8-convert-in
       c_0
       src_0
       src-start_0
       src-end_0
       dest_0
       dest-start_0
       dest-end_0)
      (let ((r_0
             (|#%app|
              rktio_convert_in
              (unsafe-place-local-ref cell.1)
              c_0
              src_0
              src-start_0
              src-end_0
              dest_0
              dest-start_0
              dest-end_0)))
        (let ((v_0 (|#%app| rktio_convert_result_to_vector r_0)))
          (begin
            (|#%app| rktio_free r_0)
            (let ((in-consumed_0 (vector-ref v_0 0)))
              (let ((out-produced_0 (vector-ref v_0 1)))
                (let ((converted_0 (vector-ref v_0 2)))
                  (let ((err_0
                         (if (= converted_0 -1)
                           (|#%app|
                            rktio_get_last_error
                            (unsafe-place-local-ref cell.1))
                           #f)))
                    (values in-consumed_0 out-produced_0 err_0)))))))))))
(define bytes-reset-converter
  (lambda (converter_0)
    (let ((c_0 (bytes-converter-c converter_0)))
      (if (utf-8-converter? c_0)
        (void)
        (|#%app| rktio_convert_reset (unsafe-place-local-ref cell.1) c_0)))))
(define ucs-4-encoding (if (system-big-endian?) "UCS-4BE" "UCS-4LE"))
(define string->bytes/ucs-4
  (lambda (str_0 start_0 end_0)
    (let ((len_0 (* 4 (- end_0 start_0))))
      (let ((bstr_0 (make-bytes len_0)))
        (begin
          (if (system-big-endian?)
            (begin
              (call-with-values
               (lambda ()
                 (unsafe-normalise-inputs
                  unsafe-string-length
                  str_0
                  start_0
                  end_0
                  1))
               (lambda (v*_0 start*_0 stop*_0 step*_0)
                 (let ((start_1 0))
                   (let ((end_1 len_0))
                     (let ((inc_0 4))
                       (let ((end_2 end_1)
                             (start_2 start_1)
                             (v*_1 v*_0)
                             (start*_1 start*_0)
                             (stop*_1 stop*_0)
                             (step*_1 step*_0))
                         (letrec*
                          ((for-loop_0
                            (|#%name|
                             for-loop
                             (lambda (idx_0 pos_0)
                               (if (if (unsafe-fx< idx_0 stop*_1)
                                     (< pos_0 end_2)
                                     #f)
                                 (let ((c_0 (string-ref v*_1 idx_0)))
                                   (begin
                                     (let ((n_0 (char->integer c_0)))
                                       (begin
                                         (let ((app_0 bstr_0))
                                           (unsafe-bytes-set!
                                            app_0
                                            pos_0
                                            (arithmetic-shift n_0 -24)))
                                         (let ((app_0 bstr_0))
                                           (let ((app_1 (+ pos_0 1)))
                                             (unsafe-bytes-set!
                                              app_0
                                              app_1
                                              (bitwise-and
                                               255
                                               (arithmetic-shift n_0 -16)))))
                                         (let ((app_0 bstr_0))
                                           (let ((app_1 (+ pos_0 2)))
                                             (unsafe-bytes-set!
                                              app_0
                                              app_1
                                              (bitwise-and
                                               255
                                               (arithmetic-shift n_0 -8)))))
                                         (let ((app_0 bstr_0))
                                           (let ((app_1 (+ pos_0 3)))
                                             (unsafe-bytes-set!
                                              app_0
                                              app_1
                                              (bitwise-and 255 n_0))))))
                                     (for-loop_0
                                      (unsafe-fx+ idx_0 1)
                                      (+ pos_0 inc_0))))
                                 (values))))))
                          (for-loop_0 start*_1 start_2))))))))
              (void))
            (begin
              (call-with-values
               (lambda ()
                 (unsafe-normalise-inputs
                  unsafe-string-length
                  str_0
                  start_0
                  end_0
                  1))
               (lambda (v*_0 start*_0 stop*_0 step*_0)
                 (let ((start_1 0))
                   (let ((end_1 len_0))
                     (let ((inc_0 4))
                       (let ((end_2 end_1)
                             (start_2 start_1)
                             (v*_1 v*_0)
                             (start*_1 start*_0)
                             (stop*_1 stop*_0)
                             (step*_1 step*_0))
                         (letrec*
                          ((for-loop_0
                            (|#%name|
                             for-loop
                             (lambda (idx_0 pos_0)
                               (if (if (unsafe-fx< idx_0 stop*_1)
                                     (< pos_0 end_2)
                                     #f)
                                 (let ((c_0 (string-ref v*_1 idx_0)))
                                   (begin
                                     (let ((n_0 (char->integer c_0)))
                                       (begin
                                         (let ((app_0 bstr_0))
                                           (let ((app_1 (+ pos_0 3)))
                                             (unsafe-bytes-set!
                                              app_0
                                              app_1
                                              (arithmetic-shift n_0 -24))))
                                         (let ((app_0 bstr_0))
                                           (let ((app_1 (+ pos_0 2)))
                                             (unsafe-bytes-set!
                                              app_0
                                              app_1
                                              (bitwise-and
                                               255
                                               (arithmetic-shift n_0 -16)))))
                                         (let ((app_0 bstr_0))
                                           (let ((app_1 (+ pos_0 1)))
                                             (unsafe-bytes-set!
                                              app_0
                                              app_1
                                              (bitwise-and
                                               255
                                               (arithmetic-shift n_0 -8)))))
                                         (let ((app_0 bstr_0))
                                           (unsafe-bytes-set!
                                            app_0
                                            pos_0
                                            (bitwise-and 255 n_0)))))
                                     (for-loop_0
                                      (unsafe-fx+ idx_0 1)
                                      (+ pos_0 inc_0))))
                                 (values))))))
                          (for-loop_0 start*_1 start_2))))))))
              (void)))
          bstr_0)))))
(define finish_1919
  (make-struct-type-install-properties
   '(cache)
   4
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'cache))
(define struct:cache
  (make-record-type-descriptor
   'cache
   #f
   (|#%nongenerative-uid| cache)
   #f
   #f
   '(4 . 15)))
(define effect_2561 (finish_1919 struct:cache))
(define cache1.1
  (|#%name|
   cache
   (record-constructor
    (make-record-constructor-descriptor struct:cache #f #f))))
(define cache? (|#%name| cache? (record-predicate struct:cache)))
(define cache-enc (|#%name| cache-enc (record-accessor struct:cache 0)))
(define cache-to (|#%name| cache-to (record-accessor struct:cache 1)))
(define cache-to_3068 (|#%name| cache-to2 (record-accessor struct:cache 2)))
(define cache-from (|#%name| cache-from (record-accessor struct:cache 3)))
(define set-cache-enc!
  (|#%name| set-cache-enc! (record-mutator struct:cache 0)))
(define set-cache-to! (|#%name| set-cache-to! (record-mutator struct:cache 1)))
(define set-cache-to2!
  (|#%name| set-cache-to2! (record-mutator struct:cache 2)))
(define set-cache-from!
  (|#%name| set-cache-from! (record-mutator struct:cache 3)))
(define new-cache (lambda () (cache1.1 #f #f #f #f)))
(define cell.1$7 (unsafe-make-place-local (new-cache)))
(define cell.2$1
  (unsafe-make-place-local (|#%app| 1/unsafe-make-custodian-at-root)))
(define convert-cache-init!
  (lambda ()
    (begin
      (unsafe-place-local-set! cell.1$7 (new-cache))
      (unsafe-place-local-set!
       cell.2$1
       (|#%app| 1/unsafe-make-custodian-at-root)))))
(define cache-clear!
  (lambda (get_0 update!_0)
    (let ((c_0 (|#%app| get_0 (unsafe-place-local-ref cell.1$7))))
      (begin
        (|#%app| update!_0 (unsafe-place-local-ref cell.1$7) #f)
        (if c_0 (1/bytes-close-converter c_0) (void))))))
(define cache-lookup!
  (lambda (enc_0 get_0 update!_0)
    (begin
      (unsafe-start-atomic)
      (begin0
        (if (equal? enc_0 (cache-enc (unsafe-place-local-ref cell.1$7)))
          (let ((c_0 (|#%app| get_0 (unsafe-place-local-ref cell.1$7))))
            (begin
              (if c_0
                (|#%app| update!_0 (unsafe-place-local-ref cell.1$7) #f)
                (void))
              c_0))
          #f)
        (unsafe-end-atomic)))))
(define cache-save!
  (lambda (c_0 enc_0 get_0 update!_0)
    (if c_0
      (begin
        (unsafe-start-atomic)
        (begin0
          (begin
            (if (equal? enc_0 (cache-enc (unsafe-place-local-ref cell.1$7)))
              (void)
              (begin
                (cache-clear! cache-to set-cache-to!)
                (cache-clear! cache-to_3068 set-cache-to2!)
                (cache-clear! cache-from set-cache-from!)
                (set-cache-enc! (unsafe-place-local-ref cell.1$7) enc_0)))
            (if (|#%app| get_0 (unsafe-place-local-ref cell.1$7))
              (1/bytes-close-converter c_0)
              (begin
                (bytes-reset-converter c_0)
                (|#%app| update!_0 (unsafe-place-local-ref cell.1$7) c_0))))
          (unsafe-end-atomic)))
      (void))))
(define bytes-open-converter/cached-to
  (lambda (enc_0)
    (let ((or-part_0 (cache-lookup! enc_0 cache-to set-cache-to!)))
      (if or-part_0
        or-part_0
        (bytes-open-converter-in-custodian
         'bytes-open-converter/cached-to
         (unsafe-place-local-ref cell.2$1)
         ucs-4-encoding
         enc_0)))))
(define bytes-open-converter/cached-to2
  (lambda (enc_0)
    (let ((or-part_0 (cache-lookup! enc_0 cache-to_3068 set-cache-to2!)))
      (if or-part_0
        or-part_0
        (bytes-open-converter-in-custodian
         'bytes-open-converter/cached-to2
         (unsafe-place-local-ref cell.2$1)
         ucs-4-encoding
         enc_0)))))
(define bytes-open-converter/cached-from
  (lambda (enc_0)
    (let ((or-part_0 (cache-lookup! enc_0 cache-from set-cache-from!)))
      (if or-part_0
        or-part_0
        (bytes-open-converter-in-custodian
         'bytes-open-converter/cached-from
         (unsafe-place-local-ref cell.2$1)
         enc_0
         "UTF-8")))))
(define bytes-close-converter/cached-to
  (lambda (c_0 enc_0) (cache-save! c_0 enc_0 cache-to set-cache-to!)))
(define bytes-close-converter/cached-to_2383
  (lambda (c_0 enc_0) (cache-save! c_0 enc_0 cache-to_3068 set-cache-to2!)))
(define bytes-close-converter/cached-from
  (lambda (c_0 enc_0) (cache-save! c_0 enc_0 cache-from set-cache-from!)))
(define 1/string->bytes/locale
  (let ((string->bytes/locale_0
         (|#%name|
          string->bytes/locale
          (lambda (str4_0 err-byte1_0 start2_0 end3_0)
            (let ((end_0
                   (if (eq? end3_0 unsafe-undefined)
                     (if (string? str4_0) (string-length str4_0) #f)
                     end3_0)))
              (begin
                (if (string? str4_0)
                  (void)
                  (raise-argument-error
                   'string->bytes/locale
                   "string?"
                   str4_0))
                (if (let ((or-part_0 (not err-byte1_0)))
                      (if or-part_0 or-part_0 (byte? err-byte1_0)))
                  (void)
                  (raise-argument-error
                   'string->bytes/locale
                   "(or/c byte? #f)"
                   err-byte1_0))
                (if (exact-nonnegative-integer? start2_0)
                  (void)
                  (raise-argument-error
                   'string->bytes/locale
                   "exact-nonnegative-integer?"
                   start2_0))
                (if (exact-nonnegative-integer? end_0)
                  (void)
                  (raise-argument-error
                   'string->bytes/locale
                   "exact-nonnegative-integer?"
                   end_0))
                (check-range$1
                 'string->bytes/locale
                 start2_0
                 end_0
                 (string-length str4_0)
                 str4_0)
                (if (locale-encoding-is-utf-8?)
                  (1/string->bytes/utf-8 str4_0 err-byte1_0 start2_0 end_0)
                  (let ((c_0 #f))
                    (let ((enc_0 (1/locale-string-encoding)))
                      (dynamic-wind
                       (lambda ()
                         (set! c_0 (bytes-open-converter/cached-to enc_0)))
                       (lambda ()
                         (let ((in-bstr_0
                                (string->bytes/ucs-4 str4_0 start2_0 end_0)))
                           (letrec*
                            ((loop_0
                              (|#%name|
                               loop
                               (lambda (pos_0)
                                 (call-with-values
                                  (lambda ()
                                    (1/bytes-convert c_0 in-bstr_0 pos_0))
                                  (lambda (bstr_0 in-used_0 status_0)
                                    (if (eq? status_0 'complete)
                                      (if (eqv? pos_0 0) bstr_0 (list bstr_0))
                                      (if (not err-byte1_0)
                                        (raise-arguments-error
                                         'string->bytes/locale
                                         "string cannot be encoded for the current locale"
                                         "string"
                                         str4_0)
                                        (let ((err-bstr_0 (bytes err-byte1_0)))
                                          (if (eq? status_0 'aborts)
                                            (if (eqv? pos_0 0)
                                              (bytes-append bstr_0 err-bstr_0)
                                              (list bstr_0 err-bstr_0))
                                            (let ((r_0
                                                   (loop_0
                                                    (+ pos_0 in-used_0 4))))
                                              (if (eqv? pos_0 0)
                                                (apply
                                                 bytes-append
                                                 (cons
                                                  bstr_0
                                                  (cons err-bstr_0 r_0)))
                                                (cons
                                                 bstr_0
                                                 (cons
                                                  err-bstr_0
                                                  r_0))))))))))))))
                            (loop_0 0))))
                       (lambda ()
                         (let ((c_1 c_0))
                           (cache-save!
                            c_1
                            enc_0
                            cache-to
                            set-cache-to!)))))))))))))
    (|#%name|
     string->bytes/locale
     (case-lambda
      ((str_0) (string->bytes/locale_0 str_0 #f 0 unsafe-undefined))
      ((str_0 err-byte_0 start_0 end3_0)
       (string->bytes/locale_0 str_0 err-byte_0 start_0 end3_0))
      ((str_0 err-byte_0 start2_0)
       (string->bytes/locale_0 str_0 err-byte_0 start2_0 unsafe-undefined))
      ((str_0 err-byte1_0)
       (string->bytes/locale_0 str_0 err-byte1_0 0 unsafe-undefined))))))
(define 1/bytes->string/locale
  (let ((bytes->string/locale_0
         (|#%name|
          bytes->string/locale
          (lambda (in-bstr8_0 err-char5_0 start6_0 end7_0)
            (let ((end_0
                   (if (eq? end7_0 unsafe-undefined)
                     (if (bytes? in-bstr8_0)
                       (unsafe-bytes-length in-bstr8_0)
                       #f)
                     end7_0)))
              (begin
                (if (bytes? in-bstr8_0)
                  (void)
                  (raise-argument-error
                   'bytes->string/locale
                   "bytes?"
                   in-bstr8_0))
                (if (let ((or-part_0 (not err-char5_0)))
                      (if or-part_0 or-part_0 (char? err-char5_0)))
                  (void)
                  (raise-argument-error
                   'bytes->string/locale
                   "(or/c char? #f)"
                   err-char5_0))
                (if (exact-nonnegative-integer? start6_0)
                  (void)
                  (raise-argument-error
                   'bytes->string/locale
                   "exact-nonnegative-integer?"
                   start6_0))
                (if (exact-nonnegative-integer? end_0)
                  (void)
                  (raise-argument-error
                   'bytes->string/locale
                   "exact-nonnegative-integer?"
                   end_0))
                (check-range$1
                 'bytes->string/locale
                 start6_0
                 end_0
                 (unsafe-bytes-length in-bstr8_0)
                 in-bstr8_0)
                (if (locale-encoding-is-utf-8?)
                  (1/bytes->string/utf-8 in-bstr8_0 err-char5_0 start6_0 end_0)
                  (let ((c_0 #f))
                    (let ((enc_0 (1/locale-string-encoding)))
                      (dynamic-wind
                       (lambda ()
                         (set! c_0 (bytes-open-converter/cached-from enc_0)))
                       (lambda ()
                         (letrec*
                          ((loop_0
                            (|#%name|
                             loop
                             (lambda (pos_0)
                               (call-with-values
                                (lambda ()
                                  (1/bytes-convert c_0 in-bstr8_0 pos_0))
                                (lambda (bstr_0 in-used_0 status_0)
                                  (if (eq? status_0 'complete)
                                    (if (eqv? pos_0 0)
                                      (1/bytes->string/utf-8 bstr_0)
                                      (list bstr_0))
                                    (if (not err-char5_0)
                                      (raise-arguments-error
                                       'bytes->string/locale
                                       "byte string is not a valid encoding for the current locale"
                                       "byte string"
                                       in-bstr8_0)
                                      (let ((err-bstr_0
                                             (1/string->bytes/utf-8
                                              (string err-char5_0))))
                                        (if (eq? status_0 'aborts)
                                          (if (eqv? pos_0 0)
                                            (1/bytes->string/utf-8
                                             (bytes-append bstr_0 err-bstr_0))
                                            (list bstr_0 err-bstr_0))
                                          (let ((r_0
                                                 (loop_0
                                                  (+ pos_0 in-used_0 1))))
                                            (if (eqv? pos_0 0)
                                              (1/bytes->string/utf-8
                                               (apply
                                                bytes-append
                                                (cons
                                                 bstr_0
                                                 (cons err-bstr_0 r_0))))
                                              (cons
                                               bstr_0
                                               (cons
                                                err-bstr_0
                                                r_0))))))))))))))
                          (loop_0 0)))
                       (lambda ()
                         (let ((c_1 c_0))
                           (cache-save!
                            c_1
                            enc_0
                            cache-from
                            set-cache-from!)))))))))))))
    (|#%name|
     bytes->string/locale
     (case-lambda
      ((in-bstr_0) (bytes->string/locale_0 in-bstr_0 #f 0 unsafe-undefined))
      ((in-bstr_0 err-char_0 start_0 end7_0)
       (bytes->string/locale_0 in-bstr_0 err-char_0 start_0 end7_0))
      ((in-bstr_0 err-char_0 start6_0)
       (bytes->string/locale_0 in-bstr_0 err-char_0 start6_0 unsafe-undefined))
      ((in-bstr_0 err-char5_0)
       (bytes->string/locale_0 in-bstr_0 err-char5_0 0 unsafe-undefined))))))
(define finish_2782
  (make-struct-type-install-properties
   '(path)
   2
   0
   #f
   (list
    (cons prop:place-message (lambda (self_0) (lambda () (lambda () self_0))))
    (cons
     prop:equal+hash
     (list
      (lambda (p1_0 p2_0 eql?_0)
        (if (let ((app_0 (path-bytes p1_0))) (bytes=? app_0 (path-bytes p2_0)))
          (let ((app_0 (path-convention p1_0)))
            (eq? app_0 (path-convention p2_0)))
          #f))
      (lambda (p_0 hc_0) (equal-hash-code (path-bytes p_0)))
      (lambda (p_0 hc_0) (equal-secondary-hash-code (path-bytes p_0)))))
    (cons
     1/prop:custom-write
     (lambda (p_0 port_0 mode_0)
       (begin
         (if mode_0
           (if (eq? (path-convention p_0) (system-path-convention-type))
             (1/write-string "#<path:" port_0)
             (begin
               (1/write-string "#<" port_0)
               (1/write-string (symbol->string (path-convention p_0)) port_0)
               (1/write-string "-path:" port_0)))
           (void))
         (1/write-string
          (1/bytes->string/locale (path-bytes p_0) '#\x3f)
          port_0)
         (if mode_0 (1/write-string ">" port_0) (void))))))
   (current-inspector)
   #f
   '(0 1)
   #f
   'path))
(define struct:path
  (make-record-type-descriptor
   'path
   #f
   (|#%nongenerative-uid| path)
   #f
   #f
   '(2 . 0)))
(define effect_2995 (finish_2782 struct:path))
(define path1.1
  (|#%name|
   path
   (record-constructor
    (make-record-constructor-descriptor struct:path #f #f))))
(define 1/path?_2312 (|#%name| path? (record-predicate struct:path)))
(define 1/path?
  (|#%name|
   path?
   (lambda (v)
     (if (1/path?_2312 v)
       #t
       ($value
        (if (impersonator? v) (1/path?_2312 (impersonator-val v)) #f))))))
(define path-bytes_2645 (|#%name| path-bytes (record-accessor struct:path 0)))
(define path-bytes
  (|#%name|
   path-bytes
   (lambda (s)
     (if (1/path?_2312 s)
       (path-bytes_2645 s)
       ($value (impersonate-ref path-bytes_2645 struct:path 0 s 'bytes))))))
(define path-convention_2368
  (|#%name| path-convention (record-accessor struct:path 1)))
(define path-convention
  (|#%name|
   path-convention
   (lambda (s)
     (if (1/path?_2312 s)
       (path-convention_2368 s)
       ($value
        (impersonate-ref path-convention_2368 struct:path 1 s 'convention))))))
(define is-path?
  (|#%name|
   path?
   (lambda (p_0)
     (if (1/path? p_0)
       (eq? (path-convention p_0) (system-path-convention-type))
       #f))))
(define 1/path-for-some-system?
  (|#%name| path-for-some-system? (lambda (p_0) (1/path? p_0))))
(define path-string?
  (lambda (p_0)
    (let ((or-part_0 (is-path? p_0)))
      (if or-part_0
        or-part_0
        (if (string? p_0)
          (if (positive? (string-length p_0)) (string-no-nuls? p_0) #f)
          #f)))))
(define string-no-nuls?
  (lambda (s_0)
    (if (string? s_0)
      (call-with-values
       (lambda () (values s_0 (unsafe-string-length s_0)))
       (lambda (vec_0 len_0)
         (letrec*
          ((for-loop_0
            (|#%name|
             for-loop
             (lambda (result_0 pos_0)
               (if (unsafe-fx< pos_0 len_0)
                 (let ((c_0 (string-ref vec_0 pos_0)))
                   (let ((result_1
                          (let ((result_1 (not (char=? c_0 '#\x0))))
                            (values result_1))))
                     (if (if (not (let ((x_0 (list c_0))) (not result_1)))
                           #t
                           #f)
                       (for-loop_0 result_1 (unsafe-fx+ 1 pos_0))
                       result_1)))
                 result_0)))))
          (for-loop_0 #t 0))))
      #f)))
(define string->path$1
  (|#%name|
   string->path
   (lambda (s_0)
     (path1.1 (string->path-bytes s_0) (system-path-convention-type)))))
(define string->path-bytes (lambda (s_0) (1/string->bytes/locale s_0 63)))
(define ->path (lambda (p_0) (if (string? p_0) (string->path$1 p_0) p_0)))
(define 1/current-force-delete-permissions
  (make-parameter
   #t
   (lambda (v_0) (if v_0 #t #f))
   'current-force-delete-permissions))
(define check-convention
  (lambda (who_0 c_0)
    (if (let ((or-part_0 (eq? c_0 'windows)))
          (if or-part_0 or-part_0 (eq? c_0 'unix)))
      (void)
      (raise-argument-error who_0 "(or/c 'windows 'unix)" c_0))))
(define check-path-string
  (lambda (who_0 s_0)
    (begin
      (if (zero? (string-length s_0))
        (raise-arguments-error who_0 "path string is empty")
        (void))
      (call-with-values
       (lambda () (values s_0 (unsafe-string-length s_0)))
       (lambda (vec_0 len_0)
         (letrec*
          ((for-loop_0
            (|#%name|
             for-loop
             (lambda (pos_0)
               (if (unsafe-fx< pos_0 len_0)
                 (let ((c_0 (string-ref vec_0 pos_0)))
                   (begin
                     (if (char=? c_0 '#\x0)
                       (raise-arguments-error
                        who_0
                        "path string contains a nul character"
                        "path string"
                        s_0)
                       (void))
                     (for-loop_0 (unsafe-fx+ 1 pos_0))))
                 (values))))))
          (for-loop_0 0))))
      (void))))
(define check-path-bytes
  (lambda (who_0 s_0)
    (begin
      (if (zero? (unsafe-bytes-length s_0))
        (raise-arguments-error who_0 "byte string is empty")
        (void))
      (call-with-values
       (lambda () (values s_0 (unsafe-bytes-length s_0)))
       (lambda (vec_0 len_0)
         (letrec*
          ((for-loop_0
            (|#%name|
             for-loop
             (lambda (pos_0)
               (if (unsafe-fx< pos_0 len_0)
                 (let ((c_0 (unsafe-bytes-ref vec_0 pos_0)))
                   (begin
                     (if (zero? c_0)
                       (raise-arguments-error
                        who_0
                        "byte string contains a nul character"
                        "byte string"
                        s_0)
                       (void))
                     (for-loop_0 (unsafe-fx+ 1 pos_0))))
                 (values))))))
          (for-loop_0 0))))
      (void))))
(define check-path-argument
  (lambda (who_0 p_0)
    (if (let ((or-part_0 (path-string? p_0)))
          (if or-part_0 or-part_0 (1/path? p_0)))
      (void)
      (raise-argument-error
       who_0
       "(or/c path-string? path-for-some-system?)"
       p_0))))
(define is-sep?
  (lambda (c_0 convention_0)
    (let ((or-part_0 (eq? c_0 47)))
      (if or-part_0
        or-part_0
        (if (eq? convention_0 'windows) (eq? c_0 92) #f)))))
(define special-filenames
  '("NUL"
    "CON"
    "PRN"
    "AUX"
    "COM1"
    "COM2"
    "COM3"
    "COM4"
    "COM5"
    "COM6"
    "COM7"
    "COM8"
    "COM9"
    "LPT1"
    "LPT2"
    "LPT3"
    "LPT4"
    "LPT5"
    "LPT6"
    "LPT7"
    "LPT8"
    "LPT9"))
(define special-filename?.1
  (|#%name|
   special-filename?
   (lambda (immediate?1_0 in-bstr3_0)
     (let ((bstr_0 unsafe-undefined))
       (set! bstr_0
         (if immediate?1_0
           in-bstr3_0
           (if (backslash-backslash-questionmark? in-bstr3_0)
             #vu8()
             (let ((len_0 (unsafe-bytes-length in-bstr3_0)))
               (letrec*
                ((loop_0
                  (|#%name|
                   loop
                   (lambda (i+1_0)
                     (if (zero? i+1_0)
                       (if (letter-drive-start? bstr_0 len_0)
                         (subbytes in-bstr3_0 2)
                         in-bstr3_0)
                       (let ((i_0 (sub1 i+1_0)))
                         (if (is-sep?
                              (unsafe-bytes-ref in-bstr3_0 i_0)
                              'windows)
                           (subbytes in-bstr3_0 i+1_0)
                           (loop_0 i_0))))))))
                (loop_0 len_0))))))
       (let ((len_0 (unsafe-bytes-length bstr_0)))
         (if (zero? len_0)
           #f
           (if (backslash-backslash-questionmark? bstr_0)
             #f
             (letrec*
              ((for-loop_0
                (|#%name|
                 for-loop
                 (lambda (result_0 lst_0)
                   (if (pair? lst_0)
                     (let ((fn_0 (unsafe-car lst_0)))
                       (let ((rest_0 (unsafe-cdr lst_0)))
                         (let ((result_1
                                (let ((result_1
                                       (let ((fn-len_0 (string-length fn_0)))
                                         (if (>= len_0 fn-len_0)
                                           (if (call-with-values
                                                (lambda ()
                                                  (values
                                                   fn_0
                                                   (unsafe-string-length
                                                    fn_0)))
                                                (lambda (vec_0 len_1)
                                                  (call-with-values
                                                   (lambda ()
                                                     (let ((vec_1 bstr_0))
                                                       (values
                                                        vec_1
                                                        (unsafe-bytes-length
                                                         vec_1))))
                                                   (lambda (vec_1 len_2)
                                                     (let ((vec_2 vec_0)
                                                           (len_3 len_1))
                                                       (letrec*
                                                        ((for-loop_1
                                                          (|#%name|
                                                           for-loop
                                                           (lambda (result_1
                                                                    pos_0
                                                                    pos_1)
                                                             (if (if (unsafe-fx<
                                                                      pos_0
                                                                      len_3)
                                                                   (unsafe-fx<
                                                                    pos_1
                                                                    len_2)
                                                                   #f)
                                                               (let ((c_0
                                                                      (string-ref
                                                                       vec_2
                                                                       pos_0)))
                                                                 (let ((b_0
                                                                        (unsafe-bytes-ref
                                                                         vec_1
                                                                         pos_1)))
                                                                   (let ((c_1
                                                                          c_0))
                                                                     (let ((result_2
                                                                            (let ((result_2
                                                                                   (let ((or-part_0
                                                                                          (eqv?
                                                                                           (char->integer
                                                                                            c_1)
                                                                                           b_0)))
                                                                                     (if or-part_0
                                                                                       or-part_0
                                                                                       (eqv?
                                                                                        (char->integer
                                                                                         (char-downcase
                                                                                          c_1))
                                                                                        b_0)))))
                                                                              (values
                                                                               result_2))))
                                                                       (if (if (not
                                                                                (let ((x_0
                                                                                       (list
                                                                                        c_1)))
                                                                                  (not
                                                                                   result_2)))
                                                                             (if (not
                                                                                  (let ((x_0
                                                                                         (list
                                                                                          b_0)))
                                                                                    (not
                                                                                     result_2)))
                                                                               #t
                                                                               #f)
                                                                             #f)
                                                                         (for-loop_1
                                                                          result_2
                                                                          (unsafe-fx+
                                                                           1
                                                                           pos_0)
                                                                          (unsafe-fx+
                                                                           1
                                                                           pos_1))
                                                                         result_2)))))
                                                               result_1)))))
                                                        (for-loop_1
                                                         #t
                                                         0
                                                         0)))))))
                                             (let ((or-part_0
                                                    (= len_0 fn-len_0)))
                                               (if or-part_0
                                                 or-part_0
                                                 (let ((or-part_1
                                                        (eqv?
                                                         (unsafe-bytes-ref
                                                          bstr_0
                                                          fn-len_0)
                                                         46)))
                                                   (if or-part_1
                                                     or-part_1
                                                     (let ((or-part_2
                                                            (eqv?
                                                             (unsafe-bytes-ref
                                                              bstr_0
                                                              fn-len_0)
                                                             58)))
                                                       (if or-part_2
                                                         or-part_2
                                                         (call-with-values
                                                          (lambda ()
                                                            (unsafe-normalise-inputs
                                                             unsafe-bytes-length
                                                             bstr_0
                                                             fn-len_0
                                                             #f
                                                             1))
                                                          (lambda (v*_0
                                                                   start*_0
                                                                   stop*_0
                                                                   step*_0)
                                                            (letrec*
                                                             ((for-loop_1
                                                               (|#%name|
                                                                for-loop
                                                                (lambda (result_1
                                                                         idx_0)
                                                                  (if (unsafe-fx<
                                                                       idx_0
                                                                       stop*_0)
                                                                    (let ((b_0
                                                                           (unsafe-bytes-ref
                                                                            v*_0
                                                                            idx_0)))
                                                                      (let ((or-part_3
                                                                             (eqv?
                                                                              b_0
                                                                              32)))
                                                                        (let ((result_2
                                                                               (let ((result_2
                                                                                      (if or-part_3
                                                                                        or-part_3
                                                                                        (eqv?
                                                                                         b_0
                                                                                         46))))
                                                                                 (values
                                                                                  result_2))))
                                                                          (if (if (not
                                                                                   (let ((x_0
                                                                                          (list
                                                                                           b_0)))
                                                                                     (not
                                                                                      result_2)))
                                                                                #t
                                                                                #f)
                                                                            (for-loop_1
                                                                             result_2
                                                                             (unsafe-fx+
                                                                              idx_0
                                                                              1))
                                                                            result_2))))
                                                                    result_1)))))
                                                             (for-loop_1
                                                              #t
                                                              start*_0))))))))))
                                             #f)
                                           #f))))
                                  (values result_1))))
                           (if (if (not (let ((x_0 (list fn_0))) result_1))
                                 #t
                                 #f)
                             (for-loop_0 result_1 rest_0)
                             result_1))))
                     result_0)))))
              (for-loop_0 #f special-filenames)))))))))
(define drive-letter?
  (lambda (c_0)
    (let ((or-part_0 (<= 97 c_0 122)))
      (if or-part_0 or-part_0 (<= 65 c_0 90)))))
(define letter-drive-start?
  (lambda (bstr_0 len_0)
    (if (>= len_0 2)
      (if (drive-letter? (unsafe-bytes-ref bstr_0 0))
        (eqv? (unsafe-bytes-ref bstr_0 1) 58)
        #f)
      #f)))
(define backslash-backslash-questionmark?
  (lambda (bstr_0)
    (let ((len_0 (unsafe-bytes-length bstr_0)))
      (if (>= len_0 4)
        (if (eqv? (unsafe-bytes-ref bstr_0 0) 92)
          (if (eqv? (unsafe-bytes-ref bstr_0 1) 92)
            (if (eqv? (unsafe-bytes-ref bstr_0 2) 63)
              (eqv? (unsafe-bytes-ref bstr_0 3) 92)
              #f)
            #f)
          #f)
        #f))))
(define backslash-backslash-questionmark-kind
  (lambda (bstr_0)
    (call-with-values
     (lambda () (parse-backslash-backslash-questionmark bstr_0))
     (lambda (kind_0
              drive-end-pos_0
              orig-drive-end-pos_0
              clean-start-pos_0
              add-sep-pos_0)
       kind_0))))
(define parse-backslash-backslash-questionmark
  (lambda (bstr_0)
    (if (not (backslash-backslash-questionmark? bstr_0))
      (values #f #f #f #f #f)
      (let ((len_0 (unsafe-bytes-length bstr_0)))
        (let ((base_0
               (if (if (>= len_0 5) (eqv? (unsafe-bytes-ref bstr_0 4) 92) #f)
                 5
                 4)))
          (let ((two-backslashes?_0
                 (if (> len_0 5)
                   (if (eqv? (unsafe-bytes-ref bstr_0 (sub1 len_0)) 92)
                     (eqv? (unsafe-bytes-ref bstr_0 (- len_0 2)) 92)
                     #f)
                   #f)))
            (if (if two-backslashes?_0 (= len_0 6) #f)
              (values 'abs 4 4 3 #vu8(92 92))
              (if (if two-backslashes?_0
                    (let ((or-part_0 (not (= len_0 (+ base_0 4)))))
                      (if or-part_0
                        or-part_0
                        (let ((or-part_1
                               (not
                                (if (> len_0 base_0)
                                  (drive-letter?
                                   (unsafe-bytes-ref bstr_0 base_0))
                                  #f))))
                          (if or-part_1
                            or-part_1
                            (not
                             (if (> len_0 (add1 base_0))
                               (eqv?
                                (unsafe-bytes-ref bstr_0 (add1 base_0))
                                58)
                               #f))))))
                    #f)
                (values
                 'abs
                 len_0
                 len_0
                 len_0
                 (if (not (eqv? (unsafe-bytes-ref bstr_0 (- len_0 3)) 92))
                   #vu8(92)
                   #vu8()))
                (let ((c2_0
                       (if (> len_0 6)
                         (letrec*
                          ((loop_0
                            (|#%name|
                             loop
                             (lambda (i+1_0)
                               (if (= i+1_0 6)
                                 #f
                                 (let ((i_0 (sub1 i+1_0)))
                                   (if (if (eqv?
                                            (unsafe-bytes-ref bstr_0 i_0)
                                            92)
                                         (if (eqv?
                                              (unsafe-bytes-ref
                                               bstr_0
                                               (- i_0 1))
                                              92)
                                           (eqv?
                                            (unsafe-bytes-ref bstr_0 (- i_0 2))
                                            92)
                                           #f)
                                         #f)
                                     i_0
                                     (loop_0 i_0))))))))
                          (loop_0 len_0))
                         #f)))
                  (if c2_0
                    (let ((i+1_0 (add1 c2_0))) (values 'abs c2_0 i+1_0 i+1_0 #vu8()))
                    (if (if (> len_0 6)
                          (if (drive-letter? (unsafe-bytes-ref bstr_0 base_0))
                            (if (eqv?
                                 (unsafe-bytes-ref bstr_0 (add1 base_0))
                                 58)
                              (if (> len_0 (+ 2 base_0))
                                (eqv?
                                 (unsafe-bytes-ref bstr_0 (+ 2 base_0))
                                 92)
                                #f)
                              #f)
                            #f)
                          #f)
                      (let ((drive-len_0 (+ base_0 3)))
                        (let ((orig-drive-len_0
                               (if (if (> len_0 drive-len_0)
                                     (eqv?
                                      (unsafe-bytes-ref bstr_0 drive-len_0)
                                      92)
                                     #f)
                                 (add1 drive-len_0)
                                 drive-len_0)))
                          (values
                           'abs
                           drive-len_0
                           orig-drive-len_0
                           (+ base_0 2)
                           #vu8())))
                      (let ((c1_0
                             (if (> len_0 (+ base_0 3))
                               (if (let ((b_0
                                          (unsafe-bytes-ref bstr_0 base_0)))
                                     (let ((or-part_0 (eqv? b_0 85)))
                                       (if or-part_0
                                         or-part_0
                                         (eqv? b_0 117))))
                                 (if (let ((b_0
                                            (unsafe-bytes-ref
                                             bstr_0
                                             (add1 base_0))))
                                       (let ((or-part_0 (eqv? b_0 78)))
                                         (if or-part_0
                                           or-part_0
                                           (eqv? b_0 110))))
                                   (if (let ((b_0
                                              (unsafe-bytes-ref
                                               bstr_0
                                               (+ base_0 2))))
                                         (let ((or-part_0 (eqv? b_0 67)))
                                           (if or-part_0
                                             or-part_0
                                             (eqv? b_0 99))))
                                     (if (eqv?
                                          (unsafe-bytes-ref
                                           bstr_0
                                           (+ 3 base_0))
                                          92)
                                       (let ((temp14_0
                                              (if (if (> len_0 (+ base_0 4))
                                                    (eqv?
                                                     (unsafe-bytes-ref
                                                      bstr_0
                                                      (+ 4 base_0))
                                                     92)
                                                    #f)
                                                (+ base_0 5)
                                                (+ base_0 4))))
                                         (parse-unc.1 #f #t bstr_0 temp14_0))
                                       #f)
                                     #f)
                                   #f)
                                 #f)
                               #f)))
                        (if c1_0
                          (let ((orig-drive-len_0
                                 (if (if (> len_0 c1_0)
                                       (eqv? (unsafe-bytes-ref bstr_0 c1_0) 92)
                                       #f)
                                   (add1 c1_0)
                                   c1_0)))
                            (values
                             'unc
                             c1_0
                             orig-drive-len_0
                             (+ base_0 3)
                             #vu8(92)))
                          (if (if (= base_0 4)
                                (if (> len_0 8)
                                  (if (eqv? (unsafe-bytes-ref bstr_0 4) 82)
                                    (if (eqv? (unsafe-bytes-ref bstr_0 5) 69)
                                      (if (let ((b_0
                                                 (unsafe-bytes-ref bstr_0 6)))
                                            (let ((or-part_0 (eqv? b_0 76)))
                                              (if or-part_0
                                                or-part_0
                                                (eqv? b_0 68))))
                                        (if (eqv?
                                             (unsafe-bytes-ref bstr_0 7)
                                             92)
                                          (let ((or-part_0
                                                 (not
                                                  (eqv?
                                                   (unsafe-bytes-ref bstr_0 8)
                                                   92))))
                                            (if or-part_0
                                              or-part_0
                                              (> len_0 9)))
                                          #f)
                                        #f)
                                      #f)
                                    #f)
                                  #f)
                                #f)
                            (values
                             (if (eqv? (unsafe-bytes-ref bstr_0 6) 76)
                               'rel
                               'red)
                             #f
                             #f
                             #f
                             #f)
                            (let ((orig-drive-len_0
                                   (if (if (> len_0 4)
                                         (eqv? (unsafe-bytes-ref bstr_0 4) 92)
                                         #f)
                                     (if (if (> len_0 5)
                                           (eqv?
                                            (unsafe-bytes-ref bstr_0 5)
                                            92)
                                           #f)
                                       6
                                       5)
                                     4)))
                              (let ((clean-start-pos_0
                                     (if (let ((or-part_0
                                                (if (= len_0 5)
                                                  (eqv?
                                                   (unsafe-bytes-ref bstr_0 4)
                                                   92)
                                                  #f)))
                                           (if or-part_0
                                             or-part_0
                                             (if (= len_0 6)
                                               (if (eqv?
                                                    (unsafe-bytes-ref bstr_0 4)
                                                    92)
                                                 (eqv?
                                                  (unsafe-bytes-ref bstr_0 5)
                                                  92)
                                                 #f)
                                               #f)))
                                       3
                                       orig-drive-len_0)))
                                (values
                                 'abs
                                 4
                                 orig-drive-len_0
                                 clean-start-pos_0
                                 #vu8(92 92))))))))))))))))))
(define parse-unc.1
  (|#%name|
   parse-unc
   (lambda (exact?5_0 no-forward-slash?6_0 bstr9_0 delta10_0)
     (if (if (zero? delta10_0) (backslash-backslash-questionmark? bstr9_0) #f)
       #f
       (if (if (zero? delta10_0)
             (not
              (if (> (unsafe-bytes-length bstr9_0) 2)
                (if (is-sep? (unsafe-bytes-ref bstr9_0 0) 'windows)
                  (is-sep? (unsafe-bytes-ref bstr9_0 1) 'windows)
                  #f)
                #f))
             #f)
         #f
         (let ((is-a-sep?_0
                (|#%name|
                 is-a-sep?
                 (lambda (c_0)
                   (if no-forward-slash?6_0
                     (eqv? c_0 92)
                     (is-sep? c_0 'windows))))))
           (let ((len_0 (unsafe-bytes-length bstr9_0)))
             (let ((j_0 (if (zero? delta10_0) 2 delta10_0)))
               (if (not
                    (if (> len_0 j_0)
                      (is-a-sep?_0 (unsafe-bytes-ref bstr9_0 j_0))
                      #f))
                 (letrec*
                  ((loop_0
                    (|#%name|
                     loop
                     (lambda (j_1)
                       (if (= j_1 len_0)
                         #f
                         (if (not (is-a-sep?_0 (unsafe-bytes-ref bstr9_0 j_1)))
                           (if (if no-forward-slash?6_0
                                 (eqv? (unsafe-bytes-ref bstr9_0 j_1) 47)
                                 #f)
                             #f
                             (loop_0 (add1 j_1)))
                           (let ((j_2 (add1 j_1)))
                             (let ((j_3
                                    (if (if no-forward-slash?6_0
                                          (if (< j_2 len_0)
                                            (is-a-sep?_0
                                             (unsafe-bytes-ref bstr9_0 j_2))
                                            #f)
                                          #f)
                                      (add1 j_2)
                                      j_2)))
                               (if (if (=
                                        j_3
                                        (if (zero? delta10_0)
                                          4
                                          (+ delta10_0 2)))
                                     (eqv?
                                      (unsafe-bytes-ref bstr9_0 (- j_3 2))
                                      63)
                                     #f)
                                 #f
                                 (if (if (not no-forward-slash?6_0)
                                       (if (< j_3 len_0)
                                         (is-a-sep?_0
                                          (unsafe-bytes-ref bstr9_0 j_3))
                                         #f)
                                       #f)
                                   #f
                                   (letrec*
                                    ((loop_1
                                      (|#%name|
                                       loop
                                       (lambda (j_4)
                                         (if (= j_4 len_0)
                                           #f
                                           (if (is-a-sep?_0
                                                (unsafe-bytes-ref bstr9_0 j_4))
                                             (loop_1 (add1 j_4))
                                             (letrec*
                                              ((loop_2
                                                (|#%name|
                                                 loop
                                                 (lambda (j_5)
                                                   (if (= j_5 len_0)
                                                     len_0
                                                     (if (is-a-sep?_0
                                                          (unsafe-bytes-ref
                                                           bstr9_0
                                                           j_5))
                                                       (if (let ((or-part_0
                                                                  (not
                                                                   exact?5_0)))
                                                             (if or-part_0
                                                               or-part_0
                                                               (call-with-values
                                                                (lambda ()
                                                                  (unsafe-normalise-inputs
                                                                   unsafe-bytes-length
                                                                   bstr9_0
                                                                   (add1 j_5)
                                                                   #f
                                                                   1))
                                                                (lambda (v*_0
                                                                         start*_0
                                                                         stop*_0
                                                                         step*_0)
                                                                  (letrec*
                                                                   ((for-loop_0
                                                                     (|#%name|
                                                                      for-loop
                                                                      (lambda (result_0
                                                                               idx_0)
                                                                        (if (unsafe-fx<
                                                                             idx_0
                                                                             stop*_0)
                                                                          (let ((b_0
                                                                                 (unsafe-bytes-ref
                                                                                  v*_0
                                                                                  idx_0)))
                                                                            (let ((result_1
                                                                                   (let ((result_1
                                                                                          (not
                                                                                           (is-a-sep?_0
                                                                                            b_0))))
                                                                                     (values
                                                                                      result_1))))
                                                                              (if (if (not
                                                                                       (let ((x_0
                                                                                              (list
                                                                                               b_0)))
                                                                                         (not
                                                                                          result_1)))
                                                                                    #t
                                                                                    #f)
                                                                                (for-loop_0
                                                                                 result_1
                                                                                 (unsafe-fx+
                                                                                  idx_0
                                                                                  1))
                                                                                result_1)))
                                                                          result_0)))))
                                                                   (for-loop_0
                                                                    #t
                                                                    start*_0))))))
                                                         j_5
                                                         #f)
                                                       (loop_2
                                                        (add1 j_5))))))))
                                              (loop_2 j_4))))))))
                                    (loop_1 j_3))))))))))))
                  (loop_0 j_0))
                 #f)))))))))
(define backslash-backslash-questionmark-dot-ups-end
  (lambda (bstr_0 len_0)
    (let ((pos_0
           (if (eqv? (unsafe-bytes-ref bstr_0 6) 76)
             (letrec*
              ((loop_0
                (|#%name|
                 loop
                 (lambda (pos_0 j_0)
                   (if (> (+ j_0 3) len_0)
                     pos_0
                     (if (if (eqv? (unsafe-bytes-ref bstr_0 j_0) 92)
                           (if (eqv? (unsafe-bytes-ref bstr_0 (+ j_0 1)) 46)
                             (if (eqv? (unsafe-bytes-ref bstr_0 (+ j_0 2)) 46)
                               (let ((or-part_0 (= len_0 (+ j_0 3))))
                                 (if or-part_0
                                   or-part_0
                                   (eqv?
                                    (unsafe-bytes-ref bstr_0 (+ j_0 3))
                                    92)))
                               #f)
                             #f)
                           #f)
                       (let ((j+3_0 (+ j_0 3))) (loop_0 j+3_0 j+3_0))
                       pos_0))))))
              (loop_0 #f 7))
             #f)))
      (if pos_0
        (if (= pos_0 len_0)
          (values pos_0 len_0)
          (if (if (< (+ pos_0 2) len_0)
                (eqv? (unsafe-bytes-ref bstr_0 (add1 pos_0)) 92)
                #f)
            (values pos_0 (+ pos_0 2))
            (values pos_0 (+ pos_0 1))))
        (if (> len_0 8)
          (if (eqv? (unsafe-bytes-ref bstr_0 8) 92)
            (values #f 9)
            (values #f 8))
          (values #f 8))))))
(define split-drive
  (lambda (bstr_0)
    (if (backslash-backslash-questionmark? bstr_0)
      (call-with-values
       (lambda () (parse-backslash-backslash-questionmark bstr_0))
       (lambda (kind_0
                drive-len_0
                orig-drive-len_0
                clean-start-pos_0
                add-sep-pos_0)
         (subbytes bstr_0 0 drive-len_0)))
      (let ((c3_0 (parse-unc.1 #f #f bstr_0 0)))
        (if c3_0
          (subbytes bstr_0 0 c3_0)
          (subbytes bstr_0 0 (min 3 (unsafe-bytes-length bstr_0))))))))
(define strip-trailing-spaces
  (lambda (bstr_0)
    (if (backslash-backslash-questionmark? bstr_0)
      bstr_0
      (let ((len_0 (unsafe-bytes-length bstr_0)))
        (let ((len-before-seps_0
               (letrec*
                ((loop_0
                  (|#%name|
                   loop
                   (lambda (i+1_0)
                     (let ((i_0 (sub1 i+1_0)))
                       (if (is-sep? (unsafe-bytes-ref bstr_0 i_0) 'windows)
                         (if (zero? i_0) 0 (loop_0 i_0))
                         i+1_0))))))
                (loop_0 len_0))))
          (letrec*
           ((loop_0
             (|#%name|
              loop
              (lambda (i+1_0)
                (if (zero? i+1_0)
                  bstr_0
                  (let ((i_0 (sub1 i+1_0)))
                    (let ((b_0 (unsafe-bytes-ref bstr_0 i_0)))
                      (if (is-sep? b_0 'windows)
                        bstr_0
                        (if (let ((or-part_0 (eqv? b_0 46)))
                              (if or-part_0 or-part_0 (eqv? b_0 32)))
                          (loop_0 i_0)
                          (if (= i+1_0 len-before-seps_0)
                            bstr_0
                            (let ((app_0 (subbytes bstr_0 0 i+1_0)))
                              (bytes-append
                               app_0
                               (subbytes
                                bstr_0
                                len-before-seps_0
                                len_0)))))))))))))
           (loop_0 len-before-seps_0)))))))
(define strip-backslash-backslash-rel
  (lambda (bstr_0)
    (call-with-values
     (lambda () (parse-backslash-backslash-questionmark bstr_0))
     (lambda (kind_0
              drive-end-pos_0
              orig-drive-end-pos_0
              clean-start-pos_0
              add-sep-pos_0)
       (if (eq? kind_0 'rel)
         (subbytes bstr_0 (if (eqv? (unsafe-bytes-ref bstr_0 8) 92) 9 8))
         bstr_0)))))
(define check-path-test-argument
  (lambda (who_0 p_0)
    (if (let ((or-part_0 (1/path? p_0)))
          (if or-part_0
            or-part_0
            (let ((or-part_1 (string? p_0)))
              (if or-part_1 or-part_1 (1/path? p_0)))))
      (void)
      (raise-argument-error
       who_0
       "(or/c path? string? path-for-some-system?)"
       p_0))))
(define 1/relative-path?
  (|#%name|
   relative-path?
   (lambda (p_0)
     (begin
       (check-path-test-argument 'relative-path? p_0)
       (if (1/path? p_0)
         (let ((tmp_0 (path-convention p_0)))
           (if (eq? tmp_0 'unix)
             (let ((bstr_0 (path-bytes p_0)))
               (not (is-sep? (unsafe-bytes-ref bstr_0 0) 'unix)))
             (if (eq? tmp_0 'windows)
               (let ((p_1 (path-bytes p_0)))
                 (windows-relative-path-bytes? p_1))
               (void))))
         (if (string? p_0)
           (if (string-no-nuls? p_0)
             (if (positive? (string-length p_0))
               (let ((tmp_0 (system-path-convention-type)))
                 (if (eq? tmp_0 'unix)
                   (not (is-sep? (char->integer (string-ref p_0 0)) 'unix))
                   (if (eq? tmp_0 'windows)
                     (let ((p_1 (string->path-bytes p_0)))
                       (windows-relative-path-bytes? p_1))
                     (void))))
               #f)
             #f)
           (void)))))))
(define windows-relative-path-bytes?
  (lambda (p_0)
    (let ((bbq_0 (backslash-backslash-questionmark-kind p_0)))
      (if (eq? bbq_0 'rel)
        #t
        (if bbq_0
          #f
          (if (is-sep? (unsafe-bytes-ref p_0 0) 'windows)
            #f
            (if (letter-drive-start? p_0 (unsafe-bytes-length p_0))
              #f
              #t)))))))
(define 1/absolute-path?
  (|#%name|
   absolute-path?
   (lambda (p_0)
     (begin
       (check-path-test-argument 'absolute-path? p_0)
       (if (1/path? p_0)
         (let ((tmp_0 (path-convention p_0)))
           (if (eq? tmp_0 'unix)
             (let ((bstr_0 (path-bytes p_0)))
               (is-sep? (unsafe-bytes-ref bstr_0 0) 'unix))
             (if (eq? tmp_0 'windows)
               (let ((p_1 (path-bytes p_0)))
                 (not (windows-relative-path-bytes? p_1)))
               (void))))
         (if (string? p_0)
           (if (string-no-nuls? p_0)
             (if (positive? (string-length p_0))
               (let ((tmp_0 (system-path-convention-type)))
                 (if (eq? tmp_0 'unix)
                   (is-sep? (char->integer (string-ref p_0 0)) 'unix)
                   (if (eq? tmp_0 'windows)
                     (let ((p_1 (string->path-bytes p_0)))
                       (not (windows-relative-path-bytes? p_1)))
                     (void))))
               #f)
             #f)
           (void)))))))
(define 1/complete-path?
  (|#%name|
   complete-path?
   (lambda (p_0)
     (begin
       (check-path-test-argument 'complete-path? p_0)
       (if (1/path? p_0)
         (let ((tmp_0 (path-convention p_0)))
           (if (eq? tmp_0 'unix)
             (let ((bstr_0 (path-bytes p_0)))
               (is-sep? (unsafe-bytes-ref bstr_0 0) 'unix))
             (if (eq? tmp_0 'windows)
               (let ((p_1 (path-bytes p_0)))
                 (let ((bbq_0 (backslash-backslash-questionmark-kind p_1)))
                   (if bbq_0
                     (if (not (eq? bbq_0 'red)) (not (eq? bbq_0 'rel)) #f)
                     (let ((or-part_0
                            (letter-drive-start?
                             p_1
                             (unsafe-bytes-length p_1))))
                       (if or-part_0
                         or-part_0
                         (if (parse-unc.1 #f #f p_1 0) #t #f))))))
               (void))))
         (if (string? p_0)
           (if (string-no-nuls? p_0)
             (if (positive? (string-length p_0))
               (let ((tmp_0 (system-path-convention-type)))
                 (if (eq? tmp_0 'unix)
                   (is-sep? (char->integer (string-ref p_0 0)) 'unix)
                   (if (eq? tmp_0 'windows)
                     (let ((p_1 (string->path-bytes p_0)))
                       (let ((bbq_0
                              (backslash-backslash-questionmark-kind p_1)))
                         (if bbq_0
                           (if (not (eq? bbq_0 'red))
                             (not (eq? bbq_0 'rel))
                             #f)
                           (let ((or-part_0
                                  (letter-drive-start?
                                   p_1
                                   (unsafe-bytes-length p_1))))
                             (if or-part_0
                               or-part_0
                               (if (parse-unc.1 #f #f p_1 0) #t #f))))))
                     (void))))
               #f)
             #f)
           (void)))))))
(define 1/print-graph
  (make-parameter #f (lambda (v_0) (if v_0 #t #f)) 'print-graph))
(define 1/print-struct
  (make-parameter #t (lambda (v_0) (if v_0 #t #f)) 'print-struct))
(define 1/print-box
  (make-parameter #t (lambda (v_0) (if v_0 #t #f)) 'print-box))
(define 1/print-unreadable
  (make-parameter #t (lambda (v_0) (if v_0 #t #f)) 'print-unreadable))
(define 1/print-hash-table
  (make-parameter #t (lambda (v_0) (if v_0 #t #f)) 'print-hash-table))
(define 1/print-as-expression
  (make-parameter #t (lambda (v_0) (if v_0 #t #f)) 'print-as-expression))
(define 1/print-vector-length
  (make-parameter #f (lambda (v_0) (if v_0 #t #f)) 'print-vector-length))
(define 1/print-pair-curly-braces
  (make-parameter #f (lambda (v_0) (if v_0 #t #f)) 'print-pair-curly-braces))
(define 1/print-mpair-curly-braces
  (make-parameter #t (lambda (v_0) (if v_0 #t #f)) 'print-mpair-curly-braces))
(define 1/print-boolean-long-form
  (make-parameter #f (lambda (v_0) (if v_0 #t #f)) 'print-boolean-long-form))
(define 1/print-reader-abbreviations
  (make-parameter
   #f
   (lambda (v_0) (if v_0 #t #f))
   'print-reader-abbreviations))
(define 1/read-accept-bar-quote
  (make-parameter #t (lambda (v_0) (if v_0 #t #f)) 'read-accept-bar-quote))
(define 1/read-case-sensitive
  (make-parameter #t (lambda (v_0) (if v_0 #t #f)) 'read-case-sensitive))
(define 1/current-write-relative-directory
  (make-parameter
   #f
   (lambda (v_0)
     (begin
       (if (let ((or-part_0 (not v_0)))
             (if or-part_0
               or-part_0
               (let ((or-part_1
                      (if (path-string? v_0) (1/complete-path? v_0) #f)))
                 (if or-part_1
                   or-part_1
                   (if (pair? v_0)
                     (if (path-string? (car v_0))
                       (if (1/complete-path? (car v_0))
                         (if (path-string? (cdr v_0))
                           (1/complete-path? (cdr v_0))
                           #f)
                         #f)
                       #f)
                     #f)))))
         (void)
         (raise-argument-error
          'current-write-relative-directory
          (string-append
           "(or/c (and/c path-string? complete-path?)\n"
           "      (cons/c (and/c path-string? complete-path?)\n"
           "              (and/c path-string? complete-path?))"
           "      #f)")
          v_0))
       (if (string? v_0)
         (->path v_0)
         (if (pair? v_0)
           (let ((app_0 (->path (car v_0)))) (cons app_0 (->path (cdr v_0))))
           v_0))))
   'current-write-relative-directory))
(define 1/print-syntax-width
  (make-parameter
   256
   (lambda (v_0)
     (begin
       (if (let ((or-part_0 (eqv? v_0 +inf.0)))
             (if or-part_0
               or-part_0
               (let ((or-part_1 (eqv? v_0 0)))
                 (if or-part_1
                   or-part_1
                   (if (exact-integer? v_0) (>= v_0 3) #f)))))
         (void)
         (raise-argument-error
          'print-syntax-width
          "(or/c +inf.0 0 (and/c exact-integer? (>=/c 3)))"
          v_0))
       v_0))
   'print-syntax-width))
(define 1/open-input-bytes
  (let ((open-input-bytes_0
         (|#%name|
          open-input-bytes
          (lambda (bstr2_0 name1_0)
            (begin
              (if (bytes? bstr2_0)
                (void)
                (raise-argument-error 'open-input-bytes "bytes?" bstr2_0))
              (let ((p_0
                     (make-input-bytes
                      (bytes->immutable-bytes bstr2_0)
                      name1_0)))
                (begin
                  (if (1/port-count-lines-enabled)
                    (1/port-count-lines! p_0)
                    (void))
                  p_0)))))))
    (|#%name|
     open-input-bytes
     (case-lambda
      ((bstr_0) (open-input-bytes_0 bstr_0 'string))
      ((bstr_0 name1_0) (open-input-bytes_0 bstr_0 name1_0))))))
(define finish_2932
  (make-struct-type-install-properties
   '(bytes-input-port)
   3
   0
   struct:commit-input-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-bytes-input-port))
(define struct:bytes-input-port
  (make-record-type-descriptor
   'bytes-input-port
   struct:commit-input-port
   (|#%nongenerative-uid| bytes-input-port)
   #f
   #f
   '(3 . 7)))
(define effect_2847 (finish_2932 struct:bytes-input-port))
(define create-bytes-input-port
  (|#%name|
   create-bytes-input-port
   (record-constructor
    (make-record-constructor-descriptor struct:bytes-input-port #f #f))))
(define bytes-input-port?
  (|#%name| bytes-input-port? (record-predicate struct:bytes-input-port)))
(define bytes-input-port-bstr
  (|#%name| bytes-input-port-bstr (record-accessor struct:bytes-input-port 0)))
(define bytes-input-port-pos
  (|#%name| bytes-input-port-pos (record-accessor struct:bytes-input-port 1)))
(define bytes-input-port-alt-pos
  (|#%name|
   bytes-input-port-alt-pos
   (record-accessor struct:bytes-input-port 2)))
(define set-bytes-input-port-bstr!
  (|#%name|
   set-bytes-input-port-bstr!
   (record-mutator struct:bytes-input-port 0)))
(define set-bytes-input-port-pos!
  (|#%name|
   set-bytes-input-port-pos!
   (record-mutator struct:bytes-input-port 1)))
(define set-bytes-input-port-alt-pos!
  (|#%name|
   set-bytes-input-port-alt-pos!
   (record-mutator struct:bytes-input-port 2)))
(define finish_2871
  (make-struct-type-install-properties
   '(bytes-input-port-methods)
   0
   0
   struct:commit-input-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'bytes-input-port-methods))
(define struct:bytes-input-port-methods.1
  (make-record-type-descriptor
   'bytes-input-port-methods
   struct:commit-input-port-methods.1
   (|#%nongenerative-uid| bytes-input-port-methods)
   #f
   #f
   '(0 . 0)))
(define effect_2130 (finish_2871 struct:bytes-input-port-methods.1))
(define bytes-input-port-methods4.1
  (|#%name|
   bytes-input-port-methods
   (record-constructor
    (make-record-constructor-descriptor
     struct:bytes-input-port-methods.1
     #f
     #f))))
(define bytes-input-port-methods?.1_2316
  (|#%name|
   bytes-input-port-methods?
   (record-predicate struct:bytes-input-port-methods.1)))
(define bytes-input-port-methods?.1
  (|#%name|
   bytes-input-port-methods?
   (lambda (v)
     (if (bytes-input-port-methods?.1_2316 v)
       #t
       ($value
        (if (impersonator? v)
          (bytes-input-port-methods?.1_2316 (impersonator-val v))
          #f))))))
(define bytes-input-port-vtable.1
  (let ((app_0 (core-port-methods-count-lines!.1 commit-input-port-vtable.1)))
    (let ((app_1
           (core-port-methods-get-location.1 commit-input-port-vtable.1)))
      (bytes-input-port-methods4.1
       (|#%name|
        close
        (lambda (this-id_0)
          (begin
            (set-commit-input-port-commit-manager! this-id_0 #f)
            (begin
              (temp1.1 this-id_0)
              (begin
                (set-bytes-input-port-bstr! this-id_0 #f)
                (let ((b_0 (core-port-buffer this-id_0)))
                  (if (direct-bstr b_0)
                    (let ((pos_0 (direct-pos b_0)))
                      (begin
                        (set-core-port-offset! this-id_0 pos_0)
                        (set-direct-end! b_0 pos_0)
                        (set-direct-bstr! b_0 #f)))
                    (void))))))))
       app_0
       app_1
       (|#%name|
        file-position
        (case-lambda
         ((this-id_0)
          (let ((or-part_0 (bytes-input-port-alt-pos this-id_0)))
            (if or-part_0 or-part_0 (temp3.1$1 this-id_0))))
         ((this-id_0 given-pos36_0)
          (let ((b_0 (core-port-buffer this-id_0)))
            (let ((len_0 (direct-end b_0)))
              (let ((new-pos_0
                     (if (eof-object? given-pos36_0)
                       len_0
                       (min len_0 given-pos36_0))))
                (begin
                  (if (direct-bstr b_0)
                    (set-direct-pos! b_0 new-pos_0)
                    (set-bytes-input-port-pos! this-id_0 new-pos_0))
                  (set-bytes-input-port-alt-pos!
                   this-id_0
                   (if (not (eof-object? given-pos36_0))
                     (if (> given-pos36_0 new-pos_0) given-pos36_0 #f)
                     #f)))))))))
       (core-port-methods-buffer-mode.1 commit-input-port-vtable.1)
       (|#%name| prepare-change (lambda (this-id_0) (temp2.1 this-id_0)))
       (|#%name|
        read-in
        (lambda (this-id_0 dest-bstr95_0 start96_0 end97_0 copy?98_0)
          (let ((b_0 (core-port-buffer this-id_0)))
            (let ((len_0 (direct-end b_0)))
              (let ((i_0 (temp3.1$1 this-id_0)))
                (if (< i_0 len_0)
                  (let ((amt_0
                         (let ((app_2 (- end97_0 start96_0)))
                           (min app_2 (fx- len_0 i_0)))))
                    (let ((new-pos_0 (fx+ i_0 amt_0)))
                      (begin
                        (set-direct-pos! b_0 new-pos_0)
                        (set-core-port-offset! this-id_0 0)
                        (set-direct-bstr!
                         b_0
                         (bytes-input-port-bstr this-id_0))
                        (unsafe-bytes-copy!
                         dest-bstr95_0
                         start96_0
                         (bytes-input-port-bstr this-id_0)
                         i_0
                         new-pos_0)
                        (temp1.1 this-id_0)
                        amt_0)))
                  eof))))))
       (|#%name|
        peek-in
        (lambda (this-id_0
                 dest-bstr122_0
                 start123_0
                 end124_0
                 skip125_0
                 progress-evt126_0
                 copy?127_0)
          (let ((b_0 (core-port-buffer this-id_0)))
            (let ((len_0 (direct-end b_0)))
              (let ((i_0 (temp3.1$1 this-id_0)))
                (let ((at-pos_0 (+ i_0 skip125_0)))
                  (if (if progress-evt126_0
                        (sync/timeout 0 progress-evt126_0)
                        #f)
                    #f
                    (if (< at-pos_0 len_0)
                      (let ((amt_0
                             (let ((app_2 (- end124_0 start123_0)))
                               (min app_2 (fx- len_0 at-pos_0)))))
                        (begin
                          (let ((app_2 (bytes-input-port-bstr this-id_0)))
                            (unsafe-bytes-copy!
                             dest-bstr122_0
                             start123_0
                             app_2
                             at-pos_0
                             (fx+ at-pos_0 amt_0)))
                          amt_0))
                      eof))))))))
       (|#%name| byte-ready (lambda (this-id_0 work-done!153_0) #t))
       (|#%name|
        get-progress-evt
        (lambda (this-id_0)
          (begin
            (unsafe-start-atomic)
            (begin0
              (begin
                (if (commit-input-port-progress-sema this-id_0)
                  (void)
                  (let ((b_0 (core-port-buffer this-id_0)))
                    (if (direct-bstr b_0)
                      (let ((i_0 (direct-pos b_0)))
                        (begin
                          (set-bytes-input-port-pos! this-id_0 i_0)
                          (set-core-port-offset! this-id_0 i_0)
                          (set-direct-bstr! b_0 #f)
                          (set-direct-pos! b_0 (direct-end b_0))))
                      (void))))
                (temp4.1 this-id_0))
              (unsafe-end-atomic)))))
       (|#%name|
        commit
        (lambda (this-id_0 amt193_0 progress-evt194_0 ext-evt195_0 finish196_0)
          (temp3.1
           this-id_0
           progress-evt194_0
           ext-evt195_0
           (lambda ()
             (let ((b_0 (core-port-buffer this-id_0)))
               (let ((len_0 (direct-end b_0)))
                 (let ((i_0 (temp3.1$1 this-id_0)))
                   (let ((amt_0 (min amt193_0 (- len_0 i_0))))
                     (let ((dest-bstr_0 (make-bytes amt_0)))
                       (begin
                         (let ((app_2 (bytes-input-port-bstr this-id_0)))
                           (unsafe-bytes-copy!
                            dest-bstr_0
                            0
                            app_2
                            i_0
                            (+ i_0 amt_0)))
                         (set-direct-pos! b_0 (fx+ i_0 amt_0))
                         (set-direct-bstr!
                          b_0
                          (bytes-input-port-bstr this-id_0))
                         (set-core-port-offset! this-id_0 0)
                         (temp1.1 this-id_0)
                         (|#%app| finish196_0 dest-bstr_0)))))))))))))))
(define temp3.1$1
  (|#%name|
   in-buffer-pos
   (lambda (this-id_0)
     (let ((b_0 (core-port-buffer this-id_0)))
       (if (direct-bstr b_0)
         (direct-pos b_0)
         (bytes-input-port-pos this-id_0))))))
(define make-input-bytes
  (lambda (bstr_0 name_0)
    (finish-port/count
     (create-bytes-input-port
      bytes-input-port-vtable.1
      name_0
      (direct2.1 bstr_0 0 (unsafe-bytes-length bstr_0))
      #f
      #f
      0
      #f
      #f
      #f
      #f
      #f
      bstr_0
      0
      #f))))
(define finish_2411
  (make-struct-type-install-properties
   '(bytes-output-port)
   3
   0
   struct:core-output-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-bytes-output-port))
(define struct:bytes-output-port
  (make-record-type-descriptor
   'bytes-output-port
   struct:core-output-port
   (|#%nongenerative-uid| bytes-output-port)
   #f
   #f
   '(3 . 7)))
(define effect_2052 (finish_2411 struct:bytes-output-port))
(define create-bytes-output-port
  (|#%name|
   create-bytes-output-port
   (record-constructor
    (make-record-constructor-descriptor struct:bytes-output-port #f #f))))
(define bytes-output-port?
  (|#%name| bytes-output-port? (record-predicate struct:bytes-output-port)))
(define bytes-output-port-bstr
  (|#%name|
   bytes-output-port-bstr
   (record-accessor struct:bytes-output-port 0)))
(define bytes-output-port-pos
  (|#%name|
   bytes-output-port-pos
   (record-accessor struct:bytes-output-port 1)))
(define bytes-output-port-max-pos
  (|#%name|
   bytes-output-port-max-pos
   (record-accessor struct:bytes-output-port 2)))
(define set-bytes-output-port-bstr!
  (|#%name|
   set-bytes-output-port-bstr!
   (record-mutator struct:bytes-output-port 0)))
(define set-bytes-output-port-pos!
  (|#%name|
   set-bytes-output-port-pos!
   (record-mutator struct:bytes-output-port 1)))
(define set-bytes-output-port-max-pos!
  (|#%name|
   set-bytes-output-port-max-pos!
   (record-mutator struct:bytes-output-port 2)))
(define finish_2698
  (make-struct-type-install-properties
   '(bytes-output-port-methods)
   2
   0
   struct:core-output-port-methods.1
   null
   (current-inspector)
   #f
   '(0 1)
   #f
   'bytes-output-port-methods))
(define struct:bytes-output-port-methods.1
  (make-record-type-descriptor
   'bytes-output-port-methods
   struct:core-output-port-methods.1
   (|#%nongenerative-uid| bytes-output-port-methods)
   #f
   #f
   '(2 . 0)))
(define effect_2430 (finish_2698 struct:bytes-output-port-methods.1))
(define bytes-output-port-methods8.1
  (|#%name|
   bytes-output-port-methods
   (record-constructor
    (make-record-constructor-descriptor
     struct:bytes-output-port-methods.1
     #f
     #f))))
(define bytes-output-port-methods?.1_1617
  (|#%name|
   bytes-output-port-methods?
   (record-predicate struct:bytes-output-port-methods.1)))
(define bytes-output-port-methods?.1
  (|#%name|
   bytes-output-port-methods?
   (lambda (v)
     (if (bytes-output-port-methods?.1_1617 v)
       #t
       ($value
        (if (impersonator? v)
          (bytes-output-port-methods?.1_1617 (impersonator-val v))
          #f))))))
(define bytes-output-port-methods-get-length.1_2990
  (|#%name|
   bytes-output-port-methods-get-length
   (record-accessor struct:bytes-output-port-methods.1 0)))
(define bytes-output-port-methods-get-length.1
  (|#%name|
   bytes-output-port-methods-get-length
   (lambda (s)
     (if (bytes-output-port-methods?.1_1617 s)
       (bytes-output-port-methods-get-length.1_2990 s)
       ($value
        (impersonate-ref
         bytes-output-port-methods-get-length.1_2990
         struct:bytes-output-port-methods.1
         0
         s
         'get-length))))))
(define bytes-output-port-methods-get-bytes.1_2698
  (|#%name|
   bytes-output-port-methods-get-bytes
   (record-accessor struct:bytes-output-port-methods.1 1)))
(define bytes-output-port-methods-get-bytes.1
  (|#%name|
   bytes-output-port-methods-get-bytes
   (lambda (s)
     (if (bytes-output-port-methods?.1_1617 s)
       (bytes-output-port-methods-get-bytes.1_2698 s)
       ($value
        (impersonate-ref
         bytes-output-port-methods-get-bytes.1_2698
         struct:bytes-output-port-methods.1
         1
         s
         'get-bytes))))))
(define bytes-output-port-vtable.1
  (let ((app_0 (core-port-methods-close.1 core-output-port-vtable.1)))
    (let ((app_1 (core-port-methods-count-lines!.1 core-output-port-vtable.1)))
      (let ((app_2
             (core-port-methods-get-location.1 core-output-port-vtable.1)))
        (let ((app_3
               (core-port-methods-buffer-mode.1 core-output-port-vtable.1)))
          (let ((app_4
                 (core-output-port-methods-write-out-special.1
                  core-output-port-vtable.1)))
            (let ((app_5
                   (let ((get-write-evt_0
                          (get-write-evt-via-write-out
                           (lambda (out_0 v_0 bstr_0 start_0)
                             (port-count! out_0 v_0 bstr_0 start_0)))))
                     get-write-evt_0)))
              (bytes-output-port-methods8.1
               app_0
               app_1
               app_2
               (|#%name|
                file-position
                (case-lambda
                 ((this-id_0)
                  (let ((b_0 (core-port-buffer this-id_0)))
                    (if (direct-bstr b_0)
                      (direct-pos b_0)
                      (bytes-output-port-pos this-id_0))))
                 ((this-id_0 new-pos241_0)
                  (begin
                    (temp6.1 this-id_0)
                    (let ((len_0
                           (unsafe-bytes-length
                            (bytes-output-port-bstr this-id_0))))
                      (if (eof-object? new-pos241_0)
                        (set-bytes-output-port-pos!
                         this-id_0
                         (bytes-output-port-max-pos this-id_0))
                        (if (> new-pos241_0 len_0)
                          (begin
                            (if (>= new-pos241_0 281474976710656)
                              (begin
                                (unsafe-end-atomic)
                                (raise-arguments-error
                                 'file-position
                                 "new position is too large"
                                 "port"
                                 this-id_0
                                 "position"
                                 new-pos241_0))
                              (void))
                            (temp5.1 this-id_0 len_0)
                            (set-bytes-output-port-pos! this-id_0 new-pos241_0)
                            (set-bytes-output-port-max-pos!
                             this-id_0
                             new-pos241_0))
                          (begin
                            (set-bytes-output-port-pos! this-id_0 new-pos241_0)
                            (set-bytes-output-port-max-pos!
                             this-id_0
                             (fxmax
                              (bytes-output-port-max-pos this-id_0)
                              new-pos241_0))))))))))
               app_3
               (|#%name|
                write-out
                (lambda (this-id_0
                         src-bstr277_0
                         src-start278_0
                         src-end279_0
                         nonblock?280_0
                         enable-break?281_0
                         copy?282_0)
                  (begin
                    (temp6.1 this-id_0)
                    (let ((i_0 (bytes-output-port-pos this-id_0)))
                      (let ((amt_0
                             (min (fx- src-end279_0 src-start278_0) 4096)))
                        (let ((end-i_0 (fx+ i_0 amt_0)))
                          (begin
                            (if (<
                                 (unsafe-bytes-length
                                  (bytes-output-port-bstr this-id_0))
                                 end-i_0)
                              (temp5.1 this-id_0 end-i_0)
                              (void))
                            (let ((app_6 (bytes-output-port-bstr this-id_0)))
                              (unsafe-bytes-copy!
                               app_6
                               i_0
                               src-bstr277_0
                               src-start278_0
                               (fx+ src-start278_0 amt_0)))
                            (set-bytes-output-port-pos! this-id_0 end-i_0)
                            (set-bytes-output-port-max-pos!
                             this-id_0
                             (let ((app_6 (bytes-output-port-pos this-id_0)))
                               (fxmax
                                app_6
                                (bytes-output-port-max-pos this-id_0))))
                            (temp7.1$1 this-id_0)
                            amt_0)))))))
               app_4
               app_5
               (core-output-port-methods-get-write-special-evt.1
                core-output-port-vtable.1)
               (|#%name|
                get-length
                (lambda (this-id_0)
                  (begin
                    (unsafe-start-atomic)
                    (temp6.1 this-id_0)
                    (unsafe-end-atomic)
                    (bytes-output-port-max-pos this-id_0))))
               (|#%name|
                get-bytes
                (lambda (this-id_0 dest-bstr323_0 start-pos324_0 discard?325_0)
                  (begin
                    (unsafe-start-atomic)
                    (temp6.1 this-id_0)
                    (let ((app_6 (bytes-output-port-bstr this-id_0)))
                      (unsafe-bytes-copy!
                       dest-bstr323_0
                       0
                       app_6
                       start-pos324_0
                       (fx+
                        start-pos324_0
                        (unsafe-bytes-length dest-bstr323_0))))
                    (if discard?325_0
                      (begin
                        (set-bytes-output-port-bstr! this-id_0 #vu8())
                        (set-bytes-output-port-pos! this-id_0 0)
                        (set-bytes-output-port-max-pos! this-id_0 0))
                      (void))
                    (unsafe-end-atomic))))))))))))
(define temp5.1
  (|#%name|
   enlarge!
   (lambda (this-id_0 len346_0)
     (let ((new-bstr_0 (make-bytes (fx* 2 len346_0))))
       (begin
         (let ((app_0 (bytes-output-port-bstr this-id_0)))
           (unsafe-bytes-copy!
            new-bstr_0
            0
            app_0
            0
            (bytes-output-port-pos this-id_0)))
         (set-bytes-output-port-bstr! this-id_0 new-bstr_0))))))
(define temp6.1
  (|#%name|
   slow-mode!
   (lambda (this-id_0)
     (let ((b_0 (core-port-buffer this-id_0)))
       (if (direct-bstr b_0)
         (let ((s_0 (direct-pos b_0)))
           (begin
             (set-bytes-output-port-pos! this-id_0 s_0)
             (set-direct-pos! b_0 (direct-end b_0))
             (set-direct-bstr! b_0 #f)
             (set-core-port-offset! this-id_0 s_0)
             (set-bytes-output-port-max-pos!
              this-id_0
              (fxmax s_0 (bytes-output-port-max-pos this-id_0)))))
         (void))))))
(define temp7.1$1
  (|#%name|
   fast-mode!
   (lambda (this-id_0)
     (let ((b_0 (core-port-buffer this-id_0)))
       (begin
         (set-direct-bstr! b_0 (bytes-output-port-bstr this-id_0))
         (set-direct-pos! b_0 (bytes-output-port-pos this-id_0))
         (set-direct-end!
          b_0
          (unsafe-bytes-length (bytes-output-port-bstr this-id_0)))
         (set-core-port-offset! this-id_0 0))))))
(define 1/open-output-bytes
  (let ((open-output-bytes_0
         (|#%name|
          open-output-bytes
          (lambda (name9_0)
            (finish-port/count
             (let ((app_0 (direct2.1 #f 0 0)))
               (create-bytes-output-port
                bytes-output-port-vtable.1
                name9_0
                app_0
                #f
                #f
                0
                #f
                always-evt
                #f
                #f
                #f
                (make-bytes 16)
                0
                0)))))))
    (|#%name|
     open-output-bytes
     (case-lambda
      (() (open-output-bytes_0 'string))
      ((name9_0) (open-output-bytes_0 name9_0))))))
(define 1/get-output-bytes
  (let ((get-output-bytes_0
         (|#%name|
          get-output-bytes
          (lambda (o13_0 reset?10_0 start-pos11_0 end-pos12_0)
            (begin
              (if (if (1/output-port? o13_0) (1/string-port? o13_0) #f)
                (void)
                (raise-argument-error
                 'get-output-bytes
                 "(and/c output-port? string-port?)"
                 o13_0))
              (if (exact-nonnegative-integer? start-pos11_0)
                (void)
                (raise-argument-error
                 'get-output-bytes
                 "exact-nonnegative-integer?"
                 start-pos11_0))
              (if (let ((or-part_0 (not end-pos12_0)))
                    (if or-part_0
                      or-part_0
                      (exact-nonnegative-integer? end-pos12_0)))
                (void)
                (raise-argument-error
                 'get-output-bytes
                 "(or/c exact-nonnegative-integer? #f)"
                 end-pos12_0))
              (let ((o_0 (->core-output-port.1 unsafe-undefined o13_0 #f)))
                (begin
                  (unsafe-start-atomic)
                  (let ((len_0
                         (|#%app|
                          (bytes-output-port-methods-get-length.1
                           (core-port-vtable o_0))
                          o_0)))
                    (begin
                      (if (> start-pos11_0 len_0)
                        (begin
                          (unsafe-end-atomic)
                          (raise-range-error
                           'get-output-bytes
                           "port content"
                           "starting "
                           start-pos11_0
                           o_0
                           0
                           len_0
                           #f))
                        (void))
                      (begin
                        (if end-pos12_0
                          (if (<= start-pos11_0 end-pos12_0 len_0)
                            (void)
                            (begin
                              (unsafe-end-atomic)
                              (raise-range-error
                               'get-output-bytes
                               "port content"
                               "ending "
                               end-pos12_0
                               o_0
                               0
                               len_0
                               start-pos11_0)))
                          (void))
                        (let ((amt_0
                               (-
                                (min len_0 (if end-pos12_0 end-pos12_0 len_0))
                                start-pos11_0)))
                          (let ((bstr_0 (make-bytes amt_0)))
                            (begin
                              (|#%app|
                               (bytes-output-port-methods-get-bytes.1
                                (core-port-vtable o_0))
                               o_0
                               bstr_0
                               start-pos11_0
                               reset?10_0)
                              (unsafe-end-atomic)
                              bstr_0)))))))))))))
    (|#%name|
     get-output-bytes
     (case-lambda
      ((o_0) (get-output-bytes_0 o_0 #f 0 #f))
      ((o_0 reset?_0 start-pos_0 end-pos12_0)
       (get-output-bytes_0 o_0 reset?_0 start-pos_0 end-pos12_0))
      ((o_0 reset?_0 start-pos11_0)
       (get-output-bytes_0 o_0 reset?_0 start-pos11_0 #f))
      ((o_0 reset?10_0) (get-output-bytes_0 o_0 reset?10_0 0 #f))))))
(define 1/string-port?
  (|#%name|
   string-port?
   (lambda (p_0)
     (if (1/input-port? p_0)
       (let ((p_1 (->core-input-port.1 unsafe-undefined p_0 #f)))
         (bytes-input-port? p_1))
       (if (1/output-port? p_0)
         (let ((p_1 (->core-output-port.1 unsafe-undefined p_0 #f)))
           (bytes-output-port? p_1))
         (raise-argument-error 'string-port? "port?" p_0))))))
(define 1/open-input-string
  (let ((open-input-string_0
         (|#%name|
          open-input-string
          (lambda (str2_0 name1_0)
            (begin
              (if (string? str2_0)
                (void)
                (raise-argument-error 'open-input-string "string?" str2_0))
              (1/open-input-bytes (1/string->bytes/utf-8 str2_0) name1_0))))))
    (|#%name|
     open-input-string
     (case-lambda
      ((str_0) (open-input-string_0 str_0 'string))
      ((str_0 name1_0) (open-input-string_0 str_0 name1_0))))))
(define 1/open-output-string
  (let ((open-output-string_0
         (|#%name|
          open-output-string
          (lambda (name3_0) (1/open-output-bytes name3_0)))))
    (|#%name|
     open-output-string
     (case-lambda
      (() (open-output-string_0 'string))
      ((name3_0) (open-output-string_0 name3_0))))))
(define 1/get-output-string
  (|#%name|
   get-output-string
   (lambda (o_0)
     (begin
       (if (if (1/output-port? o_0) (1/string-port? o_0) #f)
         (void)
         (raise-argument-error
          'get-output-string
          "(and/c output-port? string-port?)"
          o_0))
       (1/bytes->string/utf-8 (1/get-output-bytes o_0) '#\xfffd)))))
(define more-pending
  (lambda (max-length_0 start_0 end_0 str_0)
    (let ((prev-pending_0 (car max-length_0)))
      (let ((len_0 (- end_0 start_0)))
        (let ((new-pending_0 (+ len_0 prev-pending_0)))
          (if (> new-pending_0 3)
            'full
            (cons
             new-pending_0
             (let ((app_0 (cdr max-length_0)))
               (bytes-append
                app_0
                (if (string? str_0)
                  (1/string->bytes/utf-8 str_0 #f start_0 end_0)
                  (subbytes str_0 start_0 end_0)))))))))))
(define finish_2069
  (make-struct-type-install-properties
   '(max-output-port)
   2
   0
   struct:core-output-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-max-output-port))
(define struct:max-output-port
  (make-record-type-descriptor
   'max-output-port
   struct:core-output-port
   (|#%nongenerative-uid| max-output-port)
   #f
   #f
   '(2 . 3)))
(define effect_3019 (finish_2069 struct:max-output-port))
(define create-max-output-port
  (|#%name|
   create-max-output-port
   (record-constructor
    (make-record-constructor-descriptor struct:max-output-port #f #f))))
(define max-output-port?
  (|#%name| max-output-port? (record-predicate struct:max-output-port)))
(define max-output-port-o
  (|#%name| max-output-port-o (record-accessor struct:max-output-port 0)))
(define max-output-port-max-length
  (|#%name|
   max-output-port-max-length
   (record-accessor struct:max-output-port 1)))
(define set-max-output-port-o!
  (|#%name| set-max-output-port-o! (record-mutator struct:max-output-port 0)))
(define set-max-output-port-max-length!
  (|#%name|
   set-max-output-port-max-length!
   (record-mutator struct:max-output-port 1)))
(define finish_2618
  (make-struct-type-install-properties
   '(max-output-port-methods)
   0
   0
   struct:core-output-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'max-output-port-methods))
(define struct:max-output-port-methods.1
  (make-record-type-descriptor
   'max-output-port-methods
   struct:core-output-port-methods.1
   (|#%nongenerative-uid| max-output-port-methods)
   #f
   #f
   '(0 . 0)))
(define effect_2933 (finish_2618 struct:max-output-port-methods.1))
(define max-output-port-methods1.1
  (|#%name|
   max-output-port-methods
   (record-constructor
    (make-record-constructor-descriptor
     struct:max-output-port-methods.1
     #f
     #f))))
(define max-output-port-methods?.1_2811
  (|#%name|
   max-output-port-methods?
   (record-predicate struct:max-output-port-methods.1)))
(define max-output-port-methods?.1
  (|#%name|
   max-output-port-methods?
   (lambda (v)
     (if (max-output-port-methods?.1_2811 v)
       #t
       ($value
        (if (impersonator? v)
          (max-output-port-methods?.1_2811 (impersonator-val v))
          #f))))))
(define max-output-port-vtable.1
  (let ((app_0 (core-port-methods-close.1 core-output-port-vtable.1)))
    (let ((app_1 (core-port-methods-count-lines!.1 core-output-port-vtable.1)))
      (let ((app_2
             (core-port-methods-get-location.1 core-output-port-vtable.1)))
        (let ((app_3
               (core-port-methods-file-position.1 core-output-port-vtable.1)))
          (let ((app_4
                 (core-port-methods-buffer-mode.1 core-output-port-vtable.1)))
            (let ((app_5
                   (core-output-port-methods-write-out-special.1
                    core-output-port-vtable.1)))
              (let ((app_6
                     (core-output-port-methods-get-write-evt.1
                      core-output-port-vtable.1)))
                (max-output-port-methods1.1
                 app_0
                 app_1
                 app_2
                 app_3
                 app_4
                 (|#%name|
                  write-out
                  (lambda (this-id_0
                           src-bstr4_0
                           src-start5_0
                           src-end6_0
                           nonblock?7_0
                           enable-break?8_0
                           copy?9_0)
                    (if (max-output-port-max-length this-id_0)
                      (let ((len_0 (- src-end6_0 src-start5_0)))
                        (if (eq? (max-output-port-max-length this-id_0) 'full)
                          len_0
                          (if (pair? (max-output-port-max-length this-id_0))
                            (begin
                              (set-max-output-port-max-length!
                               this-id_0
                               (more-pending
                                (max-output-port-max-length this-id_0)
                                src-start5_0
                                src-end6_0
                                src-bstr4_0))
                              len_0)
                            (let ((write-len_0
                                   (min
                                    len_0
                                    (max-output-port-max-length this-id_0))))
                              (begin
                                (unsafe-end-atomic)
                                (let ((wrote-len_0
                                       (let ((app_7
                                              (max-output-port-o this-id_0)))
                                         (1/write-bytes
                                          src-bstr4_0
                                          app_7
                                          src-start5_0
                                          (+ src-start5_0 write-len_0)))))
                                  (begin
                                    (unsafe-start-atomic)
                                    (if (=
                                         (max-output-port-max-length this-id_0)
                                         wrote-len_0)
                                      (begin
                                        (set-max-output-port-max-length!
                                         this-id_0
                                         (more-pending
                                          '(0 . #vu8())
                                          (+
                                           src-start5_0
                                           (max-output-port-max-length
                                            this-id_0))
                                          src-end6_0
                                          src-bstr4_0))
                                        len_0)
                                      (begin
                                        (set-max-output-port-max-length!
                                         this-id_0
                                         (-
                                          (max-output-port-max-length
                                           this-id_0)
                                          wrote-len_0))
                                        wrote-len_0)))))))))
                      (begin
                        (unsafe-end-atomic)
                        (let ((len_0
                               (1/write-bytes
                                src-bstr4_0
                                (max-output-port-o this-id_0)
                                src-start5_0
                                src-end6_0)))
                          (begin (unsafe-start-atomic) len_0))))))
                 app_5
                 app_6
                 (core-output-port-methods-get-write-special-evt.1
                  core-output-port-vtable.1))))))))))
(define make-max-output-port
  (lambda (o_0 max-length_0)
    (let ((app_0 (object-name o_0)))
      (create-max-output-port
       max-output-port-vtable.1
       app_0
       (direct2.1 #f 0 0)
       #f
       #f
       0
       #f
       o_0
       #f
       #f
       #f
       o_0
       max-length_0))))
(define write-string/max
  (let ((write-string/max_0
         (|#%name|
          write-string/max
          (lambda (str3_0 o4_0 max-length5_0 start1_0 end2_0)
            (let ((end_0
                   (if (eq? end2_0 unsafe-undefined)
                     (string-length str3_0)
                     end2_0)))
              (if (eq? max-length5_0 'full)
                'full
                (if (not max-length5_0)
                  (begin (1/write-string str3_0 o4_0 start1_0 end_0) #f)
                  (if (pair? max-length5_0)
                    (more-pending max-length5_0 start1_0 end_0 str3_0)
                    (let ((len_0 (- end_0 start1_0)))
                      (if (<= len_0 max-length5_0)
                        (begin
                          (1/write-string str3_0 o4_0 start1_0 end_0)
                          (- max-length5_0 len_0))
                        (begin
                          (1/write-string
                           str3_0
                           o4_0
                           start1_0
                           (+ start1_0 max-length5_0))
                          (more-pending
                           '(0 . #vu8())
                           (+ start1_0 max-length5_0)
                           end_0
                           str3_0))))))))))))
    (case-lambda
     ((str_0 o_0 max-length_0)
      (write-string/max_0 str_0 o_0 max-length_0 0 unsafe-undefined))
     ((str_0 o_0 max-length_0 start_0 end2_0)
      (write-string/max_0 str_0 o_0 max-length_0 start_0 end2_0))
     ((str_0 o_0 max-length_0 start1_0)
      (write-string/max_0 str_0 o_0 max-length_0 start1_0 unsafe-undefined)))))
(define write-bytes/max
  (let ((write-bytes/max_0
         (|#%name|
          write-bytes/max
          (lambda (bstr8_0 o9_0 max-length10_0 start6_0 end7_0)
            (let ((end_0
                   (if (eq? end7_0 unsafe-undefined)
                     (unsafe-bytes-length bstr8_0)
                     end7_0)))
              (if (eq? max-length10_0 'full)
                'full
                (if (not max-length10_0)
                  (begin (1/write-bytes bstr8_0 o9_0 start6_0 end_0) #f)
                  (if (pair? max-length10_0)
                    (more-pending max-length10_0 start6_0 end_0 bstr8_0)
                    (let ((len_0 (- end_0 start6_0)))
                      (if (<= len_0 max-length10_0)
                        (begin
                          (1/write-bytes bstr8_0 o9_0 start6_0 end_0)
                          (- max-length10_0 len_0))
                        (begin
                          (1/write-bytes
                           bstr8_0
                           o9_0
                           start6_0
                           (+ start6_0 max-length10_0))
                          (more-pending
                           '(0 . #vu8())
                           (+ start6_0 max-length10_0)
                           end_0
                           bstr8_0))))))))))))
    (case-lambda
     ((bstr_0 o_0 max-length_0)
      (write-bytes/max_0 bstr_0 o_0 max-length_0 0 unsafe-undefined))
     ((bstr_0 o_0 max-length_0 start_0 end7_0)
      (write-bytes/max_0 bstr_0 o_0 max-length_0 start_0 end7_0))
     ((bstr_0 o_0 max-length_0 start6_0)
      (write-bytes/max_0 bstr_0 o_0 max-length_0 start6_0 unsafe-undefined)))))
(define make-output-port/max
  (lambda (o_0 max-length_0) (make-max-output-port o_0 max-length_0)))
(define output-port/max-max-length
  (lambda (o_0 max-length_0)
    (if max-length_0 (max-output-port-max-length o_0) #f)))
(define print-string
  (lambda (str_0 o_0 max-length_0)
    (let ((max-length_1 (write-bytes/max #vu8(34) o_0 max-length_0)))
      (let ((len_0 (string-length str_0)))
        (letrec*
         ((loop_0
           (|#%name|
            loop
            (lambda (start-i_0 i_0 max-length_2)
              (if (eq? max-length_2 'full)
                'full
                (if (= i_0 len_0)
                  (let ((max-length_3
                         (write-string/max
                          str_0
                          o_0
                          max-length_2
                          start-i_0
                          i_0)))
                    (write-bytes/max #vu8(34) o_0 max-length_3))
                  (if (if max-length_2
                        (let ((or-part_0 (pair? max-length_2)))
                          (if or-part_0
                            or-part_0
                            (> (- i_0 start-i_0) max-length_2)))
                        #f)
                    (let ((max-length_3
                           (write-string/max
                            str_0
                            o_0
                            max-length_2
                            start-i_0
                            i_0)))
                      (loop_0 i_0 (add1 i_0) max-length_3))
                    (let ((c_0 (string-ref str_0 i_0)))
                      (let ((escaped_0
                             (let ((tmp_0 c_0))
                               (if (eqv? tmp_0 '#\x22)
                                 #vu8(92 34)
                                 (if (eqv? tmp_0 '#\x5c)
                                   #vu8(92 92)
                                   (if (eqv? tmp_0 '#\x7)
                                     #vu8(92 97)
                                     (if (eqv? tmp_0 '#\x8)
                                       #vu8(92 98)
                                       (if (eqv? tmp_0 '#\x1b)
                                         #vu8(92 101)
                                         (if (eqv? tmp_0 '#\xc)
                                           #vu8(92 102)
                                           (if (eqv? tmp_0 '#\xa)
                                             #vu8(92 110)
                                             (if (eqv? tmp_0 '#\xd)
                                               #vu8(92 114)
                                               (if (eqv? tmp_0 '#\x9)
                                                 #vu8(92 116)
                                                 (if (eqv? tmp_0 '#\xb)
                                                   #vu8(92 118)
                                                   #f)))))))))))))
                        (if escaped_0
                          (let ((max-length_3
                                 (write-string/max
                                  str_0
                                  o_0
                                  max-length_2
                                  start-i_0
                                  i_0)))
                            (let ((max-length_4
                                   (write-bytes/max
                                    escaped_0
                                    o_0
                                    max-length_3)))
                              (let ((i_1 (add1 i_0)))
                                (loop_0 i_1 i_1 max-length_4))))
                          (if (char-graphic? c_0)
                            (loop_0
                             start-i_0
                             (+ i_0 (string-grapheme-span str_0 i_0))
                             max-length_2)
                            (if (char-blank? c_0)
                              (loop_0 start-i_0 (add1 i_0) max-length_2)
                              (let ((n_0 (char->integer c_0)))
                                (let ((pad_0
                                       (|#%name|
                                        pad
                                        (lambda (n_1 s_0)
                                          (let ((len_1 (string-length s_0)))
                                            (if (< len_1 n_1)
                                              (string-append
                                               (make-string
                                                (- n_1 len_1)
                                                '#\x30)
                                               s_0)
                                              s_0))))))
                                  (let ((max-length_3
                                         (write-string/max
                                          str_0
                                          o_0
                                          max-length_2
                                          start-i_0
                                          i_0)))
                                    (let ((max-length_4
                                           (if (<= n_0 65535)
                                             (let ((max-length_4
                                                    (write-bytes/max
                                                     #vu8(92 117)
                                                     o_0
                                                     max-length_3)))
                                               (write-string/max
                                                (pad_0
                                                 4
                                                 (string-upcase
                                                  (number->string n_0 16)))
                                                o_0
                                                max-length_4))
                                             (let ((max-length_4
                                                    (write-bytes/max
                                                     #vu8(92 85)
                                                     o_0
                                                     max-length_3)))
                                               (write-string/max
                                                (pad_0
                                                 8
                                                 (string-upcase
                                                  (number->string n_0 16)))
                                                o_0
                                                max-length_4)))))
                                      (let ((i_1 (add1 i_0)))
                                        (loop_0
                                         i_1
                                         i_1
                                         max-length_4))))))))))))))))))
         (loop_0 0 0 max-length_1))))))
(define print-bytes
  (lambda (bstr_0 o_0 max-length_0)
    (let ((max-length_1 (write-bytes/max #vu8(35 34) o_0 max-length_0)))
      (let ((len_0 (unsafe-bytes-length bstr_0)))
        (letrec*
         ((loop_0
           (|#%name|
            loop
            (lambda (start-i_0 i_0 max-length_2)
              (if (eq? max-length_2 'full)
                'full
                (if (= i_0 len_0)
                  (let ((max-length_3
                         (write-bytes/max
                          bstr_0
                          o_0
                          max-length_2
                          start-i_0
                          i_0)))
                    (write-bytes/max #vu8(34) o_0 max-length_3))
                  (if (if max-length_2
                        (let ((or-part_0 (pair? max-length_2)))
                          (if or-part_0
                            or-part_0
                            (> (- i_0 start-i_0) max-length_2)))
                        #f)
                    (let ((max-length_3
                           (write-bytes/max
                            bstr_0
                            o_0
                            max-length_2
                            start-i_0
                            i_0)))
                      (loop_0 i_0 (add1 i_0) max-length_3))
                    (let ((b_0 (unsafe-bytes-ref bstr_0 i_0)))
                      (if (if (< b_0 128)
                            (let ((c_0 (integer->char b_0)))
                              (if (let ((or-part_0 (char-blank? c_0)))
                                    (if or-part_0
                                      or-part_0
                                      (char-graphic? c_0)))
                                (if (not (char=? c_0 '#\x9))
                                  (if (not (char=? c_0 '#\x22))
                                    (not (char=? c_0 '#\x5c))
                                    #f)
                                  #f)
                                #f))
                            #f)
                        (loop_0 start-i_0 (add1 i_0) max-length_2)
                        (let ((max-length_3
                               (write-bytes/max
                                bstr_0
                                o_0
                                max-length_2
                                start-i_0
                                i_0)))
                          (let ((escaped_0
                                 (let ((tmp_0
                                        (if (< b_0 128)
                                          (integer->char b_0)
                                          #f)))
                                   (if (eqv? tmp_0 '#\x22)
                                     #vu8(92 34)
                                     (if (eqv? tmp_0 '#\x5c)
                                       #vu8(92 92)
                                       (if (eqv? tmp_0 '#\x7)
                                         #vu8(92 97)
                                         (if (eqv? tmp_0 '#\x8)
                                           #vu8(92 98)
                                           (if (eqv? tmp_0 '#\x1b)
                                             #vu8(92 101)
                                             (if (eqv? tmp_0 '#\xc)
                                               #vu8(92 102)
                                               (if (eqv? tmp_0 '#\xa)
                                                 #vu8(92 110)
                                                 (if (eqv? tmp_0 '#\xd)
                                                   #vu8(92 114)
                                                   (if (eqv? tmp_0 '#\x9)
                                                     #vu8(92 116)
                                                     (if (eqv? tmp_0 '#\xb)
                                                       #vu8(92 118)
                                                       #f)))))))))))))
                            (if escaped_0
                              (let ((max-length_4
                                     (write-bytes/max
                                      escaped_0
                                      o_0
                                      max-length_3)))
                                (let ((i_1 (add1 i_0)))
                                  (let ((max-length_5 max-length_4))
                                    (loop_0 i_1 i_1 max-length_5))))
                              (let ((i_1 (add1 i_0)))
                                (let ((next-b_0
                                       (let ((or-part_0
                                              (if (< i_1 len_0)
                                                (unsafe-bytes-ref bstr_0 i_1)
                                                #f)))
                                         (if or-part_0 or-part_0 0))))
                                  (if (let ((or-part_0 (>= b_0 64)))
                                        (if or-part_0
                                          or-part_0
                                          (if (>= next-b_0 48)
                                            (<= next-b_0 55)
                                            #f)))
                                    (let ((max-length_4
                                           (write-bytes/max
                                            #vu8(92)
                                            o_0
                                            max-length_3)))
                                      (let ((max-length_5
                                             (write-bytes/max
                                              (digit (arithmetic-shift b_0 -6))
                                              o_0
                                              max-length_4)))
                                        (let ((max-length_6
                                               (write-bytes/max
                                                (digit
                                                 (bitwise-and
                                                  7
                                                  (arithmetic-shift b_0 -3)))
                                                o_0
                                                max-length_5)))
                                          (let ((max-length_7
                                                 (write-bytes/max
                                                  (digit (bitwise-and 7 b_0))
                                                  o_0
                                                  max-length_6)))
                                            (loop_0 i_1 i_1 max-length_7)))))
                                    (if (>= b_0 8)
                                      (let ((max-length_4
                                             (write-bytes/max
                                              #vu8(92)
                                              o_0
                                              max-length_3)))
                                        (let ((max-length_5
                                               (write-bytes/max
                                                (digit
                                                 (bitwise-and
                                                  7
                                                  (arithmetic-shift b_0 -3)))
                                                o_0
                                                max-length_4)))
                                          (let ((max-length_6
                                                 (write-bytes/max
                                                  (digit (bitwise-and 7 b_0))
                                                  o_0
                                                  max-length_5)))
                                            (loop_0 i_1 i_1 max-length_6))))
                                      (let ((max-length_4
                                             (write-bytes/max
                                              #vu8(92)
                                              o_0
                                              max-length_3)))
                                        (let ((max-length_5
                                               (write-bytes/max
                                                (digit b_0)
                                                o_0
                                                max-length_4)))
                                          (loop_0
                                           i_1
                                           i_1
                                           max-length_5)))))))))))))))))))
         (loop_0 0 0 max-length_1))))))
(define digit
  (lambda (v_0)
    (if (eq? v_0 0)
      #vu8(48)
      (if (eq? v_0 1)
        #vu8(49)
        (if (eq? v_0 2)
          #vu8(50)
          (if (eq? v_0 3)
            #vu8(51)
            (if (eq? v_0 4)
              #vu8(52)
              (if (eq? v_0 5)
                #vu8(53)
                (if (eq? v_0 6) #vu8(54) (if (eq? v_0 7) #vu8(55) (void)))))))))))
(define string->number? (lambda (str_0) #f))
(define set-string->number?! (lambda (proc_0) (set! string->number? proc_0)))
(define make-print-config (lambda () (make-hasheq)))
(define config-get
  (lambda (config_0 param_0)
    (hash-ref
     config_0
     param_0
     (lambda ()
       (let ((v_0 (|#%app| param_0)))
         (begin (hash-set! config_0 param_0 v_0) v_0))))))
(define print-symbol.1
  (|#%name|
   print-symbol
   (lambda (for-keyword?1_0 sym3_0 o4_0 max-length5_0 config6_0)
     (let ((str_0
            (symbol->print-string.1
             unsafe-undefined
             config6_0
             for-keyword?1_0
             #f
             sym3_0)))
       (write-string/max str_0 o4_0 max-length5_0)))))
(define symbol->print-string.1
  (|#%name|
   symbol->print-string
   (lambda (case-sensitive?10_0
            config8_0
            for-keyword?11_0
            for-type?9_0
            sym16_0)
     (let ((case-sensitive?_0
            (if (eq? case-sensitive?10_0 unsafe-undefined)
              (if config8_0 (config-get config8_0 1/read-case-sensitive) #t)
              case-sensitive?10_0)))
       (let ((str_0 (symbol->immutable-string sym16_0)))
         (let ((is-simple?_0
                (|#%name|
                 is-simple?
                 (lambda (ch_0 i_0)
                   (not
                    (let ((or-part_0 (char=? ch_0 '#\x28)))
                      (if or-part_0
                        or-part_0
                        (let ((or-part_1 (char=? ch_0 '#\x5b)))
                          (if or-part_1
                            or-part_1
                            (let ((or-part_2 (char=? ch_0 '#\x7b)))
                              (if or-part_2
                                or-part_2
                                (let ((or-part_3 (char=? ch_0 '#\x29)))
                                  (if or-part_3
                                    or-part_3
                                    (let ((or-part_4 (char=? ch_0 '#\x5d)))
                                      (if or-part_4
                                        or-part_4
                                        (let ((or-part_5 (char=? ch_0 '#\x7d)))
                                          (if or-part_5
                                            or-part_5
                                            (let ((or-part_6
                                                   (char=? ch_0 '#\x22)))
                                              (if or-part_6
                                                or-part_6
                                                (let ((or-part_7
                                                       (char=? ch_0 '#\x5c)))
                                                  (if or-part_7
                                                    or-part_7
                                                    (let ((or-part_8
                                                           (char=?
                                                            ch_0
                                                            '#\x27)))
                                                      (if or-part_8
                                                        or-part_8
                                                        (let ((or-part_9
                                                               (char=?
                                                                ch_0
                                                                '#\x2c)))
                                                          (if or-part_9
                                                            or-part_9
                                                            (let ((or-part_10
                                                                   (char=?
                                                                    ch_0
                                                                    '#\x3b)))
                                                              (if or-part_10
                                                                or-part_10
                                                                (let ((or-part_11
                                                                       (char=?
                                                                        ch_0
                                                                        '#\x60)))
                                                                  (if or-part_11
                                                                    or-part_11
                                                                    (let ((or-part_12
                                                                           (char=?
                                                                            ch_0
                                                                            '#\xfeff)))
                                                                      (if or-part_12
                                                                        or-part_12
                                                                        (let ((or-part_13
                                                                               (if (char=?
                                                                                    ch_0
                                                                                    '#\x7c)
                                                                                 (let ((or-part_13
                                                                                        (not
                                                                                         config8_0)))
                                                                                   (if or-part_13
                                                                                     or-part_13
                                                                                     (config-get
                                                                                      config8_0
                                                                                      1/read-accept-bar-quote)))
                                                                                 #f)))
                                                                          (if or-part_13
                                                                            or-part_13
                                                                            (let ((or-part_14
                                                                                   (if for-type?9_0
                                                                                     (let ((or-part_14
                                                                                            (char=?
                                                                                             ch_0
                                                                                             '#\x3c)))
                                                                                       (if or-part_14
                                                                                         or-part_14
                                                                                         (char=?
                                                                                          ch_0
                                                                                          '#\x3e)))
                                                                                     #f)))
                                                                              (if or-part_14
                                                                                or-part_14
                                                                                (let ((or-part_15
                                                                                       (if (char-whitespace?
                                                                                            ch_0)
                                                                                         (let ((or-part_15
                                                                                                (not
                                                                                                 for-type?9_0)))
                                                                                           (if or-part_15
                                                                                             or-part_15
                                                                                             (not
                                                                                              (char=?
                                                                                               ch_0
                                                                                               '#\x20))))
                                                                                         #f)))
                                                                                  (if or-part_15
                                                                                    or-part_15
                                                                                    (let ((or-part_16
                                                                                           (if (char=?
                                                                                                ch_0
                                                                                                '#\x23)
                                                                                             (if (zero?
                                                                                                  i_0)
                                                                                               (let ((or-part_16
                                                                                                      (<
                                                                                                       (string-length
                                                                                                        str_0)
                                                                                                       2)))
                                                                                                 (if or-part_16
                                                                                                   or-part_16
                                                                                                   (not
                                                                                                    (char=?
                                                                                                     (string-ref
                                                                                                      str_0
                                                                                                      1)
                                                                                                     '#\x25))))
                                                                                               #f)
                                                                                             #f)))
                                                                                      (if or-part_16
                                                                                        or-part_16
                                                                                        (let ((or-part_17
                                                                                               (if (char=?
                                                                                                    ch_0
                                                                                                    '#\x2e)
                                                                                                 (if (zero?
                                                                                                      i_0)
                                                                                                   (=
                                                                                                    (string-length
                                                                                                     str_0)
                                                                                                    1)
                                                                                                   #f)
                                                                                                 #f)))
                                                                                          (if or-part_17
                                                                                            or-part_17
                                                                                            (if (not
                                                                                                 case-sensitive?_0)
                                                                                              (not
                                                                                               (char=?
                                                                                                ch_0
                                                                                                (char-foldcase
                                                                                                 ch_0)))
                                                                                              #f))))))))))))))))))))))))))))))))))))))))))
           (if (call-with-values
                (lambda () (values str_0 (unsafe-string-length str_0)))
                (lambda (vec_0 len_0)
                  (let ((start_0 0))
                    (let ((vec_1 vec_0) (len_1 len_0))
                      (letrec*
                       ((for-loop_0
                         (|#%name|
                          for-loop
                          (lambda (result_0 pos_0 pos_1)
                            (if (if (unsafe-fx< pos_0 len_1) #t #f)
                              (let ((ch_0 (string-ref vec_1 pos_0)))
                                (let ((result_1
                                       (let ((result_1
                                              (is-simple?_0 ch_0 pos_1)))
                                         (values result_1))))
                                  (if (if (not
                                           (let ((x_0 (list ch_0)))
                                             (not result_1)))
                                        (if (not
                                             (let ((x_0 (list pos_1)))
                                               (not result_1)))
                                          #t
                                          #f)
                                        #f)
                                    (for-loop_0
                                     result_1
                                     (unsafe-fx+ 1 pos_0)
                                     (+ pos_1 1))
                                    result_1)))
                              result_0)))))
                       (for-loop_0 #t 0 start_0))))))
             (if (if for-keyword?11_0
                   for-keyword?11_0
                   (if for-type?9_0
                     for-type?9_0
                     (if (not (|#%app| string->number? str_0))
                       (not (string=? str_0 ""))
                       #f)))
               str_0
               (if (if config8_0
                     (not (config-get config8_0 1/read-accept-bar-quote))
                     #f)
                 (if (string=? str_0 "") str_0 (string-append "\\" str_0))
                 (string-append "|" str_0 "|")))
             (if (let ((or-part_0
                        (if config8_0
                          (not (config-get config8_0 1/read-accept-bar-quote))
                          #f)))
                   (if or-part_0
                     or-part_0
                     (call-with-values
                      (lambda () (values str_0 (unsafe-string-length str_0)))
                      (lambda (vec_0 len_0)
                        (letrec*
                         ((for-loop_0
                           (|#%name|
                            for-loop
                            (lambda (result_0 pos_0)
                              (if (unsafe-fx< pos_0 len_0)
                                (let ((ch_0 (string-ref vec_0 pos_0)))
                                  (let ((result_1
                                         (let ((result_1 (char=? ch_0 '#\x7c)))
                                           (values result_1))))
                                    (if (if (not
                                             (let ((x_0 (list ch_0)))
                                               result_1))
                                          #t
                                          #f)
                                      (for-loop_0
                                       result_1
                                       (unsafe-fx+ 1 pos_0))
                                      result_1)))
                                result_0)))))
                         (for-loop_0 #f 0))))))
               (let ((len_0 (string-length str_0)))
                 (apply
                  string-append
                  (letrec*
                   ((loop_0
                     (|#%name|
                      loop
                      (lambda (start_0 i_0)
                        (if (= i_0 len_0)
                          (list (substring str_0 start_0 len_0))
                          (if (is-simple?_0 (string-ref str_0 i_0) i_0)
                            (loop_0 start_0 (add1 i_0))
                            (let ((app_0 (substring str_0 start_0 i_0)))
                              (let ((app_1 (substring str_0 i_0 (add1 i_0))))
                                (list*
                                 app_0
                                 "\\"
                                 app_1
                                 (let ((app_2 (add1 i_0)))
                                   (loop_0 app_2 (add1 i_0))))))))))))
                   (loop_0 0 0))))
               (string-append "|" str_0 "|")))))))))
(define print-char
  (lambda (c_0 o_0 max-length_0)
    (let ((esc-str_0
           (if (eqv? c_0 '#\x0)
             "#\\nul"
             (if (eqv? c_0 '#\x8)
               "#\\backspace"
               (if (eqv? c_0 '#\x9)
                 "#\\tab"
                 (if (eqv? c_0 '#\xc)
                   "#\\page"
                   (if (eqv? c_0 '#\xa)
                     "#\\newline"
                     (if (eqv? c_0 '#\xd)
                       "#\\return"
                       (if (eqv? c_0 '#\xb)
                         "#\\vtab"
                         (if (eqv? c_0 '#\x20)
                           "#\\space"
                           (if (eqv? c_0 '#\x7f) "#\\rubout" #f)))))))))))
      (if esc-str_0
        (write-string/max esc-str_0 o_0 max-length_0)
        (if (char-graphic? c_0)
          (let ((max-length_1 (write-string/max "#\\" o_0 max-length_0)))
            (write-string/max (string c_0) o_0 max-length_1))
          (let ((n_0 (char->integer c_0)))
            (let ((pad_0
                   (|#%name|
                    pad
                    (lambda (n_1 s_0)
                      (let ((len_0 (string-length s_0)))
                        (if (< len_0 n_1)
                          (string-append
                           (make-string (- n_1 len_0) '#\x30)
                           s_0)
                          s_0))))))
              (if (<= n_0 65535)
                (let ((max-length_1
                       (write-string/max "#\\u" o_0 max-length_0)))
                  (write-string/max
                   (pad_0 4 (string-upcase (number->string n_0 16)))
                   o_0
                   max-length_1))
                (let ((max-length_1
                       (write-string/max "#\\U" o_0 max-length_0)))
                  (write-string/max
                   (pad_0 8 (string-upcase (number->string n_0 16)))
                   o_0
                   max-length_1))))))))))
(define DISPLAY-MODE #f)
(define WRITE-MODE #t)
(define PRINT-MODE/UNQUOTED 0)
(define PRINT-MODE/QUOTED 1)
(define print-mode?
  (lambda (mode_0)
    (let ((or-part_0 (eq? mode_0 0)))
      (if or-part_0 or-part_0 (eq? mode_0 1)))))
(define finish_2460
  (make-struct-type-install-properties
   '(nowhere-output-port)
   0
   0
   struct:core-output-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-nowhere-output-port))
(define struct:nowhere-output-port
  (make-record-type-descriptor
   'nowhere-output-port
   struct:core-output-port
   (|#%nongenerative-uid| nowhere-output-port)
   #f
   #f
   '(0 . 0)))
(define effect_2267 (finish_2460 struct:nowhere-output-port))
(define create-nowhere-output-port
  (|#%name|
   create-nowhere-output-port
   (record-constructor
    (make-record-constructor-descriptor struct:nowhere-output-port #f #f))))
(define nowhere-output-port?
  (|#%name|
   nowhere-output-port?
   (record-predicate struct:nowhere-output-port)))
(define finish_2952
  (make-struct-type-install-properties
   '(nowhere-output-port-methods)
   0
   0
   struct:core-output-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'nowhere-output-port-methods))
(define struct:nowhere-output-port-methods.1
  (make-record-type-descriptor
   'nowhere-output-port-methods
   struct:core-output-port-methods.1
   (|#%nongenerative-uid| nowhere-output-port-methods)
   #f
   #f
   '(0 . 0)))
(define effect_2301 (finish_2952 struct:nowhere-output-port-methods.1))
(define nowhere-output-port-methods1.1
  (|#%name|
   nowhere-output-port-methods
   (record-constructor
    (make-record-constructor-descriptor
     struct:nowhere-output-port-methods.1
     #f
     #f))))
(define nowhere-output-port-methods?.1_2940
  (|#%name|
   nowhere-output-port-methods?
   (record-predicate struct:nowhere-output-port-methods.1)))
(define nowhere-output-port-methods?.1
  (|#%name|
   nowhere-output-port-methods?
   (lambda (v)
     (if (nowhere-output-port-methods?.1_2940 v)
       #t
       ($value
        (if (impersonator? v)
          (nowhere-output-port-methods?.1_2940 (impersonator-val v))
          #f))))))
(define nowhere-output-port-vtable.1
  (let ((app_0 (core-port-methods-close.1 core-output-port-vtable.1)))
    (let ((app_1 (core-port-methods-count-lines!.1 core-output-port-vtable.1)))
      (let ((app_2
             (core-port-methods-get-location.1 core-output-port-vtable.1)))
        (let ((app_3
               (core-port-methods-file-position.1 core-output-port-vtable.1)))
          (let ((app_4
                 (core-port-methods-buffer-mode.1 core-output-port-vtable.1)))
            (let ((app_5
                   (core-output-port-methods-write-out.1
                    core-output-port-vtable.1)))
              (let ((app_6
                     (core-output-port-methods-get-write-evt.1
                      core-output-port-vtable.1)))
                (nowhere-output-port-methods1.1
                 app_0
                 app_1
                 app_2
                 app_3
                 app_4
                 app_5
                 (|#%name|
                  write-out-special
                  (lambda (this-id_0
                           any4_0
                           no-block/buffer?5_0
                           enable-break?6_0)
                    #t))
                 app_6
                 (core-output-port-methods-get-write-special-evt.1
                  core-output-port-vtable.1))))))))))
(define open-output-nowhere
  (lambda ()
    (finish-port/count
     (create-nowhere-output-port
      nowhere-output-port-vtable.1
      'nowhere
      (direct2.1 #f 0 0)
      #f
      #f
      0
      #f
      always-evt
      #f
      #f
      #f))))
(define set-port-handlers-to-recur!
  (lambda (port_0 handle_0)
    (begin
      (set-core-output-port-print-handler!
       port_0
       (let ((...nt/recur-handler.rkt:9:39_0
              (|#%name|
               ...nt/recur-handler.rkt:9:39
               (lambda (e2_0 p3_0 mode1_0)
                 (|#%app| handle_0 e2_0 p3_0 mode1_0)))))
         (|#%name|
          ...nt/recur-handler.rkt:9:39
          (case-lambda
           ((e_0 p_0) (...nt/recur-handler.rkt:9:39_0 e_0 p_0 0))
           ((e_0 p_0 mode1_0)
            (...nt/recur-handler.rkt:9:39_0 e_0 p_0 mode1_0))))))
      (set-core-output-port-write-handler!
       port_0
       (lambda (e_0 p_0) (|#%app| handle_0 e_0 p_0 #t)))
      (set-core-output-port-display-handler!
       port_0
       (lambda (e_0 p_0) (|#%app| handle_0 e_0 p_0 #f))))))
(define detect-graph
  (lambda (v_0 mode_0 config_0)
    (let ((print-graph?_0 (1/print-graph)))
      (if (quick-no-graph? v_0 100 mode_0 print-graph?_0 config_0)
        #f
        (let ((ht_0 (make-hasheq)))
          (build-graph v_0 ht_0 print-graph?_0 mode_0 config_0))))))
(define quick-no-graph?
  (lambda (v_0 fuel_0 mode_0 print-graph?_0 config_0)
    (letrec*
     ((quick-no-graph?_0
       (|#%name|
        quick-no-graph?
        (lambda (v_1 fuel_1)
          (if (let ((or-part_0 (not fuel_1)))
                (if or-part_0 or-part_0 (zero? fuel_1)))
            #f
            (if (pair? v_1)
              (if (not print-graph?_0)
                (let ((app_0 (cdr v_1)))
                  (quick-no-graph?_0
                   app_0
                   (let ((app_1 (car v_1)))
                     (quick-no-graph?_0 app_1 (sub1 fuel_1)))))
                #f)
              (if (vector? v_1)
                (if (not print-graph?_0)
                  (let ((fuel_2 (let ((fuel_2 (sub1 fuel_1))) fuel_2)))
                    (call-with-values
                     (lambda () (values v_1 (unsafe-vector-length v_1)))
                     (lambda (vec_0 len_0)
                       (letrec*
                        ((for-loop_0
                          (|#%name|
                           for-loop
                           (lambda (fuel_3 pos_0)
                             (if (unsafe-fx< pos_0 len_0)
                               (let ((e_0 (unsafe-vector-ref vec_0 pos_0)))
                                 (let ((next-k-proc_0
                                        (|#%name|
                                         next-k-proc
                                         (lambda (fuel_4)
                                           (for-loop_0
                                            fuel_4
                                            (unsafe-fx+ 1 pos_0))))))
                                   (if (not fuel_3)
                                     fuel_3
                                     (let ((fuel_4
                                            (quick-no-graph?_0 e_0 fuel_3)))
                                       (next-k-proc_0 fuel_4)))))
                               fuel_3)))))
                        (for-loop_0 fuel_2 0)))))
                  #f)
                (if (if (box? v_1) (config-get config_0 1/print-box) #f)
                  (if (not print-graph?_0)
                    (let ((app_0 (unbox v_1)))
                      (quick-no-graph?_0 app_0 (sub1 fuel_1)))
                    #f)
                  (if (if (hash? v_1)
                        (if (not (hash-weak? v_1))
                          (config-get config_0 1/print-hash-table)
                          #f)
                        #f)
                    (if (not print-graph?_0)
                      (let ((fuel_2 (let ((fuel_2 (sub1 fuel_1))) fuel_2)))
                        (letrec*
                         ((for-loop_0
                           (|#%name|
                            for-loop
                            (lambda (fuel_3 i_0)
                              (if i_0
                                (let ((k_0 (hash-iterate-key v_1 i_0 #f)))
                                  (let ((next-k-proc_0
                                         (|#%name|
                                          next-k-proc
                                          (lambda (fuel_4)
                                            (for-loop_0
                                             fuel_4
                                             (hash-iterate-next v_1 i_0))))))
                                    (if (not fuel_3)
                                      fuel_3
                                      (let ((fuel_4
                                             (let ((val_0
                                                    (hash-ref v_1 k_0 #f)))
                                               (quick-no-graph?_0
                                                val_0
                                                (quick-no-graph?_0
                                                 k_0
                                                 fuel_3)))))
                                        (next-k-proc_0 fuel_4)))))
                                fuel_3)))))
                         (for-loop_0 fuel_2 (hash-iterate-first v_1))))
                      #f)
                    (if (stencil-vector? v_1)
                      (if (not print-graph?_0)
                        (letrec*
                         ((loop_0
                           (|#%name|
                            loop
                            (lambda (fuel_2 i_0)
                              (if (not fuel_2)
                                #f
                                (if (= i_0 (stencil-vector-length v_1))
                                  fuel_2
                                  (let ((app_0
                                         (quick-no-graph?_0
                                          (stencil-vector-ref v_1 i_0)
                                          fuel_2)))
                                    (loop_0 app_0 (add1 i_0)))))))))
                         (loop_0 (sub1 fuel_1) 0))
                        #f)
                      (if (mpair? v_1)
                        (if (not print-graph?_0)
                          (if (not (eq? mode_0 0))
                            (let ((app_0 (unsafe-mcdr v_1)))
                              (quick-no-graph?_0
                               app_0
                               (let ((app_1 (unsafe-mcar v_1)))
                                 (quick-no-graph?_0 app_1 (sub1 fuel_1)))))
                            #f)
                          #f)
                        (if (if (1/custom-write? v_1)
                              (not (struct-type? v_1))
                              #f)
                          #f
                          (if (if (struct? v_1)
                                (config-get config_0 1/print-struct)
                                #f)
                            (if (not print-graph?_0)
                              (if (prefab-struct-key v_1)
                                (let ((app_0 (struct->vector v_1)))
                                  (quick-no-graph?_0 app_0 (sub1 fuel_1)))
                                #f)
                              #f)
                            fuel_1)))))))))))))
     (quick-no-graph?_0 v_0 fuel_0))))
(define finish_2175
  (make-struct-type-install-properties
   '(as-constructor)
   1
   0
   #f
   null
   (current-inspector)
   #f
   '(0)
   #f
   'as-constructor))
(define struct:as-constructor
  (make-record-type-descriptor
   'as-constructor
   #f
   (|#%nongenerative-uid| as-constructor)
   #f
   #f
   '(1 . 0)))
(define effect_2645 (finish_2175 struct:as-constructor))
(define as-constructor1.1
  (|#%name|
   as-constructor
   (record-constructor
    (make-record-constructor-descriptor struct:as-constructor #f #f))))
(define as-constructor?_2888
  (|#%name| as-constructor? (record-predicate struct:as-constructor)))
(define as-constructor?
  (|#%name|
   as-constructor?
   (lambda (v)
     (if (as-constructor?_2888 v)
       #t
       ($value
        (if (impersonator? v)
          (as-constructor?_2888 (impersonator-val v))
          #f))))))
(define as-constructor-tag_2351
  (|#%name| as-constructor-tag (record-accessor struct:as-constructor 0)))
(define as-constructor-tag
  (|#%name|
   as-constructor-tag
   (lambda (s)
     (if (as-constructor?_2888 s)
       (as-constructor-tag_2351 s)
       ($value
        (impersonate-ref
         as-constructor-tag_2351
         struct:as-constructor
         0
         s
         'tag))))))
(define build-graph
  (lambda (v_0 ht_0 print-graph?_0 mode_0 config_0)
    (let ((counter_0 0))
      (let ((cycle?_0 #f))
        (let ((constructor?_0 #f))
          (let ((checking-port_0 #f))
            (let ((checking!_0
                   (|#%name|
                    checking!
                    (lambda (v_1) (hash-set! ht_0 v_1 'checking)))))
              (let ((done!_0
                     (|#%name|
                      done!
                      (lambda (v_1 unquoted?_0)
                        (begin
                          (if (eq? 'checking (hash-ref ht_0 v_1 #f))
                            (hash-set! ht_0 v_1 'checked)
                            (void))
                          (if unquoted?_0
                            (let ((c_0 (hash-ref ht_0 v_1 #f)))
                              (begin
                                (hash-set!
                                 ht_0
                                 v_1
                                 (as-constructor1.1
                                  (if (integer? c_0) c_0 #f)))
                                (set! constructor?_0 #t)))
                            (void))
                          unquoted?_0)))))
                (begin
                  (letrec*
                   ((build-graph_0
                     (|#%name|
                      build-graph
                      (lambda (v_1 mode_1)
                        (if (not v_1)
                          #f
                          (let ((c1_0 (hash-ref ht_0 v_1 #f)))
                            (if c1_0
                              (begin
                                (if (let ((or-part_0 (eq? c1_0 'checking)))
                                      (if or-part_0
                                        or-part_0
                                        (let ((or-part_1 (eq? c1_0 'checked)))
                                          (if or-part_1
                                            or-part_1
                                            (if (as-constructor? c1_0)
                                              (not (as-constructor-tag c1_0))
                                              #f)))))
                                  (begin
                                    (hash-set!
                                     ht_0
                                     v_1
                                     (if (as-constructor? c1_0)
                                       (as-constructor1.1 counter_0)
                                       counter_0))
                                    (set! counter_0 (add1 counter_0))
                                    (if (eq? c1_0 'checking)
                                      (set! cycle?_0 #t)
                                      (void)))
                                  (void))
                                (as-constructor? c1_0))
                              (if (pair? v_1)
                                (begin
                                  (checking!_0 v_1)
                                  (let ((car-unquoted?_0
                                         (build-graph_0 (car v_1) mode_1)))
                                    (let ((unquoted?_0
                                           (let ((or-part_0
                                                  (build-graph_0
                                                   (cdr v_1)
                                                   mode_1)))
                                             (if or-part_0
                                               or-part_0
                                               car-unquoted?_0))))
                                      (done!_0 v_1 unquoted?_0))))
                                (if (vector? v_1)
                                  (begin
                                    (checking!_0 v_1)
                                    (let ((unquoted?_0
                                           (call-with-values
                                            (lambda ()
                                              (values
                                               v_1
                                               (unsafe-vector-length v_1)))
                                            (lambda (vec_0 len_0)
                                              (letrec*
                                               ((for-loop_0
                                                 (|#%name|
                                                  for-loop
                                                  (lambda (unquoted?_0 pos_0)
                                                    (if (unsafe-fx<
                                                         pos_0
                                                         len_0)
                                                      (let ((e_0
                                                             (unsafe-vector-ref
                                                              vec_0
                                                              pos_0)))
                                                        (let ((unquoted?_1
                                                               (let ((unquoted?_1
                                                                      (let ((or-part_0
                                                                             (build-graph_0
                                                                              e_0
                                                                              mode_1)))
                                                                        (if or-part_0
                                                                          or-part_0
                                                                          unquoted?_0))))
                                                                 (values
                                                                  unquoted?_1))))
                                                          (for-loop_0
                                                           unquoted?_1
                                                           (unsafe-fx+
                                                            1
                                                            pos_0))))
                                                      unquoted?_0)))))
                                               (for-loop_0 #f 0))))))
                                      (done!_0 v_1 unquoted?_0)))
                                  (if (if (box? v_1)
                                        (config-get config_0 1/print-box)
                                        #f)
                                    (begin
                                      (checking!_0 v_1)
                                      (let ((unquoted?_0
                                             (build-graph_0
                                              (unbox v_1)
                                              mode_1)))
                                        (done!_0 v_1 unquoted?_0)))
                                    (if (if (hash? v_1)
                                          (if (not (hash-weak? v_1))
                                            (config-get
                                             config_0
                                             1/print-hash-table)
                                            #f)
                                          #f)
                                      (begin
                                        (checking!_0 v_1)
                                        (let ((unquoted?_0
                                               (letrec*
                                                ((for-loop_0
                                                  (|#%name|
                                                   for-loop
                                                   (lambda (unquoted?_0 i_0)
                                                     (if i_0
                                                       (let ((k_0
                                                              (hash-iterate-key
                                                               v_1
                                                               i_0)))
                                                         (let ((unquoted?_1
                                                                (let ((unquoted?_1
                                                                       (let ((val_0
                                                                              (hash-ref
                                                                               v_1
                                                                               k_0
                                                                               #f)))
                                                                         (let ((k-unquoted?_0
                                                                                (build-graph_0
                                                                                 k_0
                                                                                 mode_1)))
                                                                           (let ((or-part_0
                                                                                  (build-graph_0
                                                                                   val_0
                                                                                   mode_1)))
                                                                             (if or-part_0
                                                                               or-part_0
                                                                               (if k-unquoted?_0
                                                                                 k-unquoted?_0
                                                                                 unquoted?_0)))))))
                                                                  (values
                                                                   unquoted?_1))))
                                                           (for-loop_0
                                                            unquoted?_1
                                                            (hash-iterate-next
                                                             v_1
                                                             i_0))))
                                                       unquoted?_0)))))
                                                (for-loop_0
                                                 #f
                                                 (hash-iterate-first v_1)))))
                                          (done!_0 v_1 unquoted?_0)))
                                      (if (stencil-vector? v_1)
                                        (begin
                                          (checking!_0 v_1)
                                          (letrec*
                                           ((loop_0
                                             (|#%name|
                                              loop
                                              (lambda (i_0)
                                                (if (=
                                                     i_0
                                                     (stencil-vector-length
                                                      v_1))
                                                  (void)
                                                  (begin
                                                    (build-graph_0
                                                     (stencil-vector-ref
                                                      v_1
                                                      i_0)
                                                     (if (eq? mode_1 #f)
                                                       #f
                                                       #t))
                                                    (loop_0 (add1 i_0))))))))
                                           (loop_0 0))
                                          (done!_0 v_1 #f))
                                        (if (mpair? v_1)
                                          (begin
                                            (checking!_0 v_1)
                                            (build-graph_0
                                             (unsafe-mcar v_1)
                                             mode_1)
                                            (build-graph_0
                                             (unsafe-mcdr v_1)
                                             mode_1)
                                            (done!_0 v_1 (eq? mode_1 0)))
                                          (if (if (1/custom-write? v_1)
                                                (not (struct-type? v_1))
                                                #f)
                                            (let ((print-quotable_0
                                                   (if (eq? mode_1 0)
                                                     (1/custom-print-quotable-accessor
                                                      v_1
                                                      'self)
                                                     'self)))
                                              (let ((unquoted?_0
                                                     (eq?
                                                      print-quotable_0
                                                      'never)))
                                                (begin
                                                  (if checking-port_0
                                                    (void)
                                                    (begin
                                                      (set! checking-port_0
                                                        (open-output-nowhere))
                                                      (set-port-handlers-to-recur!
                                                       checking-port_0
                                                       (lambda (e_0 p_0 mode_2)
                                                         (if (let ((or-part_0
                                                                    (eq?
                                                                     mode_2
                                                                     1)))
                                                               (if or-part_0
                                                                 or-part_0
                                                                 (eq?
                                                                  mode_2
                                                                  0)))
                                                           (let ((e-unquoted?_0
                                                                  (build-graph_0
                                                                   e_0
                                                                   mode_2)))
                                                             (if (let ((or-part_0
                                                                        (eq?
                                                                         print-quotable_0
                                                                         'always)))
                                                                   (if or-part_0
                                                                     or-part_0
                                                                     (eq?
                                                                      print-quotable_0
                                                                      'self)))
                                                               (void)
                                                               (set! unquoted?_0
                                                                 (if e-unquoted?_0
                                                                   e-unquoted?_0
                                                                   unquoted?_0))))
                                                           (build-graph_0
                                                            e_0
                                                            mode_2))))))
                                                  (checking!_0 v_1)
                                                  (let ((app_0
                                                         (1/custom-write-accessor
                                                          v_1)))
                                                    (|#%app|
                                                     app_0
                                                     v_1
                                                     checking-port_0
                                                     (if (if (eq? mode_1 0)
                                                           (eq?
                                                            print-quotable_0
                                                            'always)
                                                           #f)
                                                       1
                                                       mode_1)))
                                                  (done!_0 v_1 unquoted?_0))))
                                            (if (if (struct? v_1)
                                                  (config-get
                                                   config_0
                                                   1/print-struct)
                                                  #f)
                                              (begin
                                                (checking!_0 v_1)
                                                (let ((unquoted?_0
                                                       (let ((or-part_0
                                                              (call-with-values
                                                               (lambda ()
                                                                 (let ((vec_0
                                                                        (struct->vector
                                                                         v_1)))
                                                                   (values
                                                                    vec_0
                                                                    (unsafe-vector-length
                                                                     vec_0))))
                                                               (lambda (vec_0
                                                                        len_0)
                                                                 (letrec*
                                                                  ((for-loop_0
                                                                    (|#%name|
                                                                     for-loop
                                                                     (lambda (unquoted?_0
                                                                              pos_0)
                                                                       (if (unsafe-fx<
                                                                            pos_0
                                                                            len_0)
                                                                         (let ((e_0
                                                                                (unsafe-vector-ref
                                                                                 vec_0
                                                                                 pos_0)))
                                                                           (let ((unquoted?_1
                                                                                  (let ((unquoted?_1
                                                                                         (let ((or-part_0
                                                                                                (build-graph_0
                                                                                                 e_0
                                                                                                 mode_1)))
                                                                                           (if or-part_0
                                                                                             or-part_0
                                                                                             unquoted?_0))))
                                                                                    (values
                                                                                     unquoted?_1))))
                                                                             (for-loop_0
                                                                              unquoted?_1
                                                                              (unsafe-fx+
                                                                               1
                                                                               pos_0))))
                                                                         unquoted?_0)))))
                                                                  (for-loop_0
                                                                   #f
                                                                   0))))))
                                                         (if or-part_0
                                                           or-part_0
                                                           (if (eq? mode_1 0)
                                                             (not
                                                              (prefab-struct-key
                                                               v_1))
                                                             #f)))))
                                                  (done!_0 v_1 unquoted?_0)))
                                              #f)))))))))))))))
                   (build-graph_0 v_0 mode_0))
                  (if (if (not cycle?_0)
                        (if (not constructor?_0) (not print-graph?_0) #f)
                        #f)
                    #f
                    (if (if (not cycle?_0) (not print-graph?_0) #f)
                      (begin
                        (let ((lst_0 (hash-keys ht_0)))
                          (letrec*
                           ((for-loop_0
                             (|#%name|
                              for-loop
                              (lambda (lst_1)
                                (if (pair? lst_1)
                                  (let ((k_0 (unsafe-car lst_1)))
                                    (let ((rest_0 (unsafe-cdr lst_1)))
                                      (begin
                                        (let ((v_1 (hash-ref ht_0 k_0)))
                                          (if (not (as-constructor? v_1))
                                            (hash-remove! ht_0 k_0)
                                            (if (as-constructor-tag v_1)
                                              (hash-set!
                                               ht_0
                                               k_0
                                               (as-constructor1.1 #f))
                                              (void))))
                                        (for-loop_0 rest_0))))
                                  (values))))))
                           (for-loop_0 lst_0)))
                        (void)
                        ht_0)
                      (begin
                        (let ((lst_0 (hash-keys ht_0)))
                          (letrec*
                           ((for-loop_0
                             (|#%name|
                              for-loop
                              (lambda (lst_1)
                                (if (pair? lst_1)
                                  (let ((k_0 (unsafe-car lst_1)))
                                    (let ((rest_0 (unsafe-cdr lst_1)))
                                      (begin
                                        (if (eq? 'checked (hash-ref ht_0 k_0))
                                          (hash-remove! ht_0 k_0)
                                          (void))
                                        (for-loop_0 rest_0))))
                                  (values))))))
                           (for-loop_0 lst_0)))
                        (void)
                        ht_0))))))))))))
(define print-list
  (let ((print-list_0
         (|#%name|
          print-list
          (lambda (p2_0
                   who3_0
                   v4_0
                   mode5_0
                   o6_0
                   max-length7_0
                   graph8_0
                   config9_0
                   alt-list-prefix10_0
                   alt-list-constructor11_0
                   alt-closer1_0)
            (let ((unquoted-pairs?_0
                   (if (eq? mode5_0 0)
                     (if (not alt-list-constructor11_0)
                       (not (uninterrupted-list? v4_0 graph8_0))
                       #f)
                     #f)))
              (let ((curly?_0
                     (if (not (eq? mode5_0 0))
                       (if (not alt-list-prefix10_0)
                         (config-get config9_0 1/print-pair-curly-braces)
                         #f)
                       #f)))
                (let ((abbreviation_0
                       (|#%name|
                        abbreviation
                        (lambda (v_0)
                          (if (not (eq? mode5_0 #f))
                            (if (pair? v_0)
                              (if (pair? (cdr v_0))
                                (if (null? (cddr v_0))
                                  (if (not alt-list-constructor11_0)
                                    (if (let ((or-part_0
                                               (not (eq? mode5_0 #t))))
                                          (if or-part_0
                                            or-part_0
                                            (config-get
                                             config9_0
                                             1/print-reader-abbreviations)))
                                      (let ((starts-@?_0
                                             (|#%name|
                                              starts-@?
                                              (lambda (v_1)
                                                (if (symbol? v_1)
                                                  (let ((s_0
                                                         (symbol->print-string.1
                                                          unsafe-undefined
                                                          config9_0
                                                          #f
                                                          #f
                                                          v_1)))
                                                    (char=?
                                                     '#\x40
                                                     (string-ref s_0 0)))
                                                  #f)))))
                                        (let ((tmp_0 (car v_0)))
                                          (if (eq? tmp_0 'quote)
                                            "'"
                                            (if (eq? tmp_0 'quasiquote)
                                              "`"
                                              (if (eq? tmp_0 'unquote)
                                                (if (starts-@?_0 (cadr v_0))
                                                  ", "
                                                  ",")
                                                (if (eq?
                                                     tmp_0
                                                     'unquote-splicing)
                                                  ",@"
                                                  (if (eq? tmp_0 'syntax)
                                                    "#'"
                                                    (if (eq?
                                                         tmp_0
                                                         'quasisyntax)
                                                      "#`"
                                                      (if (eq? tmp_0 'unsyntax)
                                                        (if (starts-@?_0
                                                             (cadr v_0))
                                                          "#, "
                                                          "#,")
                                                        (if (eq?
                                                             tmp_0
                                                             'unsyntax-splicing)
                                                          "#,@"
                                                          #f))))))))))
                                      #f)
                                    #f)
                                  #f)
                                #f)
                              #f)
                            #f)))))
                  (let ((c1_0 (abbreviation_0 v4_0)))
                    (if c1_0
                      (let ((app_0 (cadr v4_0)))
                        (|#%app|
                         p2_0
                         who3_0
                         app_0
                         mode5_0
                         o6_0
                         (write-string/max c1_0 o6_0 max-length7_0)
                         graph8_0
                         config9_0))
                      (let ((max-length_0
                             (if (eq? mode5_0 0)
                               (let ((max-length_0
                                      (if unquoted-pairs?_0
                                        (if (multiple-pairs? v4_0 graph8_0)
                                          (write-string/max
                                           "(list*"
                                           o6_0
                                           max-length7_0)
                                          (write-string/max
                                           "(cons"
                                           o6_0
                                           max-length7_0))
                                        (write-string/max
                                         (if alt-list-constructor11_0
                                           alt-list-constructor11_0
                                           "(list")
                                         o6_0
                                         max-length7_0))))
                                 (if (null? v4_0)
                                   max-length_0
                                   (write-string/max " " o6_0 max-length_0)))
                               (write-string/max
                                (if alt-list-prefix10_0
                                  alt-list-prefix10_0
                                  (if curly?_0 "{" "("))
                                o6_0
                                max-length7_0))))
                        (letrec*
                         ((loop_0
                           (|#%name|
                            loop
                            (lambda (v_0 max-length_1)
                              (if (eq? max-length_1 'full)
                                'full
                                (if (null? v_0)
                                  (write-string/max
                                   (if alt-closer1_0
                                     alt-closer1_0
                                     (if curly?_0 "}" ")"))
                                   o6_0
                                   max-length_1)
                                  (if (if (null? (cdr v_0))
                                        (not unquoted-pairs?_0)
                                        #f)
                                    (let ((max-length_2
                                           (|#%app|
                                            p2_0
                                            who3_0
                                            (car v_0)
                                            mode5_0
                                            o6_0
                                            max-length_1
                                            graph8_0
                                            config9_0)))
                                      (write-string/max
                                       (if alt-closer1_0
                                         alt-closer1_0
                                         (if curly?_0 "}" ")"))
                                       o6_0
                                       max-length_2))
                                    (if (if (pair? (cdr v_0))
                                          (if (let ((or-part_0 (not graph8_0)))
                                                (if or-part_0
                                                  or-part_0
                                                  (non-graph?
                                                   (hash-ref
                                                    graph8_0
                                                    (cdr v_0)
                                                    #f))))
                                            (not (abbreviation_0 (cdr v_0)))
                                            #f)
                                          #f)
                                      (let ((max-length_2
                                             (|#%app|
                                              p2_0
                                              who3_0
                                              (car v_0)
                                              mode5_0
                                              o6_0
                                              max-length_1
                                              graph8_0
                                              config9_0)))
                                        (let ((app_0 (cdr v_0)))
                                          (loop_0
                                           app_0
                                           (write-string/max
                                            " "
                                            o6_0
                                            max-length_2))))
                                      (let ((c2_0 (abbreviation_0 v_0)))
                                        (if c2_0
                                          (let ((app_0 (cadr v_0)))
                                            (|#%app|
                                             p2_0
                                             who3_0
                                             app_0
                                             mode5_0
                                             o6_0
                                             (write-string/max
                                              c2_0
                                              o6_0
                                              max-length_1)
                                             graph8_0
                                             config9_0))
                                          (let ((max-length_2
                                                 (|#%app|
                                                  p2_0
                                                  who3_0
                                                  (car v_0)
                                                  mode5_0
                                                  o6_0
                                                  max-length_1
                                                  graph8_0
                                                  config9_0)))
                                            (let ((max-length_3
                                                   (if unquoted-pairs?_0
                                                     (write-string/max
                                                      " "
                                                      o6_0
                                                      max-length_2)
                                                     (write-string/max
                                                      " . "
                                                      o6_0
                                                      max-length_2))))
                                              (let ((max-length_4
                                                     (|#%app|
                                                      p2_0
                                                      who3_0
                                                      (cdr v_0)
                                                      mode5_0
                                                      o6_0
                                                      max-length_3
                                                      graph8_0
                                                      config9_0)))
                                                (write-string/max
                                                 (if alt-closer1_0
                                                   alt-closer1_0
                                                   (if curly?_0 "}" ")"))
                                                 o6_0
                                                 max-length_4))))))))))))))
                         (loop_0 v4_0 max-length_0))))))))))))
    (case-lambda
     ((p_0
       who_0
       v_0
       mode_0
       o_0
       max-length_0
       graph_0
       config_0
       alt-list-prefix_0
       alt-list-constructor_0)
      (print-list_0
       p_0
       who_0
       v_0
       mode_0
       o_0
       max-length_0
       graph_0
       config_0
       alt-list-prefix_0
       alt-list-constructor_0
       #f))
     ((p_0
       who_0
       v_0
       mode_0
       o_0
       max-length_0
       graph_0
       config_0
       alt-list-prefix_0
       alt-list-constructor_0
       alt-closer1_0)
      (print-list_0
       p_0
       who_0
       v_0
       mode_0
       o_0
       max-length_0
       graph_0
       config_0
       alt-list-prefix_0
       alt-list-constructor_0
       alt-closer1_0)))))
(define uninterrupted-list?
  (lambda (v_0 graph_0)
    (if (list? v_0)
      (letrec*
       ((loop_0
         (|#%name|
          loop
          (lambda (v_1)
            (if (null? v_1)
              #t
              (if (non-graph? (hash-ref graph_0 v_1 #f))
                (loop_0 (cdr v_1))
                #f))))))
       (loop_0 (cdr v_0)))
      #f)))
(define multiple-pairs?
  (lambda (v_0 graph_0)
    (let ((d_0 (cdr v_0)))
      (if (pair? d_0) (non-graph? (hash-ref graph_0 d_0 #f)) #f))))
(define non-graph?
  (lambda (g_0)
    (let ((or-part_0 (not g_0)))
      (if or-part_0
        or-part_0
        (if (as-constructor? g_0) (not (as-constructor-tag g_0)) #f)))))
(define print-mlist
  (lambda (p_0 who_0 v_0 mode_0 o_0 max-length_0 graph_0 config_0)
    (let ((unquoted?_0 (eq? mode_0 0)))
      (let ((curly?_0
             (if (not unquoted?_0)
               (config-get config_0 1/print-mpair-curly-braces)
               #f)))
        (let ((max-length_1
               (if unquoted?_0
                 (write-string/max "(mcons " o_0 max-length_0)
                 (write-string/max (if curly?_0 "{" "(") o_0 max-length_0))))
          (letrec*
           ((loop_0
             (|#%name|
              loop
              (lambda (v_1 max-length_2)
                (if (eq? max-length_2 'full)
                  'full
                  (if (if (null? (unsafe-mcdr v_1)) (not unquoted?_0) #f)
                    (let ((max-length_3
                           (|#%app|
                            p_0
                            who_0
                            (unsafe-mcar v_1)
                            mode_0
                            o_0
                            max-length_2
                            graph_0
                            config_0)))
                      (write-string/max
                       (if curly?_0 "}" ")")
                       o_0
                       max-length_3))
                    (if (if (mpair? (unsafe-mcdr v_1))
                          (if (let ((or-part_0 (not graph_0)))
                                (if or-part_0
                                  or-part_0
                                  (not
                                   (hash-ref graph_0 (unsafe-mcdr v_1) #f))))
                            (not unquoted?_0)
                            #f)
                          #f)
                      (let ((max-length_3
                             (|#%app|
                              p_0
                              who_0
                              (unsafe-mcar v_1)
                              mode_0
                              o_0
                              max-length_2
                              graph_0
                              config_0)))
                        (let ((app_0 (unsafe-mcdr v_1)))
                          (loop_0
                           app_0
                           (write-string/max " " o_0 max-length_3))))
                      (let ((max-length_3
                             (|#%app|
                              p_0
                              who_0
                              (unsafe-mcar v_1)
                              mode_0
                              o_0
                              max-length_2
                              graph_0
                              config_0)))
                        (let ((max-length_4
                               (if unquoted?_0
                                 (write-string/max " " o_0 max-length_3)
                                 (write-string/max " . " o_0 max-length_3))))
                          (let ((max-length_5
                                 (|#%app|
                                  p_0
                                  who_0
                                  (unsafe-mcdr v_1)
                                  mode_0
                                  o_0
                                  max-length_4
                                  graph_0
                                  config_0)))
                            (write-string/max
                             (if curly?_0 "}" ")")
                             o_0
                             max-length_5)))))))))))
           (loop_0 v_0 max-length_1)))))))
(define print-vector
  (lambda (p_0
           who_0
           v_0
           mode_0
           o_0
           max-length_0
           graph_0
           config_0
           fx/l-prefix_0
           v-length_0
           v-ref_0
           equ?_0)
    (let ((v->list_0
           (|#%name|
            v->list
            (lambda (v_1 len_0)
              (if (zero? len_0)
                '()
                (letrec*
                 ((loop_0
                   (|#%name|
                    loop
                    (lambda (i_0 accum_0)
                      (let ((val_0 (|#%app| v-ref_0 v_1 i_0)))
                        (if (zero? i_0)
                          (cons val_0 accum_0)
                          (let ((app_0 (sub1 i_0)))
                            (loop_0 app_0 (cons val_0 accum_0)))))))))
                 (loop_0 (sub1 len_0) '())))))))
      (let ((cns_0 (string-append "(" fx/l-prefix_0 "vector")))
        (if (if (not (eq? mode_0 0))
              (if (not (eq? mode_0 #f))
                (config-get config_0 1/print-vector-length)
                #f)
              #f)
          (let ((len_0 (|#%app| v-length_0 v_0)))
            (let ((same-n_0
                   (if (<= len_0 1)
                     0
                     (let ((last_0 (|#%app| v-ref_0 v_0 (sub1 len_0))))
                       (letrec*
                        ((loop_0
                          (|#%name|
                           loop
                           (lambda (i_0 accum_0)
                             (if (< i_0 0)
                               accum_0
                               (if (|#%app|
                                    equ?_0
                                    (|#%app| v-ref_0 v_0 i_0)
                                    last_0)
                                 (let ((app_0 (sub1 i_0)))
                                   (loop_0 app_0 (add1 accum_0)))
                                 accum_0))))))
                        (loop_0 (- len_0 2) 0))))))
              (let ((lst_0 (v->list_0 v_0 (- len_0 same-n_0))))
                (let ((lbl_0
                       (string-append
                        "#"
                        fx/l-prefix_0
                        (number->string len_0)
                        "(")))
                  (print-list
                   p_0
                   who_0
                   lst_0
                   mode_0
                   o_0
                   max-length_0
                   graph_0
                   config_0
                   lbl_0
                   cns_0)))))
          (let ((lbl_0 (string-append "#" fx/l-prefix_0 "(")))
            (print-list
             p_0
             who_0
             (v->list_0 v_0 (|#%app| v-length_0 v_0))
             mode_0
             o_0
             max-length_0
             graph_0
             config_0
             lbl_0
             cns_0)))))))
(define print-hash
  (lambda (v_0 o_0 max-length_0 p_0 who_0 mode_0 graph_0 config_0)
    (let ((tag_0
           (if (hash-eq? v_0)
             "#hasheq("
             (if (hash-eqv? v_0)
               "#hasheqv("
               (if (hash-equal-always? v_0) "#hashalw(" "#hash(")))))
      (let ((keys_0 (try-sort (hash-keys v_0))))
        (letrec*
         ((loop_0
           (|#%name|
            loop
            (lambda (keys_1 max-length_1 first?_0)
              (if (eq? max-length_1 'full)
                'full
                (if (null? keys_1)
                  (write-string/max ")" o_0 max-length_1)
                  (let ((key_0 (car keys_1)))
                    (let ((val_0 (hash-ref v_0 key_0 none$2)))
                      (if (eq? val_0 none$2)
                        (loop_0 (cdr keys_1) max-length_1 first?_0)
                        (let ((max-length_2
                               (write-string/max
                                (if first?_0 "(" " (")
                                o_0
                                max-length_1)))
                          (let ((max-length_3
                                 (|#%app|
                                  p_0
                                  who_0
                                  key_0
                                  mode_0
                                  o_0
                                  max-length_2
                                  graph_0
                                  config_0)))
                            (let ((max-length_4
                                   (write-string/max " . " o_0 max-length_3)))
                              (let ((max-length_5
                                     (|#%app|
                                      p_0
                                      who_0
                                      val_0
                                      mode_0
                                      o_0
                                      max-length_4
                                      graph_0
                                      config_0)))
                                (let ((app_0 (cdr keys_1)))
                                  (loop_0
                                   app_0
                                   (write-string/max ")" o_0 max-length_5)
                                   #f)))))))))))))))
         (loop_0 keys_0 (write-string/max tag_0 o_0 max-length_0) #t))))))
(define none$2 (gensym 'none))
(define try-sort
  (lambda (keys_0)
    (if (null? keys_0)
      null
      (if (real? (car keys_0))
        (if (andmap_2814 real? (cdr keys_0)) (sort.1 #f #f keys_0 <) keys_0)
        (if (symbol? (car keys_0))
          (if (andmap_2814 symbol? (cdr keys_0))
            (sort.1 #f #f keys_0 symbol<?)
            keys_0)
          (if (keyword? (car keys_0))
            (if (andmap_2814 keyword? (cdr keys_0))
              (sort.1 #f #f keys_0 keyword<?)
              keys_0)
            (if (string? (car keys_0))
              (if (andmap_2814 string? (cdr keys_0))
                (sort.1 #f #f keys_0 string<?)
                keys_0)
              (if (bytes? (car keys_0))
                (if (andmap_2814 bytes? (cdr keys_0))
                  (sort.1 #f #f keys_0 bytes<?)
                  keys_0)
                keys_0))))))))
(define 1/string->path
  (|#%name|
   string->path
   (lambda (s_0)
     (begin
       (if (string? s_0)
         (void)
         (raise-argument-error 'string->path "string?" s_0))
       (check-path-string 'string->path s_0)
       (string->path$1 s_0)))))
(define 1/path->string
  (|#%name|
   path->string
   (lambda (p_0)
     (begin
       (if (is-path? p_0)
         (void)
         (raise-argument-error 'path->string "path?" p_0))
       (1/bytes->string/locale (path-bytes p_0) '#\xfffd)))))
(define print-named
  (lambda (what_0 v_0 mode_0 o_0 max-length_0)
    (let ((name_0 (object-name v_0)))
      (let ((max-length_1 (write-string/max "#<" o_0 max-length_0)))
        (let ((max-length_2 (write-string/max what_0 o_0 max-length_1)))
          (let ((name-str_0
                 (if (symbol? name_0)
                   (symbol->string name_0)
                   (if (1/path? name_0)
                     (1/path->string name_0)
                     (if (string? name_0) name_0 #f)))))
            (if name-str_0
              (let ((max-length_3 (write-string/max ":" o_0 max-length_2)))
                (let ((max-length_4
                       (write-string/max name-str_0 o_0 max-length_3)))
                  (write-string/max ">" o_0 max-length_4)))
              (write-string/max ">" o_0 max-length_2))))))))
(define printable-regexp? (lambda (v_0) #f))
(define set-printable-regexp?!
  (lambda (proc_0) (set! printable-regexp? proc_0)))
(define 1/display
  (let ((display_0
         (|#%name|
          display
          (lambda (v2_0 o1_0)
            (let ((o_0
                   (if (eq? o1_0 unsafe-undefined)
                     (1/current-output-port)
                     o1_0)))
              (display-via-handler 'display v2_0 o_0))))))
    (|#%name|
     display
     (case-lambda
      ((v_0) (display_0 v_0 unsafe-undefined))
      ((v_0 o1_0) (display_0 v_0 o1_0))))))
(define display-via-handler
  (lambda (who_0 v_0 o_0)
    (let ((co_0 (->core-output-port.1 unsafe-undefined o_0 who_0)))
      (let ((display-handler_0 (core-output-port-display-handler co_0)))
        (begin
          (if display-handler_0
            (|#%app| display-handler_0 v_0 o_0)
            (do-display who_0 v_0 co_0))
          (void))))))
(define do-display
  (let ((do-display_0
         (|#%name|
          do-display
          (lambda (who4_0 v5_0 o6_0 max-length3_0)
            (if (if (bytes? v5_0) (not max-length3_0) #f)
              (begin
                (do-write-bytes who4_0 o6_0 v5_0 0 (unsafe-bytes-length v5_0))
                (void))
              (if (if (string? v5_0) (not max-length3_0) #f)
                (begin (1/write-string v5_0 o6_0) (void))
                (let ((config_0 (make-hasheq)))
                  (begin
                    (dots
                     (let ((app_0 (sub3 max-length3_0)))
                       (p
                        who4_0
                        v5_0
                        #f
                        o6_0
                        app_0
                        (detect-graph v5_0 #f config_0)
                        config_0))
                     o6_0)
                    (void)))))))))
    (case-lambda
     ((who_0 v_0 o_0) (do-display_0 who_0 v_0 o_0 #f))
     ((who_0 v_0 o_0 max-length3_0)
      (do-display_0 who_0 v_0 o_0 max-length3_0)))))
(define 1/write
  (let ((write_0
         (|#%name|
          write
          (lambda (v8_0 o7_0)
            (let ((o_0
                   (if (eq? o7_0 unsafe-undefined)
                     (1/current-output-port)
                     o7_0)))
              (write-via-handler 'write v8_0 o_0))))))
    (|#%name|
     write
     (case-lambda
      ((v_0) (write_0 v_0 unsafe-undefined))
      ((v_0 o7_0) (write_0 v_0 o7_0))))))
(define write-via-handler
  (lambda (who_0 v_0 o_0)
    (let ((co_0 (->core-output-port.1 unsafe-undefined o_0 who_0)))
      (let ((write-handler_0 (core-output-port-write-handler co_0)))
        (begin
          (if write-handler_0
            (|#%app| write-handler_0 v_0 o_0)
            (do-write who_0 v_0 co_0))
          (void))))))
(define do-write
  (let ((do-write_0
         (|#%name|
          do-write
          (lambda (who10_0 v11_0 o12_0 max-length9_0)
            (let ((config_0 (make-hasheq)))
              (begin
                (dots
                 (let ((app_0 (sub3 max-length9_0)))
                   (p
                    who10_0
                    v11_0
                    #t
                    o12_0
                    app_0
                    (detect-graph v11_0 #t config_0)
                    config_0))
                 o12_0)
                (void)))))))
    (case-lambda
     ((who_0 v_0 o_0) (do-write_0 who_0 v_0 o_0 #f))
     ((who_0 v_0 o_0 max-length9_0)
      (do-write_0 who_0 v_0 o_0 max-length9_0)))))
(define 1/print
  (let ((print_0
         (|#%name|
          print
          (lambda (v15_0 o13_0 quote-depth14_0)
            (let ((o_0
                   (if (eq? o13_0 unsafe-undefined)
                     (1/current-output-port)
                     o13_0)))
              (let ((quote-depth_0
                     (if (eq? quote-depth14_0 unsafe-undefined)
                       0
                       quote-depth14_0)))
                (print-via-handler 'print v15_0 o_0 quote-depth_0)))))))
    (|#%name|
     print
     (case-lambda
      ((v_0) (print_0 v_0 unsafe-undefined unsafe-undefined))
      ((v_0 o_0 quote-depth14_0) (print_0 v_0 o_0 quote-depth14_0))
      ((v_0 o13_0) (print_0 v_0 o13_0 unsafe-undefined))))))
(define print-via-handler
  (lambda (who_0 v_0 o_0 quote-depth_0)
    (let ((co_0 (->core-output-port.1 unsafe-undefined o_0 who_0)))
      (begin
        (if (print-mode? quote-depth_0)
          (void)
          (raise-argument-error who_0 "(or/c 0 1)" quote-depth_0))
        (let ((print-handler_0 (core-output-port-print-handler co_0)))
          (begin
            (if print-handler_0
              (|#%app| print-handler_0 v_0 o_0 quote-depth_0)
              (|#%app| do-global-print who_0 v_0 co_0 quote-depth_0))
            (void)))))))
(define do-print
  (let ((do-print_0
         (|#%name|
          do-print
          (lambda (who18_0 v19_0 o20_0 quote-depth16_0 max-length17_0)
            (let ((quote-depth_0
                   (if (eq? quote-depth16_0 unsafe-undefined)
                     0
                     quote-depth16_0)))
              (let ((config_0 (make-hasheq)))
                (begin
                  (dots
                   (let ((app_0 (sub3 max-length17_0)))
                     (p
                      who18_0
                      v19_0
                      quote-depth_0
                      o20_0
                      app_0
                      (detect-graph v19_0 quote-depth_0 config_0)
                      config_0))
                   o20_0)
                  (void))))))))
    (case-lambda
     ((who_0 v_0 o_0) (do-print_0 who_0 v_0 o_0 unsafe-undefined #f))
     ((who_0 v_0 o_0 quote-depth_0 max-length17_0)
      (do-print_0 who_0 v_0 o_0 quote-depth_0 max-length17_0))
     ((who_0 v_0 o_0 quote-depth16_0)
      (do-print_0 who_0 v_0 o_0 quote-depth16_0 #f)))))
(define do-global-print void)
(define install-do-global-print!
  (lambda (param_0 default-value_0)
    (set! do-global-print
      (let ((...rc/io/print/main.rkt:124:8_0
             (|#%name|
              ...rc/io/print/main.rkt:124:8
              (lambda (who34_0 v35_0 o36_0 quote-depth-in32_0 max-length33_0)
                (let ((quote-depth-in_0
                       (if (eq? quote-depth-in32_0 unsafe-undefined)
                         0
                         quote-depth-in32_0)))
                  (let ((global-print_0 (|#%app| param_0)))
                    (begin
                      (if (eq? global-print_0 default-value_0)
                        (let ((quote-depth_0
                               (if (1/print-as-expression)
                                 quote-depth-in_0
                                 #t)))
                          (do-print
                           who34_0
                           v35_0
                           o36_0
                           quote-depth_0
                           max-length33_0))
                        (if (not max-length33_0)
                          (|#%app| global-print_0 v35_0 o36_0 quote-depth-in_0)
                          (let ((o2_0 (1/open-output-bytes)))
                            (begin
                              (|#%app|
                               global-print_0
                               v35_0
                               o2_0
                               quote-depth-in_0)
                              (let ((bstr_0 (1/get-output-bytes o2_0)))
                                (if (<=
                                     (unsafe-bytes-length bstr_0)
                                     max-length33_0)
                                  (do-write-bytes
                                   who34_0
                                   o36_0
                                   bstr_0
                                   0
                                   (unsafe-bytes-length bstr_0))
                                  (begin
                                    (let ((bstr_1
                                           (subbytes
                                            bstr_0
                                            0
                                            (sub3 max-length33_0))))
                                      (do-write-bytes
                                       who34_0
                                       o36_0
                                       bstr_1
                                       0
                                       (unsafe-bytes-length bstr_1)))
                                    (let ((bstr_1 #vu8(46 46 46)))
                                      (do-write-bytes
                                       who34_0
                                       o36_0
                                       bstr_1
                                       0
                                       (unsafe-bytes-length bstr_1))))))))))
                      (void))))))))
        (|#%name|
         ...rc/io/print/main.rkt:124:8
         (case-lambda
          ((who_0 v_0 o_0)
           (...rc/io/print/main.rkt:124:8_0 who_0 v_0 o_0 unsafe-undefined #f))
          ((who_0 v_0 o_0 quote-depth-in_0 max-length33_0)
           (...rc/io/print/main.rkt:124:8_0
            who_0
            v_0
            o_0
            quote-depth-in_0
            max-length33_0))
          ((who_0 v_0 o_0 quote-depth-in32_0)
           (...rc/io/print/main.rkt:124:8_0
            who_0
            v_0
            o_0
            quote-depth-in32_0
            #f))))))))
(define 1/newline
  (let ((newline_0
         (|#%name|
          newline
          (lambda (o21_0)
            (let ((o_0
                   (if (eq? o21_0 unsafe-undefined)
                     (1/current-output-port)
                     o21_0)))
              (begin
                (let ((bstr_0 #vu8(10)))
                  (let ((o_1
                         (->core-output-port.1 unsafe-undefined o_0 'newline)))
                    (let ((bstr_1 bstr_0))
                      (do-write-bytes
                       'newline
                       o_1
                       bstr_1
                       0
                       (unsafe-bytes-length bstr_1)))))
                (void)))))))
    (|#%name|
     newline
     (case-lambda
      (() (newline_0 unsafe-undefined))
      ((o21_0) (newline_0 o21_0))))))
(define sub3 (lambda (n_0) (if n_0 (- n_0 3) #f)))
(define dots
  (lambda (max-length_0 o_0)
    (if (eq? max-length_0 'full)
      (1/write-string "..." o_0)
      (if (pair? max-length_0)
        (1/write-bytes (cdr max-length_0) o_0)
        (void)))))
(define p
  (lambda (who_0 v_0 mode_0 o_0 max-length_0 graph_0 config_0)
    (let ((c1_0 (if graph_0 (hash-ref graph_0 v_0 #f) #f)))
      (if c1_0
        (if (if (as-constructor? c1_0) (not (as-constructor-tag c1_0)) #f)
          (p/no-graph-no-quote
           who_0
           v_0
           mode_0
           o_0
           max-length_0
           graph_0
           config_0)
          (if (string? c1_0)
            (let ((max-length_1 (write-string/max "#" o_0 max-length_0)))
              (let ((max-length_2 (write-string/max c1_0 o_0 max-length_1)))
                (write-string/max "#" o_0 max-length_2)))
            (let ((gs_0
                   (number->string
                    (if (as-constructor? c1_0)
                      (as-constructor-tag c1_0)
                      c1_0))))
              (let ((max-length_1 (write-string/max "#" o_0 max-length_0)))
                (let ((max-length_2 (write-string/max gs_0 o_0 max-length_1)))
                  (let ((max-length_3 (write-string/max "=" o_0 max-length_2)))
                    (begin
                      (hash-set! graph_0 v_0 gs_0)
                      (if (as-constructor? c1_0)
                        (p/no-graph-no-quote
                         who_0
                         v_0
                         mode_0
                         o_0
                         max-length_3
                         graph_0
                         config_0)
                        (p/no-graph
                         who_0
                         v_0
                         mode_0
                         o_0
                         max-length_3
                         graph_0
                         config_0)))))))))
        (p/no-graph who_0 v_0 mode_0 o_0 max-length_0 graph_0 config_0)))))
(define p/no-graph
  (lambda (who_0 v_0 mode_0 o_0 max-length_0 graph_0 config_0)
    (if (if (eq? mode_0 0)
          (let ((or-part_0 (null? v_0)))
            (if or-part_0
              or-part_0
              (let ((or-part_1 (symbol? v_0)))
                (if or-part_1
                  or-part_1
                  (let ((or-part_2 (keyword? v_0)))
                    (if or-part_2
                      or-part_2
                      (let ((or-part_3 (pair? v_0)))
                        (if or-part_3
                          or-part_3
                          (let ((or-part_4 (vector? v_0)))
                            (if or-part_4
                              or-part_4
                              (let ((or-part_5 (box? v_0)))
                                (if or-part_5
                                  or-part_5
                                  (let ((or-part_6 (hash? v_0)))
                                    (if or-part_6
                                      or-part_6
                                      (let ((or-part_7
                                             (prefab-struct-key v_0)))
                                        (if or-part_7
                                          or-part_7
                                          (if (1/custom-write? v_0)
                                            (if (not (struct-type? v_0))
                                              (if (not
                                                   (|#%app|
                                                    printable-regexp?
                                                    v_0))
                                                (not
                                                 (eq?
                                                  'self
                                                  (1/custom-print-quotable-accessor
                                                   v_0
                                                   'self)))
                                                #f)
                                              #f)
                                            #f)))))))))))))))))
          #f)
      (let ((max-length_1 (write-string/max "'" o_0 max-length_0)))
        (p/no-graph-no-quote who_0 v_0 1 o_0 max-length_1 graph_0 config_0))
      (p/no-graph-no-quote
       who_0
       v_0
       mode_0
       o_0
       max-length_0
       graph_0
       config_0))))
(define p/no-graph-no-quote
  (lambda (who_0 v_0 mode_0 o_0 max-length_0 graph_0 config_0)
    (if (eq? max-length_0 'full)
      'full
      (if (null? v_0)
        (write-string/max "()" o_0 max-length_0)
        (if (number? v_0)
          (write-string/max (number->string v_0) o_0 max-length_0)
          (if (string? v_0)
            (if (eq? mode_0 #f)
              (write-string/max v_0 o_0 max-length_0)
              (print-string v_0 o_0 max-length_0))
            (if (bytes? v_0)
              (if (eq? mode_0 #f)
                (write-bytes/max v_0 o_0 max-length_0)
                (print-bytes v_0 o_0 max-length_0))
              (if (symbol? v_0)
                (if (eq? mode_0 #f)
                  (write-string/max
                   (symbol->immutable-string v_0)
                   o_0
                   max-length_0)
                  (print-symbol.1 #f v_0 o_0 max-length_0 config_0))
                (if (keyword? v_0)
                  (let ((max-length_1
                         (write-string/max "#:" o_0 max-length_0)))
                    (if (eq? mode_0 #f)
                      (write-string/max
                       (keyword->immutable-string v_0)
                       o_0
                       max-length_1)
                      (let ((temp44_0
                             (string->symbol (keyword->immutable-string v_0))))
                        (print-symbol.1
                         #t
                         temp44_0
                         o_0
                         max-length_1
                         config_0))))
                  (if (char? v_0)
                    (if (eq? mode_0 #f)
                      (write-string/max (string v_0) o_0 max-length_0)
                      (print-char v_0 o_0 max-length_0))
                    (if (not v_0)
                      (if (config-get config_0 1/print-boolean-long-form)
                        (write-string/max "#false" o_0 max-length_0)
                        (write-string/max "#f" o_0 max-length_0))
                      (if (eq? v_0 #t)
                        (if (config-get config_0 1/print-boolean-long-form)
                          (write-string/max "#true" o_0 max-length_0)
                          (write-string/max "#t" o_0 max-length_0))
                        (if (pair? v_0)
                          (print-list
                           p
                           who_0
                           v_0
                           mode_0
                           o_0
                           max-length_0
                           graph_0
                           config_0
                           #f
                           #f)
                          (if (vector? v_0)
                            (print-vector
                             p
                             who_0
                             v_0
                             mode_0
                             o_0
                             max-length_0
                             graph_0
                             config_0
                             ""
                             vector-length
                             vector-ref
                             eq?)
                            (if (flvector? v_0)
                              (print-vector
                               p
                               who_0
                               v_0
                               mode_0
                               o_0
                               max-length_0
                               graph_0
                               config_0
                               "fl"
                               flvector-length
                               flvector-ref
                               equal?)
                              (if (fxvector? v_0)
                                (print-vector
                                 p
                                 who_0
                                 v_0
                                 mode_0
                                 o_0
                                 max-length_0
                                 graph_0
                                 config_0
                                 "fx"
                                 fxvector-length
                                 fxvector-ref
                                 eq?)
                                (if (stencil-vector? v_0)
                                  (let ((lst_0
                                         (letrec*
                                          ((loop_0
                                            (|#%name|
                                             loop
                                             (lambda (i_0)
                                               (if (=
                                                    i_0
                                                    (stencil-vector-length
                                                     v_0))
                                                 '()
                                                 (let ((app_0
                                                        (stencil-vector-ref
                                                         v_0
                                                         i_0)))
                                                   (cons
                                                    app_0
                                                    (loop_0 (add1 i_0)))))))))
                                          (loop_0 0))))
                                    (print-list
                                     p
                                     who_0
                                     lst_0
                                     (if (eq? mode_0 #f) #f #t)
                                     o_0
                                     max-length_0
                                     graph_0
                                     config_0
                                     (let ((app_0
                                            (number->string
                                             (stencil-vector-mask v_0))))
                                       (string-append
                                        "#<stencil "
                                        app_0
                                        (if (eqv? 0 (stencil-vector-mask v_0))
                                          ""
                                          ": ")))
                                     #f
                                     ">"))
                                  (if (box? v_0)
                                    (if (config-get config_0 1/print-box)
                                      (if (eq? mode_0 0)
                                        (let ((max-length_1
                                               (write-string/max
                                                "(box "
                                                o_0
                                                max-length_0)))
                                          (let ((max-length_2
                                                 (p
                                                  who_0
                                                  (unbox v_0)
                                                  mode_0
                                                  o_0
                                                  max-length_1
                                                  graph_0
                                                  config_0)))
                                            (write-string/max
                                             ")"
                                             o_0
                                             max-length_2)))
                                        (let ((app_0 (unbox v_0)))
                                          (p
                                           who_0
                                           app_0
                                           mode_0
                                           o_0
                                           (write-string/max
                                            "#&"
                                            o_0
                                            max-length_0)
                                           graph_0
                                           config_0)))
                                      (begin
                                        (check-unreadable
                                         who_0
                                         config_0
                                         mode_0
                                         v_0)
                                        (write-string/max
                                         "#<box>"
                                         o_0
                                         max-length_0)))
                                    (if (hash? v_0)
                                      (if (if (config-get
                                               config_0
                                               1/print-hash-table)
                                            (not (hash-weak? v_0))
                                            #f)
                                        (if (eq? mode_0 0)
                                          (let ((l_0
                                                 (apply
                                                  append
                                                  (hash-map v_0 list #t))))
                                            (let ((prefix_0
                                                   (if (hash-eq? v_0)
                                                     "(hasheq"
                                                     (if (hash-eqv? v_0)
                                                       "(hasheqv"
                                                       (if (hash-equal-always?
                                                            v_0)
                                                         "(hashalw"
                                                         "(hash")))))
                                              (print-list
                                               p
                                               who_0
                                               l_0
                                               mode_0
                                               o_0
                                               max-length_0
                                               graph_0
                                               config_0
                                               #f
                                               prefix_0)))
                                          (print-hash
                                           v_0
                                           o_0
                                           max-length_0
                                           p
                                           who_0
                                           mode_0
                                           graph_0
                                           config_0))
                                        (begin
                                          (check-unreadable
                                           who_0
                                           config_0
                                           mode_0
                                           v_0)
                                          (write-string/max
                                           "#<hash>"
                                           o_0
                                           max-length_0)))
                                      (if (if (not (eq? mode_0 #f))
                                            (if (not
                                                 (config-get
                                                  config_0
                                                  1/print-unreadable))
                                              (if (not (prefab-struct-key v_0))
                                                (not
                                                 (|#%app|
                                                  printable-regexp?
                                                  v_0))
                                                #f)
                                              #f)
                                            #f)
                                        (fail-unreadable who_0 v_0)
                                        (if (mpair? v_0)
                                          (print-mlist
                                           p
                                           who_0
                                           v_0
                                           mode_0
                                           o_0
                                           max-length_0
                                           graph_0
                                           config_0)
                                          (if (if (not (struct-type? v_0))
                                                (1/custom-write? v_0)
                                                #f)
                                            (let ((o/m_0
                                                   (make-max-output-port
                                                    o_0
                                                    max-length_0)))
                                              (begin
                                                (set-port-handlers-to-recur!
                                                 o/m_0
                                                 (lambda (v_1 o_1 mode_1)
                                                   (p
                                                    who_0
                                                    v_1
                                                    mode_1
                                                    o_1
                                                    (if max-length_0
                                                      (max-output-port-max-length
                                                       o/m_0)
                                                      #f)
                                                    graph_0
                                                    config_0)))
                                                (|#%app|
                                                 (1/custom-write-accessor v_0)
                                                 v_0
                                                 o/m_0
                                                 mode_0)
                                                (if max-length_0
                                                  (max-output-port-max-length
                                                   o/m_0)
                                                  #f)))
                                            (if (if (struct? v_0)
                                                  (config-get
                                                   config_0
                                                   1/print-struct)
                                                  #f)
                                              (if (eq? mode_0 0)
                                                (let ((l_0
                                                       (vector->list
                                                        (struct->vector
                                                         v_0
                                                         struct-dots))))
                                                  (let ((alt-list-constructor_0
                                                         (string-append
                                                          "("
                                                          (substring
                                                           (symbol->immutable-string
                                                            (car l_0))
                                                           7))))
                                                    (print-list
                                                     p
                                                     who_0
                                                     (cdr l_0)
                                                     mode_0
                                                     o_0
                                                     max-length_0
                                                     graph_0
                                                     config_0
                                                     #f
                                                     alt-list-constructor_0)))
                                                (let ((c2_0
                                                       (prefab-struct-key
                                                        v_0)))
                                                  (if c2_0
                                                    (let ((l_0
                                                           (cons
                                                            c2_0
                                                            (cdr
                                                             (vector->list
                                                              (struct->vector
                                                               v_0))))))
                                                      (print-list
                                                       p
                                                       who_0
                                                       l_0
                                                       mode_0
                                                       o_0
                                                       max-length_0
                                                       graph_0
                                                       config_0
                                                       "#s("
                                                       #f))
                                                    (p
                                                     who_0
                                                     (struct->vector v_0)
                                                     mode_0
                                                     o_0
                                                     max-length_0
                                                     graph_0
                                                     config_0))))
                                              (if (procedure? v_0)
                                                (print-named
                                                 "procedure"
                                                 v_0
                                                 mode_0
                                                 o_0
                                                 max-length_0)
                                                (if (struct-type? v_0)
                                                  (print-named
                                                   "struct-type"
                                                   v_0
                                                   mode_0
                                                   o_0
                                                   max-length_0)
                                                  (if (struct-type-property?
                                                       v_0)
                                                    (print-named
                                                     "struct-type-property"
                                                     v_0
                                                     mode_0
                                                     o_0
                                                     max-length_0)
                                                    (if (thread? v_0)
                                                      (print-named
                                                       "thread"
                                                       v_0
                                                       mode_0
                                                       o_0
                                                       max-length_0)
                                                      (if (eof-object? v_0)
                                                        (write-string/max
                                                         "#<eof>"
                                                         o_0
                                                         max-length_0)
                                                        (if (core-input-port?
                                                             v_0)
                                                          (print-named
                                                           "input-port"
                                                           v_0
                                                           mode_0
                                                           o_0
                                                           max-length_0)
                                                          (if (core-output-port?
                                                               v_0)
                                                            (print-named
                                                             "output-port"
                                                             v_0
                                                             mode_0
                                                             o_0
                                                             max-length_0)
                                                            (if (continuation-prompt-tag?
                                                                 v_0)
                                                              (print-named
                                                               "continuation-prompt-tag"
                                                               v_0
                                                               mode_0
                                                               o_0
                                                               max-length_0)
                                                              (if (unquoted-printing-string?
                                                                   v_0)
                                                                (write-string/max
                                                                 (unquoted-printing-string-value
                                                                  v_0)
                                                                 o_0
                                                                 max-length_0)
                                                                (if (eq?
                                                                     v_0
                                                                     unsafe-undefined)
                                                                  (write-string/max
                                                                   "#<unsafe-undefined>"
                                                                   o_0
                                                                   max-length_0)
                                                                  (write-string/max
                                                                   (format
                                                                    "~s"
                                                                    v_0)
                                                                   o_0
                                                                   max-length_0))))))))))))))))))))))))))))))))))
(define fail-unreadable
  (lambda (who_0 v_0)
    (raise
     (let ((app_0
            (let ((msg_0
                   (string-append
                    "printing disabled for unreadable value"
                    "\n  value: "
                    (with-continuation-mark*
                     push-authentic
                     parameterization-key
                     (extend-parameterization
                      (continuation-mark-set-first #f parameterization-key)
                      1/print-unreadable
                      #t)
                     (let ((app_0 (error-value->string-handler)))
                       (|#%app| app_0 v_0 (error-print-width)))))))
              (error-message->adjusted-string
               who_0
               'racket/primitive
               msg_0
               'racket/primitive))))
       (|#%app| exn:fail app_0 (current-continuation-marks))))))
(define check-unreadable
  (lambda (who_0 config_0 mode_0 v_0)
    (if (if (eq? mode_0 #t) (not (config-get config_0 1/print-unreadable)) #f)
      (fail-unreadable who_0 v_0)
      (void))))
(define struct-dots (unquoted-printing-string "..."))
(define do-printf
  (lambda (who_0 o_0 fmt_0 all-args_0)
    (let ((len_0 (string-length fmt_0)))
      (let ((next_0
             (|#%name|
              next
              (lambda (args_0) (if (pair? args_0) (cdr args_0) #f)))))
        (begin
          (letrec*
           ((loop_0
             (|#%name|
              loop
              (lambda (i_0 expected-count_0 args_0 error-thunk_0)
                (if (= i_0 len_0)
                  (check-conclusions
                   who_0
                   expected-count_0
                   args_0
                   error-thunk_0
                   fmt_0
                   all-args_0)
                  (let ((tmp_0 (string-ref fmt_0 i_0)))
                    (if (eqv? tmp_0 '#\x7e)
                      (let ((i_1 (add1 i_0)))
                        (begin
                          (if (= i_1 len_0)
                            (ill-formed-error
                             who_0
                             "cannot end in `~`"
                             fmt_0
                             all-args_0)
                            (void))
                          (let ((tmp_1 (string-ref fmt_0 i_1)))
                            (let ((index_0
                                   (if (char? tmp_1)
                                     (let ((codepoint_0 (char->integer tmp_1)))
                                       (if (if (unsafe-fx>= codepoint_0 37)
                                             (unsafe-fx< codepoint_0 127)
                                             #f)
                                         (let ((tbl_0
                                                '#(1
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   3
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   2
                                                   4
                                                   5
                                                   0
                                                   2
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   1
                                                   4
                                                   0
                                                   0
                                                   0
                                                   2
                                                   0
                                                   0
                                                   2
                                                   0
                                                   4
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   2
                                                   4
                                                   5
                                                   0
                                                   2
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   1
                                                   4
                                                   0
                                                   0
                                                   0
                                                   2
                                                   0
                                                   0
                                                   2
                                                   0
                                                   4
                                                   0
                                                   0
                                                   0
                                                   0
                                                   0
                                                   1)))
                                           (unsafe-vector*-ref
                                            tbl_0
                                            (unsafe-fx- codepoint_0 37)))
                                         0))
                                     0)))
                              (if (unsafe-fx< index_0 2)
                                (if (unsafe-fx< index_0 1)
                                  (if (char-whitespace? (string-ref fmt_0 i_1))
                                    (loop_0
                                     (add1 i_1)
                                     expected-count_0
                                     args_0
                                     error-thunk_0)
                                    (ill-formed-error
                                     who_0
                                     (string-append
                                      "tag `~"
                                      (substring fmt_0 i_1 (add1 i_1))
                                      "` not allowed")
                                     fmt_0
                                     all-args_0))
                                  (loop_0
                                   (add1 i_1)
                                   expected-count_0
                                   args_0
                                   error-thunk_0))
                                (if (unsafe-fx< index_0 3)
                                  (let ((app_0 (add1 i_1)))
                                    (let ((app_1 (add1 expected-count_0)))
                                      (loop_0
                                       app_0
                                       app_1
                                       (next_0 args_0)
                                       error-thunk_0)))
                                  (if (unsafe-fx< index_0 4)
                                    (let ((i_2 (add1 i_1)))
                                      (let ((bad-dot_0
                                             (|#%name|
                                              bad-dot
                                              (lambda ()
                                                (ill-formed-error
                                                 who_0
                                                 "tag `~.` not followed by `a`, `s`, or `v`"
                                                 fmt_0
                                                 all-args_0)))))
                                        (begin
                                          (if (= i_2 len_0) (bad-dot_0) (void))
                                          (let ((tmp_2 (string-ref fmt_0 i_2)))
                                            (if (if (eqv? tmp_2 '#\x61)
                                                  #t
                                                  (if (eqv? tmp_2 '#\x41)
                                                    #t
                                                    (if (eqv? tmp_2 '#\x73)
                                                      #t
                                                      (if (eqv? tmp_2 '#\x53)
                                                        #t
                                                        (if (eqv? tmp_2 '#\x76)
                                                          #t
                                                          (eqv?
                                                           tmp_2
                                                           '#\x56))))))
                                              (let ((app_0 (add1 i_2)))
                                                (let ((app_1
                                                       (add1
                                                        expected-count_0)))
                                                  (loop_0
                                                   app_0
                                                   app_1
                                                   (next_0 args_0)
                                                   error-thunk_0)))
                                              (bad-dot_0))))))
                                    (if (unsafe-fx< index_0 5)
                                      (let ((new-error-thunk_0
                                             (if (not error-thunk_0)
                                               (if (pair? args_0)
                                                 (if (let ((a_0 (car args_0)))
                                                       (let ((or-part_0
                                                              (not
                                                               (number? a_0))))
                                                         (if or-part_0
                                                           or-part_0
                                                           (not
                                                            (exact? a_0)))))
                                                   (|#%name|
                                                    new-error-thunk
                                                    (lambda ()
                                                      (arg-type-error
                                                       who_0
                                                       "exact integer"
                                                       (car args_0)
                                                       fmt_0
                                                       args_0)))
                                                   #f)
                                                 #f)
                                               #f)))
                                        (let ((app_0 (add1 i_1)))
                                          (let ((app_1
                                                 (add1 expected-count_0)))
                                            (loop_0
                                             app_0
                                             app_1
                                             (next_0 args_0)
                                             new-error-thunk_0))))
                                      (let ((new-error-thunk_0
                                             (if (not error-thunk_0)
                                               (if (pair? args_0)
                                                 (if (not (char? (car args_0)))
                                                   (|#%name|
                                                    new-error-thunk
                                                    (lambda ()
                                                      (arg-type-error
                                                       who_0
                                                       "character"
                                                       (car args_0)
                                                       fmt_0
                                                       args_0)))
                                                   #f)
                                                 #f)
                                               #f)))
                                        (let ((app_0 (add1 i_1)))
                                          (let ((app_1
                                                 (add1 expected-count_0)))
                                            (loop_0
                                             app_0
                                             app_1
                                             (next_0 args_0)
                                             new-error-thunk_0))))))))))))
                      (loop_0
                       (add1 i_0)
                       expected-count_0
                       args_0
                       error-thunk_0))))))))
           (loop_0 0 0 all-args_0 #f))
          (letrec*
           ((loop_0
             (|#%name|
              loop
              (lambda (start-i_0 i_0 args_0)
                (if (= i_0 len_0)
                  (1/write-string fmt_0 o_0 start-i_0 i_0)
                  (let ((tmp_0 (string-ref fmt_0 i_0)))
                    (if (eqv? tmp_0 '#\x7e)
                      (let ((next_1
                             (|#%name|
                              next
                              (lambda (i_1 args_1)
                                (let ((i_2 (add1 i_1)))
                                  (loop_0 i_2 i_2 args_1))))))
                        (begin
                          (1/write-string fmt_0 o_0 start-i_0 i_0)
                          (let ((i_1 (add1 i_0)))
                            (let ((c_0 (string-ref fmt_0 i_1)))
                              (let ((index_0
                                     (if (char? c_0)
                                       (let ((codepoint_0 (char->integer c_0)))
                                         (if (if (unsafe-fx>= codepoint_0 37)
                                               (unsafe-fx< codepoint_0 127)
                                               #f)
                                           (let ((tbl_0
                                                  '#(2
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     7
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     3
                                                     10
                                                     11
                                                     0
                                                     6
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     2
                                                     9
                                                     0
                                                     0
                                                     0
                                                     4
                                                     0
                                                     0
                                                     5
                                                     0
                                                     8
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     3
                                                     10
                                                     11
                                                     0
                                                     6
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     2
                                                     9
                                                     0
                                                     0
                                                     0
                                                     4
                                                     0
                                                     0
                                                     5
                                                     0
                                                     8
                                                     0
                                                     0
                                                     0
                                                     0
                                                     0
                                                     1)))
                                             (unsafe-vector*-ref
                                              tbl_0
                                              (unsafe-fx- codepoint_0 37)))
                                           0))
                                       0)))
                                (if (unsafe-fx< index_0 5)
                                  (if (unsafe-fx< index_0 2)
                                    (if (unsafe-fx< index_0 1)
                                      (if (char-whitespace? c_0)
                                        (letrec*
                                         ((ws-loop_0
                                           (|#%name|
                                            ws-loop
                                            (lambda (i_2 saw-newline?_0)
                                              (if (= i_2 len_0)
                                                (loop_0 i_2 i_2 args_0)
                                                (let ((c_1
                                                       (string-ref fmt_0 i_2)))
                                                  (if (eqv? c_1 '#\xa)
                                                    (if saw-newline?_0
                                                      (loop_0 i_2 i_2 args_0)
                                                      (ws-loop_0
                                                       (add1 i_2)
                                                       #t))
                                                    (if (eqv? c_1 '#\xd)
                                                      (if saw-newline?_0
                                                        (loop_0 i_2 i_2 args_0)
                                                        (ws-loop_0
                                                         (if (if (<
                                                                  (add1 i_2)
                                                                  len_0)
                                                               (char=?
                                                                '#\xa
                                                                (string-ref
                                                                 fmt_0
                                                                 (add1 i_2)))
                                                               #f)
                                                           (+ i_2 2)
                                                           (add1 i_2))
                                                         #t))
                                                      (if (char-whitespace?
                                                           c_1)
                                                        (ws-loop_0
                                                         (add1 i_2)
                                                         saw-newline?_0)
                                                        (loop_0
                                                         i_2
                                                         i_2
                                                         args_0))))))))))
                                         (ws-loop_0 i_1 #f))
                                        (void))
                                      (begin
                                        (1/write-string "~" o_0)
                                        (next_1 i_1 args_0)))
                                    (if (unsafe-fx< index_0 3)
                                      (begin
                                        (1/write-string "\n" o_0)
                                        (next_1 i_1 args_0))
                                      (if (unsafe-fx< index_0 4)
                                        (begin
                                          (display-via-handler
                                           who_0
                                           (car args_0)
                                           o_0)
                                          (next_1 i_1 (cdr args_0)))
                                        (begin
                                          (write-via-handler
                                           who_0
                                           (car args_0)
                                           o_0)
                                          (next_1 i_1 (cdr args_0))))))
                                  (if (unsafe-fx< index_0 8)
                                    (if (unsafe-fx< index_0 6)
                                      (begin
                                        (print-via-handler
                                         who_0
                                         (car args_0)
                                         o_0
                                         0)
                                        (next_1 i_1 (cdr args_0)))
                                      (if (unsafe-fx< index_0 7)
                                        (begin
                                          (with-continuation-mark*
                                           push-authentic
                                           parameterization-key
                                           (extend-parameterization
                                            (continuation-mark-set-first
                                             #f
                                             parameterization-key)
                                            1/print-unreadable
                                            #t)
                                           (1/write-string
                                            (error-value->string (car args_0))
                                            o_0))
                                          (next_1 i_1 (cdr args_0)))
                                        (let ((i_2 (add1 i_1)))
                                          (let ((tmp_1 (string-ref fmt_0 i_2)))
                                            (if (if (eqv? tmp_1 '#\x61)
                                                  #t
                                                  (eqv? tmp_1 '#\x41))
                                              (begin
                                                (let ((app_0 (car args_0)))
                                                  (let ((app_1
                                                         (->core-output-port.1
                                                          unsafe-undefined
                                                          o_0
                                                          #f)))
                                                    (do-display
                                                     who_0
                                                     app_0
                                                     app_1
                                                     (error-print-width))))
                                                (next_1 i_2 (cdr args_0)))
                                              (if (if (eqv? tmp_1 '#\x73)
                                                    #t
                                                    (eqv? tmp_1 '#\x53))
                                                (begin
                                                  (let ((app_0 (car args_0)))
                                                    (let ((app_1
                                                           (->core-output-port.1
                                                            unsafe-undefined
                                                            o_0
                                                            #f)))
                                                      (do-write
                                                       who_0
                                                       app_0
                                                       app_1
                                                       (error-print-width))))
                                                  (next_1 i_2 (cdr args_0)))
                                                (if (if (eqv? tmp_1 '#\x76)
                                                      #t
                                                      (eqv? tmp_1 '#\x56))
                                                  (begin
                                                    (let ((app_0 (car args_0)))
                                                      (let ((app_1
                                                             (->core-output-port.1
                                                              unsafe-undefined
                                                              o_0
                                                              #f)))
                                                        (do-print
                                                         who_0
                                                         app_0
                                                         app_1
                                                         0
                                                         (error-print-width))))
                                                    (next_1 i_2 (cdr args_0)))
                                                  (void))))))))
                                    (if (unsafe-fx< index_0 9)
                                      (begin
                                        (1/write-string
                                         (number->string (car args_0) 16)
                                         o_0)
                                        (next_1 i_1 (cdr args_0)))
                                      (if (unsafe-fx< index_0 10)
                                        (begin
                                          (1/write-string
                                           (number->string (car args_0) 8)
                                           o_0)
                                          (next_1 i_1 (cdr args_0)))
                                        (if (unsafe-fx< index_0 11)
                                          (begin
                                            (1/write-string
                                             (number->string (car args_0) 2)
                                             o_0)
                                            (next_1 i_1 (cdr args_0)))
                                          (begin
                                            (1/write-string
                                             (string (car args_0))
                                             o_0)
                                            (next_1
                                             i_1
                                             (cdr args_0)))))))))))))
                      (loop_0 start-i_0 (add1 i_0) args_0))))))))
           (loop_0 0 0 all-args_0))
          (void))))))
(define raise-error
  (lambda (str_0)
    (raise (|#%app| exn:fail:contract str_0 (current-continuation-marks)))))
(define check-conclusions
  (lambda (who_0 expected-count_0 args_0 error-thunk_0 fmt_0 all-args_0)
    (begin
      (if (null? args_0)
        (void)
        (raise-error
         (let ((app_0 (symbol->string who_0)))
           (let ((app_1 (number->string expected-count_0)))
             (let ((app_2 (number->string (length all-args_0))))
               (string-append
                app_0
                ": "
                "format string requires "
                app_1
                " arguments, given "
                app_2
                (arguments->string (cons fmt_0 all-args_0))))))))
      (if error-thunk_0 (|#%app| error-thunk_0) (void)))))
(define ill-formed-error
  (lambda (who_0 explanation_0 fmt_0 args_0)
    (raise-error
     (let ((app_0 (symbol->string who_0)))
       (string-append
        app_0
        ": "
        "ill-formed pattern string\n"
        "  explanation: "
        explanation_0
        (arguments->string (cons fmt_0 args_0)))))))
(define arg-type-error
  (lambda (who_0 what_0 val_0 fmt_0 args_0)
    (raise-error
     (let ((app_0 (symbol->string who_0)))
       (let ((app_1 (error-value->string val_0)))
         (string-append
          app_0
          ": "
          "format string requires a "
          what_0
          ", given something else\n"
          "  bad argument: "
          app_1
          (arguments->string (cons fmt_0 args_0))))))))
(define arguments->string
  (lambda (fmt+args_0)
    (let ((args_0 (cdr fmt+args_0)))
      (if (<= 1 (length args_0) 50)
        (with-continuation-mark*
         authentic
         parameterization-key
         (let ((app_0 (continuation-mark-set-first #f parameterization-key)))
           (extend-parameterization
            app_0
            error-print-width
            (max
             2
             (round
              (let ((app_1 (error-print-width))) (/ app_1 (length args_0)))))))
         (apply
          string-append
          "; "
          "arguments were: "
          (letrec*
           ((loop_0
             (|#%name|
              loop
              (lambda (ss_0)
                (if (let ((or-part_0 (null? ss_0)))
                      (if or-part_0 or-part_0 (null? (cdr ss_0))))
                  ss_0
                  (let ((app_0 (car ss_0)))
                    (cons app_0 (cons " " (loop_0 (cdr ss_0))))))))))
           (loop_0 (map_2353 error-value->string args_0)))))
        ""))))
(define 1/fprintf
  (|#%name|
   fprintf
   (lambda (o_0 fmt_0 . args_0)
     (begin
       (if (1/output-port? o_0)
         (void)
         (raise-argument-error 'fprintf "output-port?" o_0))
       (if (string? fmt_0)
         (void)
         (raise-argument-error 'fprintf "string?" fmt_0))
       (do-printf 'fprintf o_0 fmt_0 args_0)))))
(define 1/printf
  (|#%name|
   printf
   (lambda (fmt_0 . args_0)
     (begin
       (if (string? fmt_0)
         (void)
         (raise-argument-error 'printf "string?" fmt_0))
       (do-printf 'printf (1/current-output-port) fmt_0 args_0)))))
(define 1/eprintf
  (|#%name|
   eprintf
   (lambda (fmt_0 . args_0)
     (begin
       (if (string? fmt_0)
         (void)
         (raise-argument-error 'eprintf "string?" fmt_0))
       (do-printf 'eprintf (1/current-error-port) fmt_0 args_0)))))
(define general-format
  (lambda (fmt_0 args_0)
    (begin
      (if (string? fmt_0)
        (void)
        (raise-argument-error 'format "string?" fmt_0))
      (let ((o_0 (1/open-output-string)))
        (begin
          (do-printf 'format o_0 fmt_0 args_0)
          (1/get-output-string o_0))))))
(define simple-format
  (lambda (a_0)
    (if (boolean? a_0)
      (string-copy
       (if (1/print-boolean-long-form)
         (if a_0 "#true" "#false")
         (if a_0 "#t" "#f")))
      (if (number? a_0) (number->string a_0) #f))))
(define 1/format
  (|#%name|
   format
   (case-lambda
    ((fmt_0 a_0)
     (if (let ((or-part_0 (equal? fmt_0 "~a")))
           (if or-part_0 or-part_0 (equal? fmt_0 "~A")))
       (let ((or-part_0 (simple-format a_0)))
         (if or-part_0
           or-part_0
           (if (bytes? a_0)
             (1/bytes->string/utf-8 a_0 '#\x3f)
             (if (string? a_0)
               (string-copy a_0)
               (if (symbol? a_0)
                 (symbol->string a_0)
                 (if (keyword? a_0)
                   (string-append "#:" (keyword->string a_0))
                   (general-format fmt_0 (list a_0))))))))
       (if (let ((or-part_0 (equal? fmt_0 "~s")))
             (if or-part_0 or-part_0 (equal? fmt_0 "~S")))
         (let ((or-part_0 (simple-format a_0)))
           (if or-part_0 or-part_0 (general-format fmt_0 (list a_0))))
         (general-format fmt_0 (list a_0)))))
    ((fmt_0 . args_0) (general-format fmt_0 args_0)))))
(define 1/build-path
  (|#%name|
   build-path
   (lambda (base_0 . subs_0) (build 'build-path #f base_0 subs_0))))
(define 1/build-path/convention-type
  (|#%name|
   build-path/convention-type
   (lambda (convention_0 base_0 . subs_0)
     (build 'build-path/convention-type convention_0 base_0 subs_0))))
(define build
  (lambda (who_0 init-convention_0 base_0 subs_0)
    (begin
      (check-build-path-arg who_0 base_0)
      (let ((convention_0
             (letrec*
              ((loop_0
                (|#%name|
                 loop
                 (lambda (convention_0 subs_1)
                   (if (null? subs_1)
                     convention_0
                     (let ((sub_0 (car subs_1)))
                       (begin
                         (check-build-path-arg who_0 sub_0)
                         (let ((app_0
                                (argument->convention.1
                                 #f
                                 sub_0
                                 convention_0
                                 who_0)))
                           (loop_0 app_0 (cdr subs_1))))))))))
              (loop_0
               (argument->convention.1 #t base_0 init-convention_0 who_0)
               subs_0))))
        (let ((final-convention_0
               (if convention_0 convention_0 (system-path-convention-type))))
          (path1.1
           (append-path-parts final-convention_0 who_0 base_0 subs_0)
           final-convention_0))))))
(define check-build-path-arg
  (lambda (who_0 p_0)
    (if (let ((or-part_0 (path-string? p_0)))
          (if or-part_0
            or-part_0
            (let ((or-part_1 (1/path? p_0)))
              (if or-part_1
                or-part_1
                (let ((or-part_2 (eq? p_0 'up)))
                  (if or-part_2 or-part_2 (eq? p_0 'same)))))))
      (void)
      (raise-argument-error
       who_0
       "(or/c path-string? path-for-some-system? 'up 'same)"
       p_0))))
(define argument->convention.1
  (|#%name|
   argument->convention
   (lambda (first?1_0 p3_0 convention4_0 who5_0)
     (let ((check_0
            (|#%name|
             check
             (lambda (c_0)
               (begin
                 (if (if convention4_0 (not (eq? c_0 convention4_0)) #f)
                   (raise-arguments-error
                    who5_0
                    (1/format
                     (if first?1_0
                       "specified convention incompatible with ~a path element"
                       "preceding path's convention incompatible with ~a path element")
                     (if (string? p3_0) "string" "given"))
                    "path element"
                    p3_0
                    (if first?1_0 "convention" "preceding path's convention")
                    convention4_0)
                   (void))
                 c_0)))))
       (if (1/path? p3_0)
         (check_0 (path-convention p3_0))
         (if (string? p3_0)
           (check_0 (system-path-convention-type))
           convention4_0))))))
(define append-path-parts
  (lambda (convention_0 who_0 base_0 subs_0)
    (let ((result-is-backslash-backslash-questionmark?_0
           (if (eq? convention_0 'windows)
             (let ((lst_0 (cons base_0 subs_0)))
               (letrec*
                ((for-loop_0
                  (|#%name|
                   for-loop
                   (lambda (result_0 lst_1)
                     (if (pair? lst_1)
                       (let ((sub_0 (unsafe-car lst_1)))
                         (let ((rest_0 (unsafe-cdr lst_1)))
                           (let ((result_1
                                  (let ((result_1
                                         (backslash-backslash-questionmark?
                                          (as-bytes sub_0))))
                                    (values result_1))))
                             (if (if (not (let ((x_0 (list sub_0))) result_1))
                                   #t
                                   #f)
                               (for-loop_0 result_1 rest_0)
                               result_1))))
                       result_0)))))
                (for-loop_0 #f lst_0)))
             #f)))
      (let ((base-accum_0
             (let ((bstr_0 (as-bytes base_0)))
               (if (eq? convention_0 'windows)
                 (if result-is-backslash-backslash-questionmark?_0
                   (convert-to-initial-backslash-backslash-questionmark bstr_0)
                   (list (strip-trailing-spaces bstr_0)))
                 (list bstr_0)))))
        (let ((unc-result?_0
               (if (eq? convention_0 'windows)
                 (if (not result-is-backslash-backslash-questionmark?_0)
                   (let ((temp39_0 (car base-accum_0)))
                     (parse-unc.1 #f #f temp39_0 0))
                   #f)
                 #f)))
          (letrec*
           ((loop_0
             (|#%name|
              loop
              (lambda (accum_0 subs_1 first?_0)
                (if (null? subs_1)
                  (let ((elems_0 (1/reverse accum_0)))
                    (combine-build-elements elems_0 unc-result?_0))
                  (let ((sub_0 (car subs_1)))
                    (let ((bstr_0 (as-bytes sub_0)))
                      (if (eq? convention_0 'unix)
                        (begin
                          (if (is-sep? (unsafe-bytes-ref bstr_0 0) 'unix)
                            (raise-arguments-error
                             who_0
                             "absolute path cannot be added to a path"
                             "absolute path"
                             sub_0)
                            (void))
                          (let ((prev_0 (car accum_0)))
                            (if (is-sep?
                                 (unsafe-bytes-ref
                                  prev_0
                                  (sub1 (unsafe-bytes-length prev_0)))
                                 'unix)
                              (let ((app_0 (cons bstr_0 accum_0)))
                                (loop_0 app_0 (cdr subs_1) #f))
                              (let ((app_0 (list* bstr_0 #vu8(47) accum_0)))
                                (loop_0 app_0 (cdr subs_1) #f)))))
                        (if (eq? convention_0 'windows)
                          (let ((len_0 (unsafe-bytes-length bstr_0)))
                            (let ((combine_0
                                   (|#%name|
                                    combine
                                    (lambda (is-rel?_0
                                             is-complete?_0
                                             is-drive?_0)
                                      (begin
                                        (if (if is-complete?_0
                                              is-complete?_0
                                              (if (not is-rel?_0)
                                                (let ((or-part_0
                                                       (not first?_0)))
                                                  (if or-part_0
                                                    or-part_0
                                                    (not
                                                     (if (null? (cdr accum_0))
                                                       (drive? (car accum_0))
                                                       #f))))
                                                #f))
                                          (let ((what_0
                                                 (if is-drive?_0
                                                   "drive"
                                                   "absolute path")))
                                            (let ((app_0
                                                   (string-append
                                                    what_0
                                                    " cannot be added to a base path")))
                                              (raise-arguments-error
                                               who_0
                                               app_0
                                               what_0
                                               sub_0
                                               "base path"
                                               (path1.1
                                                (combine-build-elements
                                                 (1/reverse accum_0)
                                                 unc-result?_0)
                                                'windows))))
                                          (void))
                                        (let ((app_0
                                               (let ((app_0
                                                      (if (if (null? subs_1)
                                                            (not
                                                             result-is-backslash-backslash-questionmark?_0)
                                                            #f)
                                                        bstr_0
                                                        (strip-trailing-spaces
                                                         bstr_0))))
                                                 (combine-windows-path
                                                  app_0
                                                  accum_0
                                                  result-is-backslash-backslash-questionmark?_0
                                                  (null? (cdr subs_1))))))
                                          (loop_0 app_0 (cdr subs_1) #f)))))))
                              (if (is-sep?
                                   (unsafe-bytes-ref bstr_0 0)
                                   'windows)
                                (if (backslash-backslash-questionmark? bstr_0)
                                  (call-with-values
                                   (lambda ()
                                     (parse-backslash-backslash-questionmark
                                      bstr_0))
                                   (lambda (kind_0
                                            drive-len_0
                                            orig-drive-len_0
                                            clean-start-pos_0
                                            add-sep-pos_0)
                                     (let ((or-part_0 (eq? kind_0 'abs)))
                                       (let ((abs?_0
                                              (if or-part_0
                                                or-part_0
                                                (eq? kind_0 'unc))))
                                         (combine_0
                                          (eq? kind_0 'rel)
                                          abs?_0
                                          (if abs?_0
                                            (just-backslashes-after?
                                             bstr_0
                                             drive-len_0)
                                            #f))))))
                                  (let ((c1_0 (parse-unc.1 #f #f bstr_0 0)))
                                    (if c1_0
                                      (combine_0
                                       #t
                                       #t
                                       (just-separators-after? bstr_0 c1_0))
                                      (combine_0 #f #f #f))))
                                (if (letter-drive-start? bstr_0 len_0)
                                  (combine_0
                                   #f
                                   #t
                                   (just-separators-after? bstr_0 2))
                                  (combine_0 #t #f #f)))))
                          (void))))))))))
           (loop_0 base-accum_0 subs_0 #t)))))))
(define combine-windows-path
  (lambda (bstr_0
           accum_0
           result-is-backslash-backslash-questionmark?_0
           is-last?_0)
    (if result-is-backslash-backslash-questionmark?_0
      (letrec*
       ((loop_0
         (|#%name|
          loop
          (lambda (elems_0 accum_1 to-dir?_0)
            (if (null? elems_0)
              (if (if is-last?_0 (if to-dir?_0 (pair? (cdr accum_1)) #f) #f)
                (let ((app_0 (bytes-append (car accum_1) #vu8(92))))
                  (cons app_0 (cdr accum_1)))
                accum_1)
              (let ((sub_0 (car elems_0)))
                (if (eq? 'same sub_0)
                  (loop_0 (cdr elems_0) accum_1 #t)
                  (if (eq? 'up sub_0)
                    (let ((app_0 (cdr elems_0)))
                      (loop_0
                       app_0
                       (if (null? (cdr accum_1))
                         (list (starting-point-add-up (car accum_1)))
                         (cdr accum_1))
                       #t))
                    (let ((app_0 (cdr elems_0)))
                      (loop_0 app_0 (cons sub_0 accum_1) #f))))))))))
       (loop_0
        (windows-split-into-path-elements bstr_0 is-last?_0)
        accum_0
        #f))
      (let ((len_0 (unsafe-bytes-length bstr_0)))
        (let ((sub_0
               (letrec*
                ((loop_0
                  (|#%name|
                   loop
                   (lambda (i_0)
                     (if (= i_0 len_0)
                       #vu8()
                       (if (is-sep? (unsafe-bytes-ref bstr_0 i_0) 'windows)
                         (loop_0 (add1 i_0))
                         (if (zero? i_0) bstr_0 (subbytes bstr_0 i_0))))))))
                (loop_0 0))))
          (let ((prev-bstr_0 (car accum_0)))
            (let ((new-accum_0
                   (if (is-sep?
                        (unsafe-bytes-ref
                         prev-bstr_0
                         (sub1 (unsafe-bytes-length prev-bstr_0)))
                        'windows)
                     accum_0
                     (cons #vu8(92) accum_0))))
              (if (equal? sub_0 #vu8()) new-accum_0 (cons sub_0 new-accum_0)))))))))
(define windows-split-into-path-elements
  (lambda (bstr_0 keep-trailing-separator?_0)
    (if (backslash-backslash-questionmark? bstr_0)
      (call-with-values
       (lambda ()
         (backslash-backslash-questionmark-dot-ups-end
          bstr_0
          (unsafe-bytes-length bstr_0)))
       (lambda (dots-end_0 literal-start_0)
         (let ((app_0 (extract-dot-ups bstr_0 8 (if dots-end_0 dots-end_0 8))))
           (append
            app_0
            (extract-separate-parts.1
             #t
             keep-trailing-separator?_0
             bstr_0
             literal-start_0)))))
      (extract-separate-parts.1 #f keep-trailing-separator?_0 bstr_0 0))))
(define as-bytes
  (lambda (p_0)
    (if (eq? p_0 'up)
      #vu8(46 46)
      (if (eq? p_0 'same)
        #vu8(46)
        (if (1/path? p_0) (path-bytes p_0) (1/string->bytes/locale p_0 63))))))
(define just-separators-after?
  (lambda (bstr_0 drive-len_0)
    (call-with-values
     (lambda ()
       (unsafe-normalise-inputs unsafe-bytes-length bstr_0 drive-len_0 #f 1))
     (lambda (v*_0 start*_0 stop*_0 step*_0)
       (letrec*
        ((for-loop_0
          (|#%name|
           for-loop
           (lambda (result_0 idx_0)
             (if (unsafe-fx< idx_0 stop*_0)
               (let ((b_0 (unsafe-bytes-ref v*_0 idx_0)))
                 (let ((result_1
                        (let ((result_1 (is-sep? b_0 'windows)))
                          (values result_1))))
                   (if (if (not (let ((x_0 (list b_0))) (not result_1))) #t #f)
                     (for-loop_0 result_1 (unsafe-fx+ idx_0 1))
                     result_1)))
               result_0)))))
        (for-loop_0 #t start*_0))))))
(define just-backslashes-after?
  (lambda (bstr_0 drive-len_0)
    (call-with-values
     (lambda ()
       (unsafe-normalise-inputs unsafe-bytes-length bstr_0 drive-len_0 #f 1))
     (lambda (v*_0 start*_0 stop*_0 step*_0)
       (letrec*
        ((for-loop_0
          (|#%name|
           for-loop
           (lambda (result_0 idx_0)
             (if (unsafe-fx< idx_0 stop*_0)
               (let ((b_0 (unsafe-bytes-ref v*_0 idx_0)))
                 (let ((result_1 (eqv? b_0 92)))
                   (let ((result_2 (values result_1)))
                     (if (if (not (let ((x_0 (list b_0))) (not result_2)))
                           #t
                           #f)
                       (for-loop_0 result_2 (unsafe-fx+ idx_0 1))
                       result_2))))
               result_0)))))
        (for-loop_0 #t start*_0))))))
(define drive?
  (lambda (s_0)
    (if (starting-point? s_0)
      (starting-point-drive? s_0)
      (let ((c2_0 (parse-unc.1 #f #f s_0 0)))
        (if c2_0
          (just-separators-after? s_0 c2_0)
          (if (letter-drive-start? s_0 (unsafe-bytes-length s_0))
            (just-separators-after? s_0 2)
            #f))))))
(define finish_3672
  (make-struct-type-install-properties
   '(starting-point)
   7
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1 2 3 4 5 6)
   #f
   'starting-point))
(define struct:starting-point
  (make-record-type-descriptor
   'starting-point
   #f
   (|#%nongenerative-uid| starting-point)
   #f
   #f
   '(7 . 0)))
(define effect_2521 (finish_3672 struct:starting-point))
(define starting-point7.1
  (|#%name|
   starting-point
   (record-constructor
    (make-record-constructor-descriptor struct:starting-point #f #f))))
(define starting-point?_2697
  (|#%name| starting-point? (record-predicate struct:starting-point)))
(define starting-point?
  (|#%name|
   starting-point?
   (lambda (v)
     (if (starting-point?_2697 v)
       #t
       ($value
        (if (impersonator? v)
          (starting-point?_2697 (impersonator-val v))
          #f))))))
(define starting-point-kind_3029
  (|#%name| starting-point-kind (record-accessor struct:starting-point 0)))
(define starting-point-kind
  (|#%name|
   starting-point-kind
   (lambda (s)
     (if (starting-point?_2697 s)
       (starting-point-kind_3029 s)
       ($value
        (impersonate-ref
         starting-point-kind_3029
         struct:starting-point
         0
         s
         'kind))))))
(define starting-point-bstr_2482
  (|#%name| starting-point-bstr (record-accessor struct:starting-point 1)))
(define starting-point-bstr
  (|#%name|
   starting-point-bstr
   (lambda (s)
     (if (starting-point?_2697 s)
       (starting-point-bstr_2482 s)
       ($value
        (impersonate-ref
         starting-point-bstr_2482
         struct:starting-point
         1
         s
         'bstr))))))
(define starting-point-len_2128
  (|#%name| starting-point-len (record-accessor struct:starting-point 2)))
(define starting-point-len
  (|#%name|
   starting-point-len
   (lambda (s)
     (if (starting-point?_2697 s)
       (starting-point-len_2128 s)
       ($value
        (impersonate-ref
         starting-point-len_2128
         struct:starting-point
         2
         s
         'len))))))
(define starting-point-orig-len_2772
  (|#%name| starting-point-orig-len (record-accessor struct:starting-point 3)))
(define starting-point-orig-len
  (|#%name|
   starting-point-orig-len
   (lambda (s)
     (if (starting-point?_2697 s)
       (starting-point-orig-len_2772 s)
       ($value
        (impersonate-ref
         starting-point-orig-len_2772
         struct:starting-point
         3
         s
         'orig-len))))))
(define starting-point-extra-sep_1722
  (|#%name|
   starting-point-extra-sep
   (record-accessor struct:starting-point 4)))
(define starting-point-extra-sep
  (|#%name|
   starting-point-extra-sep
   (lambda (s)
     (if (starting-point?_2697 s)
       (starting-point-extra-sep_1722 s)
       ($value
        (impersonate-ref
         starting-point-extra-sep_1722
         struct:starting-point
         4
         s
         'extra-sep))))))
(define starting-point-add-ups?_2423
  (|#%name| starting-point-add-ups? (record-accessor struct:starting-point 5)))
(define starting-point-add-ups?
  (|#%name|
   starting-point-add-ups?
   (lambda (s)
     (if (starting-point?_2697 s)
       (starting-point-add-ups?_2423 s)
       ($value
        (impersonate-ref
         starting-point-add-ups?_2423
         struct:starting-point
         5
         s
         'add-ups?))))))
(define starting-point-drive?_2742
  (|#%name| starting-point-drive? (record-accessor struct:starting-point 6)))
(define starting-point-drive?
  (|#%name|
   starting-point-drive?
   (lambda (s)
     (if (starting-point?_2697 s)
       (starting-point-drive?_2742 s)
       ($value
        (impersonate-ref
         starting-point-drive?_2742
         struct:starting-point
         6
         s
         'drive?))))))
(define make-starting-point.1
  (|#%name|
   make-starting-point
   (lambda (add-ups?10_0
            drive?11_0
            extra-sep9_0
            orig-len8_0
            kind16_0
            bstr17_0
            len18_0)
     (let ((orig-len_0
            (if (eq? orig-len8_0 unsafe-undefined) len18_0 orig-len8_0)))
       (list
        (starting-point7.1
         kind16_0
         bstr17_0
         len18_0
         orig-len_0
         extra-sep9_0
         add-ups?10_0
         drive?11_0))))))
(define combine-build-elements
  (lambda (elems_0 unc-result?_0)
    (if (starting-point? (car elems_0))
      (let ((s_0 (car elems_0)))
        (if (null? (cdr elems_0))
          (let ((bstr_0
                 (let ((app_0 (starting-point-bstr s_0)))
                   (subbytes app_0 0 (starting-point-orig-len s_0)))))
            (if (equal? bstr_0 #vu8(92 92 63 92 82 69 76))
              #vu8(46)
              (if (equal? bstr_0 #vu8(92 92 63 92 82 69 68))
                #vu8(92)
                (let ((tmp_0 (starting-point-kind s_0)))
                  (if (if (eq? tmp_0 'rel) #t (eq? tmp_0 'unc))
                    (if (eqv?
                         (unsafe-bytes-ref
                          bstr_0
                          (sub1 (unsafe-bytes-length bstr_0)))
                         92)
                      bstr_0
                      (bytes-append bstr_0 #vu8(92)))
                    bstr_0)))))
          (let ((init-bstr_0
                 (let ((app_0 (starting-point-bstr s_0)))
                   (subbytes app_0 0 (starting-point-len s_0)))))
            (let ((app_0
                   (let ((tmp_0 (starting-point-kind s_0)))
                     (if (if (eq? tmp_0 'rel) #t (eq? tmp_0 'red)) #vu8(92) #vu8()))))
              (let ((app_1 (starting-point-extra-sep s_0)))
                (apply bytes-append init-bstr_0 app_0 app_1 (cdr elems_0)))))))
      (let ((bstr_0 (apply bytes-append elems_0)))
        (if (backslash-backslash-questionmark? bstr_0)
          (subbytes bstr_0 1)
          (if (if (not unc-result?_0) (parse-unc.1 #f #f bstr_0 0) #f)
            (subbytes bstr_0 1)
            bstr_0))))))
(define convert-to-initial-backslash-backslash-questionmark
  (lambda (bstr_0)
    (if (backslash-backslash-questionmark? bstr_0)
      (call-with-values
       (lambda () (parse-backslash-backslash-questionmark bstr_0))
       (lambda (kind_0
                drive-len_0
                orig-drive-len_0
                clean-start-pos_0
                add-sep_0)
         (if (if (eq? kind_0 'abs) #t (eq? kind_0 'unc))
           (let ((app_0
                  (1/reverse
                   (extract-separate-parts.1 #t #f bstr_0 drive-len_0))))
             (append
              app_0
              (if (equal? add-sep_0 #vu8())
                (let ((temp60_0 (sub1 drive-len_0)))
                  (make-starting-point.1
                   #f
                   #t
                   #vu8()
                   orig-drive-len_0
                   kind_0
                   bstr_0
                   temp60_0))
                (let ((temp66_0 (subbytes add-sep_0 1)))
                  (make-starting-point.1
                   #f
                   #t
                   temp66_0
                   orig-drive-len_0
                   kind_0
                   bstr_0
                   drive-len_0)))))
           (call-with-values
            (lambda ()
              (backslash-backslash-questionmark-dot-ups-end
               bstr_0
               (unsafe-bytes-length bstr_0)))
            (lambda (dots-end_0 literal-start_0)
              (let ((app_0
                     (1/reverse
                      (extract-separate-parts.1
                       #t
                       #f
                       bstr_0
                       literal-start_0))))
                (append
                 app_0
                 (let ((temp72_0 (if dots-end_0 dots-end_0 7)))
                   (let ((temp73_0 (eq? kind_0 'rel)))
                     (make-starting-point.1
                      temp73_0
                      #f
                      #vu8()
                      unsafe-undefined
                      kind_0
                      bstr_0
                      temp72_0))))))))))
      (let ((c3_0 (parse-unc.1 #f #f bstr_0 0)))
        (if c3_0
          (call-with-values
           (lambda ()
             (let ((l_0
                    (let ((temp77_0 (subbytes bstr_0 0 c3_0)))
                      (extract-separate-parts.1 #f #f temp77_0 0))))
               (let ((app_0 (car l_0))) (values app_0 (cadr l_0)))))
           (lambda (machine_0 volume_0)
             (let ((app_0
                    (1/reverse
                     (let ((temp79_0
                            (extract-separate-parts.1 #f #f bstr_0 c3_0)))
                       (simplify-dots.1 #t temp79_0)))))
               (append
                app_0
                (let ((unc-bstr_0
                       (bytes-append
                        #vu8(92 92 63 92 85 78 67)
                        machine_0
                        volume_0)))
                  (let ((unc-len_0 (unsafe-bytes-length unc-bstr_0)))
                    (make-starting-point.1
                     #f
                     #t
                     #vu8()
                     unsafe-undefined
                     'unc
                     unc-bstr_0
                     unc-len_0)))))))
          (if (bytes=? #vu8(46) bstr_0)
            (let ((temp87_0 #vu8(92 92 63 92 82 69 76)))
              (make-starting-point.1 #t #f #vu8() unsafe-undefined 'rel temp87_0 7))
            (if (bytes=? #vu8(46 46) bstr_0)
              (let ((temp92_0 #vu8(92 92 63 92 82 69 76 92 46 46)))
                (make-starting-point.1
                 #t
                 #f
                 #vu8()
                 unsafe-undefined
                 'rel
                 temp92_0
                 10))
              (if (is-sep? (unsafe-bytes-ref bstr_0 0) 'windows)
                (let ((app_0
                       (1/reverse (extract-separate-parts.1 #f #f bstr_0 0))))
                  (append
                   app_0
                   (let ((temp99_0 #vu8(92 92 63 92 82 69 68)))
                     (make-starting-point.1
                      #f
                      #f
                      #vu8()
                      unsafe-undefined
                      'red
                      temp99_0
                      7))))
                (if (if (>= (unsafe-bytes-length bstr_0) 2)
                      (if (drive-letter? (unsafe-bytes-ref bstr_0 0))
                        (eqv? (unsafe-bytes-ref bstr_0 1) 58)
                        #f)
                      #f)
                  (let ((app_0
                         (1/reverse
                          (let ((temp102_0
                                 (extract-separate-parts.1 #f #f bstr_0 2)))
                            (simplify-dots.1 #t temp102_0)))))
                    (append
                     app_0
                     (let ((drive-bstr_0
                            (bytes-append
                             #vu8(92 92 63 92)
                             (subbytes bstr_0 0 2)
                             #vu8(92))))
                       (make-starting-point.1 #f #t #vu8() 7 'abs drive-bstr_0 6))))
                  (let ((elems_0
                         (let ((temp110_0
                                (extract-separate-parts.1 #f #f bstr_0 0)))
                           (simplify-dots.1 #f temp110_0))))
                    (letrec*
                     ((loop_0
                       (|#%name|
                        loop
                        (lambda (dots_0 elems_1)
                          (if (let ((or-part_0 (null? elems_1)))
                                (if or-part_0
                                  or-part_0
                                  (not (eq? (car elems_1) 'up))))
                            (let ((app_0 (1/reverse elems_1)))
                              (append
                               app_0
                               (let ((rel-bstr_0
                                      (apply
                                       bytes-append
                                       #vu8(92 92 63 92 82 69 76)
                                       dots_0)))
                                 (let ((rel-len_0
                                        (unsafe-bytes-length rel-bstr_0)))
                                   (make-starting-point.1
                                    #t
                                    #f
                                    #vu8()
                                    unsafe-undefined
                                    'rel
                                    rel-bstr_0
                                    rel-len_0)))))
                            (let ((app_0 (cons (car elems_1) dots_0)))
                              (loop_0 app_0 (cdr elems_1))))))))
                     (loop_0 null elems_0))))))))))))
(define extract-separate-parts.1
  (|#%name|
   extract-separate-parts
   (lambda (bbq-mode?20_0 keep-trailing-separator?21_0 bstr24_0 pos25_0)
     (let ((is-a-sep?_0
            (|#%name|
             is-a-sep?
             (lambda (b_0)
               (if bbq-mode?20_0 (eqv? b_0 92) (is-sep? b_0 'windows))))))
       (let ((len_0 (unsafe-bytes-length bstr24_0)))
         (letrec*
          ((loop_0
            (|#%name|
             loop
             (lambda (pos_0)
               (if (= pos_0 len_0)
                 null
                 (if (is-a-sep?_0 (unsafe-bytes-ref bstr24_0 pos_0))
                   (loop_0 (add1 pos_0))
                   (letrec*
                    ((e-loop_0
                      (|#%name|
                       e-loop
                       (lambda (end-pos_0)
                         (if (let ((or-part_0 (= end-pos_0 len_0)))
                               (if or-part_0
                                 or-part_0
                                 (is-a-sep?_0
                                  (unsafe-bytes-ref bstr24_0 end-pos_0))))
                           (let ((rest_0 (loop_0 end-pos_0)))
                             (let ((elem-bstr_0
                                    (subbytes bstr24_0 pos_0 end-pos_0)))
                               (let ((new-bstr_0
                                      (if (if (null? rest_0)
                                            (not bbq-mode?20_0)
                                            #f)
                                        (strip-trailing-spaces elem-bstr_0)
                                        elem-bstr_0)))
                                 (let ((new-sub_0
                                        (if (if (not bbq-mode?20_0)
                                              (bytes=? new-bstr_0 #vu8(46))
                                              #f)
                                          'same
                                          (if (if (not bbq-mode?20_0)
                                                (bytes=? new-bstr_0 #vu8(46 46))
                                                #f)
                                            'up
                                            (if (if keep-trailing-separator?21_0
                                                  (if (null? rest_0)
                                                    (< end-pos_0 len_0)
                                                    #f)
                                                  #f)
                                              (bytes-append #vu8(92) new-bstr_0 #vu8(92))
                                              (bytes-append
                                               #vu8(92)
                                               new-bstr_0))))))
                                   (cons new-sub_0 rest_0)))))
                           (e-loop_0 (add1 end-pos_0)))))))
                    (e-loop_0 (add1 pos_0)))))))))
          (loop_0 pos25_0)))))))
(define extract-dot-ups
  (lambda (bstr_0 start_0 dots-end_0)
    (if (= start_0 dots-end_0)
      '()
      (letrec*
       ((loop_0
         (|#%name|
          loop
          (lambda (i_0)
            (if (>= i_0 dots-end_0)
              '()
              (if (if (eqv? (unsafe-bytes-ref bstr_0 i_0) 46)
                    (eqv? (unsafe-bytes-ref bstr_0 (sub1 i_0)) 46)
                    #f)
                (cons 'up (loop_0 (add1 i_0)))
                (loop_0 (add1 i_0))))))))
       (loop_0 (add1 start_0))))))
(define starting-point-add-up
  (lambda (s_0)
    (if (starting-point-add-ups? s_0)
      (let ((bstr_0
             (bytes-append
              (let ((app_0 (starting-point-bstr s_0)))
                (subbytes app_0 0 (starting-point-len s_0)))
              #vu8(92 46 46))))
        (let ((len_0 (unsafe-bytes-length bstr_0)))
          (if (starting-point? s_0)
            (let ((app_0 (starting-point-kind s_0)))
              (let ((app_1 (starting-point-extra-sep s_0)))
                (let ((app_2 (starting-point-add-ups? s_0)))
                  (starting-point7.1
                   app_0
                   bstr_0
                   len_0
                   len_0
                   app_1
                   app_2
                   (starting-point-drive? s_0)))))
            (raise-argument-error 'struct-copy "starting-point?" s_0))))
      s_0)))
(define simplify-dots.1
  (|#%name|
   simplify-dots
   (lambda (drop-leading?27_0 bstrs29_0)
     (letrec*
      ((loop_0
        (|#%name|
         loop
         (lambda (bstrs_0 accum_0)
           (if (null? bstrs_0)
             (1/reverse accum_0)
             (if (eq? 'same (car bstrs_0))
               (loop_0 (cdr bstrs_0) accum_0)
               (if (eq? 'up (car bstrs_0))
                 (if (null? accum_0)
                   (if drop-leading?27_0
                     (loop_0 (cdr bstrs_0) accum_0)
                     (let ((app_0 (cdr bstrs_0)))
                       (loop_0 app_0 (cons (car bstrs_0) accum_0))))
                   (let ((app_0 (cdr bstrs_0))) (loop_0 app_0 (cdr accum_0))))
                 (let ((app_0 (cdr bstrs_0)))
                   (loop_0 app_0 (cons (car bstrs_0) accum_0))))))))))
      (loop_0 bstrs29_0 null)))))
(define path->complete-path.1
  (|#%name|
   path->complete-path
   (lambda (wrt-given?1_0 p-in3_0 wrt4_0)
     (begin
       (check-path-argument 'path->complete-path p-in3_0)
       (begin
         (if wrt-given?1_0
           (if (if (let ((or-part_0 (path-string? wrt4_0)))
                     (if or-part_0 or-part_0 (1/path? wrt4_0)))
                 (1/complete-path? wrt4_0)
                 #f)
             (void)
             (raise-argument-error
              'path->complete-path
              "(and/c (or/c path-string? path-for-some-system?) complete-path?)"
              wrt4_0))
           (void))
         (begin
           (if (let ((app_0 (convention-of-path p-in3_0)))
                 (eq?
                  app_0
                  (if (procedure? wrt4_0)
                    (system-path-convention-type)
                    (convention-of-path wrt4_0))))
             (void)
             (if wrt-given?1_0
               (raise-arguments-error
                'path->complete-path
                "convention of first path incompatible with convention of second path"
                "first path"
                p-in3_0
                "second path"
                wrt4_0)
               (raise-arguments-error
                'path->complete-path
                "no second path supplied, and given path is not for the current platform"
                "given path"
                p-in3_0)))
           (let ((p_0 (->path p-in3_0)))
             (if (1/complete-path? p_0)
               p_0
               (if (1/relative-path? p_0)
                 (1/build-path
                  (if (procedure? wrt4_0) (|#%app| wrt4_0) wrt4_0)
                  p_0)
                 (let ((wrt-path_0
                        (->path
                         (if (procedure? wrt4_0) (|#%app| wrt4_0) wrt4_0))))
                   (let ((drive_0 (split-drive (path-bytes wrt-path_0))))
                     (1/build-path (path1.1 drive_0 'windows) p_0))))))))))))
(define convention-of-path
  (lambda (p_0)
    (if (1/path? p_0) (path-convention p_0) (system-path-convention-type))))
(define current-directory$1
  (make-parameter
   (let ((tmp_0 (system-path-convention-type)))
     (if (eq? tmp_0 'unix)
       (path1.1 #vu8(47) 'unix)
       (if (eq? tmp_0 'windows) (path1.1 #vu8(67 58 92) 'windows) (void))))
   (lambda (v_0) (check-directory-path 'current-directory v_0))
   'current-directory))
(define current-directory-for-user$1
  (make-parameter
   (current-directory$1)
   (lambda (v_0) (check-directory-path 'current-directory-for-user v_0))
   'current-directory-for-user))
(define current-load-relative-directory$1
  (make-parameter
   #f
   (lambda (v_0)
     (begin
       (if (let ((or-part_0 (not v_0)))
             (if or-part_0 or-part_0 (path-string? v_0)))
         (void)
         (raise-argument-error
          'current-load-relative-directory
          "(or/c path-string? #f)"
          v_0))
       (if v_0
         (let ((temp5_0 (current-directory$1)))
           (path->complete-path.1 #t v_0 temp5_0))
         #f)))
   'current-load-relative-directory))
(define check-directory-path
  (lambda (who_0 v_0)
    (begin
      (if (path-string? v_0)
        (void)
        (raise-argument-error who_0 "path-string?" v_0))
      (let ((temp7_0 (current-directory$1)))
        (path->complete-path.1 #t v_0 temp7_0)))))
(define 1/cleanse-path
  (|#%name|
   cleanse-path
   (lambda (p-in_0)
     (begin
       (check-path-argument 'cleanse-path p-in_0)
       (do-cleanse-path (->path p-in_0) #f)))))
(define cleanse-path/convert-slashes (lambda (p_0) (do-cleanse-path p_0 #t)))
(define do-cleanse-path
  (lambda (p_0 convert-slashes?_0)
    (let ((convention_0 (path-convention p_0)))
      (let ((return_0
             (|#%name|
              return
              (lambda (bstr_0)
                (if (eq? bstr_0 (path-bytes p_0))
                  p_0
                  (path1.1 bstr_0 convention_0))))))
        (let ((bstr_0 (path-bytes p_0)))
          (if (eq? convention_0 'unix)
            (return_0 (clean-double-slashes.1 #f #f bstr_0 'unix 0))
            (if (eq? convention_0 'windows)
              (if (backslash-backslash-questionmark? bstr_0)
                (call-with-values
                 (lambda ()
                   (parse-backslash-backslash-questionmark (path-bytes p_0)))
                 (lambda (kind_0
                          drive-len_0
                          orig-drive-len_0
                          clean-start-pos_0
                          sep-bstr_0)
                   (if clean-start-pos_0
                     (return_0
                      (clean-double-slashes.1
                       #t
                       #f
                       bstr_0
                       'windows
                       clean-start-pos_0))
                     (call-with-values
                      (lambda ()
                        (backslash-backslash-questionmark-dot-ups-end
                         bstr_0
                         (unsafe-bytes-length bstr_0)))
                      (lambda (dots-end_0 literal-start_0)
                        (let ((new-bstr_0
                               (clean-double-slashes.1
                                #t
                                #f
                                bstr_0
                                'windows
                                literal-start_0)))
                          (let ((has-extra-backslash?_0
                                 (if (eqv?
                                      (unsafe-bytes-ref
                                       bstr_0
                                       (- literal-start_0 1))
                                      92)
                                   (eqv?
                                    (unsafe-bytes-ref
                                     bstr_0
                                     (- literal-start_0 2))
                                    92)
                                   #f)))
                            (if has-extra-backslash?_0
                              (return_0 new-bstr_0)
                              (if (=
                                   literal-start_0
                                   (unsafe-bytes-length new-bstr_0))
                                (return_0 new-bstr_0)
                                (return_0
                                 (let ((app_0
                                        (subbytes
                                         new-bstr_0
                                         0
                                         literal-start_0)))
                                   (bytes-append
                                    app_0
                                    #vu8(92)
                                    (subbytes
                                     new-bstr_0
                                     literal-start_0)))))))))))))
                (let ((c1_0 (parse-unc.1 #f #f bstr_0 0)))
                  (if c1_0
                    (return_0
                     (let ((temp25_0 (sub1 c1_0)))
                       (let ((temp26_0 (if convert-slashes?_0 0 #f)))
                         (let ((temp25_1 temp25_0))
                           (clean-double-slashes.1
                            #f
                            temp26_0
                            bstr_0
                            'windows
                            temp25_1)))))
                    (if (letter-drive-start?
                         bstr_0
                         (unsafe-bytes-length bstr_0))
                      (if (if (> (unsafe-bytes-length bstr_0) 2)
                            (is-sep? (unsafe-bytes-ref bstr_0 2) 'windows)
                            #f)
                        (return_0
                         (let ((temp30_0 (if convert-slashes?_0 2 #f)))
                           (clean-double-slashes.1
                            #f
                            temp30_0
                            bstr_0
                            'windows
                            2)))
                        (return_0
                         (let ((app_0 (subbytes bstr_0 0 2)))
                           (bytes-append
                            app_0
                            #vu8(92)
                            (let ((temp31_0 (subbytes bstr_0 2)))
                              (let ((temp34_0 (if convert-slashes?_0 0 #f)))
                                (let ((temp31_1 temp31_0))
                                  (clean-double-slashes.1
                                   #f
                                   temp34_0
                                   temp31_1
                                   'windows
                                   0))))))))
                      (return_0
                       (let ((temp38_0 (if convert-slashes?_0 0 #f)))
                         (clean-double-slashes.1
                          #f
                          temp38_0
                          bstr_0
                          'windows
                          0)))))))
              (void))))))))
(define clean-double-slashes.1
  (|#%name|
   clean-double-slashes
   (lambda (only-backslash?1_0
            to-backslash-from2_0
            bstr5_0
            convention6_0
            allow-double-before7_0)
     (let ((is-a-sep?_0
            (|#%name|
             is-a-sep?
             (lambda (b_0)
               (if only-backslash?1_0
                 (eqv? b_0 92)
                 (is-sep? b_0 convention6_0))))))
       (let ((extra-count_0
              (letrec*
               ((loop_0
                 (|#%name|
                  loop
                  (lambda (i_0)
                    (if (<= i_0 allow-double-before7_0)
                      0
                      (if (if (is-a-sep?_0 (unsafe-bytes-ref bstr5_0 i_0))
                            (is-a-sep?_0 (unsafe-bytes-ref bstr5_0 (sub1 i_0)))
                            #f)
                        (add1 (loop_0 (sub1 i_0)))
                        (loop_0 (sub1 i_0))))))))
               (loop_0 (sub1 (unsafe-bytes-length bstr5_0))))))
         (if (if (zero? extra-count_0)
               (let ((or-part_0 (not to-backslash-from2_0)))
                 (if or-part_0
                   or-part_0
                   (not
                    (call-with-values
                     (lambda ()
                       (unsafe-normalise-inputs
                        unsafe-bytes-length
                        bstr5_0
                        to-backslash-from2_0
                        #f
                        1))
                     (lambda (v*_0 start*_0 stop*_0 step*_0)
                       (letrec*
                        ((for-loop_0
                          (|#%name|
                           for-loop
                           (lambda (result_0 idx_0)
                             (if (unsafe-fx< idx_0 stop*_0)
                               (let ((b_0 (unsafe-bytes-ref v*_0 idx_0)))
                                 (let ((result_1 (eq? b_0 47)))
                                   (let ((result_2 (values result_1)))
                                     (if (if (not
                                              (let ((x_0 (list b_0)))
                                                result_2))
                                           #t
                                           #f)
                                       (for-loop_0
                                        result_2
                                        (unsafe-fx+ idx_0 1))
                                       result_2))))
                               result_0)))))
                        (for-loop_0 #f start*_0)))))))
               #f)
           bstr5_0
           (let ((new-bstr_0
                  (make-bytes
                   (- (unsafe-bytes-length bstr5_0) extra-count_0))))
             (begin
               (letrec*
                ((loop_0
                  (|#%name|
                   loop
                   (lambda (i_0 j_0)
                     (if (<= i_0 allow-double-before7_0)
                       (void)
                       (if (is-a-sep?_0 (unsafe-bytes-ref bstr5_0 i_0))
                         (if (is-a-sep?_0
                              (unsafe-bytes-ref bstr5_0 (sub1 i_0)))
                           (loop_0 (sub1 i_0) j_0)
                           (begin
                             (if to-backslash-from2_0
                               (unsafe-bytes-set! new-bstr_0 j_0 92)
                               (unsafe-bytes-set!
                                new-bstr_0
                                j_0
                                (unsafe-bytes-ref bstr5_0 i_0)))
                             (let ((app_0 (sub1 i_0)))
                               (loop_0 app_0 (sub1 j_0)))))
                         (begin
                           (unsafe-bytes-set!
                            new-bstr_0
                            j_0
                            (unsafe-bytes-ref bstr5_0 i_0))
                           (let ((app_0 (sub1 i_0)))
                             (loop_0 app_0 (sub1 j_0))))))))))
                (let ((app_0 (sub1 (unsafe-bytes-length bstr5_0))))
                  (loop_0 app_0 (sub1 (unsafe-bytes-length new-bstr_0)))))
               (if to-backslash-from2_0
                 (begin
                   (unsafe-bytes-copy!
                    new-bstr_0
                    0
                    bstr5_0
                    0
                    to-backslash-from2_0)
                   (let ((end_0 (add1 allow-double-before7_0)))
                     (letrec*
                      ((for-loop_0
                        (|#%name|
                         for-loop
                         (lambda (pos_0)
                           (if (< pos_0 end_0)
                             (begin
                               (let ((b_0 (unsafe-bytes-ref bstr5_0 pos_0)))
                                 (if (eqv? b_0 47)
                                   (unsafe-bytes-set! new-bstr_0 pos_0 92)
                                   (unsafe-bytes-set! new-bstr_0 pos_0 b_0)))
                               (for-loop_0 (+ pos_0 1)))
                             (values))))))
                      (for-loop_0 to-backslash-from2_0)))
                   (void))
                 (unsafe-bytes-copy!
                  new-bstr_0
                  0
                  bstr5_0
                  0
                  (add1 allow-double-before7_0)))
               new-bstr_0))))))))
(define protect-path-element
  (lambda (bstr_0 convention_0)
    (if (eq? convention_0 'windows)
      (if (needs-protect? bstr_0)
        (bytes-append #vu8(92 92 63 92 82 69 76 92 92) bstr_0)
        bstr_0)
      bstr_0)))
(define needs-protect?
  (lambda (bstr_0)
    (let ((len_0 (unsafe-bytes-length bstr_0)))
      (if (if (eqv? len_0 1) (eqv? (unsafe-bytes-ref bstr_0 0) 46) #f)
        #t
        (if (if (eqv? len_0 2)
              (if (eqv? (unsafe-bytes-ref bstr_0 0) 46)
                (eqv? (unsafe-bytes-ref bstr_0 1) 46)
                #f)
              #f)
          #t
          (if (special-filename?.1 #t bstr_0)
            #t
            (letrec*
             ((loop_0
               (|#%name|
                loop
                (lambda (i+1_0 at-end?_0)
                  (if (zero? i+1_0)
                    #f
                    (let ((i_0 (sub1 i+1_0)))
                      (let ((b_0 (unsafe-bytes-ref bstr_0 i_0)))
                        (if (if at-end?_0
                              (let ((or-part_0 (eqv? b_0 46)))
                                (if or-part_0 or-part_0 (eqv? b_0 32)))
                              #f)
                          #t
                          (if (let ((or-part_0 (eqv? b_0 47)))
                                (if or-part_0
                                  or-part_0
                                  (let ((or-part_1 (eqv? b_0 34)))
                                    (if or-part_1
                                      or-part_1
                                      (let ((or-part_2 (eqv? b_0 124)))
                                        (if or-part_2
                                          or-part_2
                                          (let ((or-part_3 (eqv? b_0 58)))
                                            (if or-part_3
                                              or-part_3
                                              (let ((or-part_4 (eqv? b_0 60)))
                                                (if or-part_4
                                                  or-part_4
                                                  (let ((or-part_5
                                                         (eqv? b_0 62)))
                                                    (if or-part_5
                                                      or-part_5
                                                      (let ((or-part_6
                                                             (eqv? b_0 63)))
                                                        (if or-part_6
                                                          or-part_6
                                                          (eqv?
                                                           b_0
                                                           42)))))))))))))))
                            #t
                            (loop_0 i_0 #f))))))))))
             (loop_0 len_0 #t))))))))
(define 1/split-path
  (|#%name|
   split-path
   (lambda (p_0)
     (begin
       (check-path-argument 'split-path p_0)
       (let ((temp35_0 (->path p_0))) (split.1 #f temp35_0))))))
(define 1/explode-path
  (|#%name|
   explode-path
   (lambda (p_0)
     (begin
       (check-path-argument 'explode-path p_0)
       (1/reverse (let ((temp37_0 (->path p_0))) (split.1 #t temp37_0)))))))
(define split.1
  (|#%name|
   split
   (lambda (explode?1_0 p3_0)
     (if (not (eq? (path-convention p3_0) 'windows))
       (split-after-drive.1 0 0 explode?1_0 unsafe-undefined #f #f #f p3_0)
       (let ((bstr_0 (path-bytes p3_0)))
         (if (if (> (unsafe-bytes-length bstr_0) 2)
               (if (is-sep? (unsafe-bytes-ref bstr_0 0) 'windows)
                 (is-sep? (unsafe-bytes-ref bstr_0 1) 'windows)
                 #f)
               #f)
           (call-with-values
            (lambda () (parse-//?-drive bstr_0))
            (lambda (//?-kind_0 //?-drive-end_0 //?-orig-drive-end_0)
              (if //?-kind_0
                (if (let ((or-part_0 (eq? //?-kind_0 'rel)))
                      (if or-part_0 or-part_0 (eq? //?-kind_0 'red)))
                  (split-reld.1 explode?1_0 bstr_0)
                  (let ((temp45_0
                         (if (eq? //?-kind_0 'unc)
                           //?-orig-drive-end_0
                           //?-drive-end_0)))
                    (split-after-drive.1
                     //?-orig-drive-end_0
                     //?-orig-drive-end_0
                     explode?1_0
                     temp45_0
                     #f
                     #t
                     #t
                     p3_0)))
                (let ((//-drive-end_0 (parse-//-drive bstr_0)))
                  (if //-drive-end_0
                    (let ((temp51_0
                           (if (if (<
                                    //-drive-end_0
                                    (unsafe-bytes-length bstr_0))
                                 (is-sep?
                                  (unsafe-bytes-ref bstr_0 //-drive-end_0)
                                  'windows)
                                 #f)
                             (add1 //-drive-end_0)
                             //-drive-end_0)))
                      (split-after-drive.1
                       1
                       temp51_0
                       explode?1_0
                       unsafe-undefined
                       #f
                       #f
                       #f
                       p3_0))
                    (split-after-drive.1
                     0
                     0
                     explode?1_0
                     unsafe-undefined
                     #f
                     #f
                     #f
                     p3_0))))))
           (if (if (>= (unsafe-bytes-length bstr_0) 2)
                 (if (drive-letter? (unsafe-bytes-ref bstr_0 0))
                   (eq? (unsafe-bytes-ref bstr_0 1) 58)
                   #f)
                 #f)
             (let ((temp57_0
                    (if (if (< 2 (unsafe-bytes-length bstr_0))
                          (is-sep? (unsafe-bytes-ref bstr_0 2) 'windows)
                          #f)
                      3
                      2)))
               (split-after-drive.1
                0
                temp57_0
                explode?1_0
                unsafe-undefined
                #f
                #f
                #f
                p3_0))
             (split-after-drive.1
              0
              0
              explode?1_0
              unsafe-undefined
              #f
              #f
              #f
              p3_0))))))))
(define split-after-drive.1
  (|#%name|
   split-after-drive
   (lambda (allow-double-before10_0
            drive-end6_0
            explode?11_0
            keep-drive-end7_0
            len5_0
            no-slash-sep?8_0
            no-up?9_0
            p19_0)
     (let ((keep-drive-end_0
            (if (eq? keep-drive-end7_0 unsafe-undefined)
              drive-end6_0
              keep-drive-end7_0)))
       (let ((convention_0 (path-convention p19_0)))
         (let ((bstr_0
                (if len5_0
                  (path-bytes p19_0)
                  (let ((temp61_0 (path-bytes p19_0)))
                    (clean-double-slashes.1
                     #f
                     #f
                     temp61_0
                     convention_0
                     allow-double-before10_0)))))
           (let ((len_0 (if len5_0 len5_0 (unsafe-bytes-length bstr_0))))
             (call-with-values
              (lambda ()
                (letrec*
                 ((loop_0
                   (|#%name|
                    loop
                    (lambda (i_0 ends-sep?_0)
                      (if (< i_0 drive-end6_0)
                        (if (if (positive? i_0) (< i_0 (sub1 len_0)) #f)
                          (values i_0 ends-sep?_0)
                          (values #f ends-sep?_0))
                        (let ((sep?_0
                               (if no-slash-sep?8_0
                                 (eq? (unsafe-bytes-ref bstr_0 i_0) 92)
                                 (is-sep?
                                  (unsafe-bytes-ref bstr_0 i_0)
                                  convention_0))))
                          (if sep?_0
                            (if (< i_0 (sub1 len_0))
                              (values i_0 ends-sep?_0)
                              (loop_0 (sub1 i_0) #t))
                            (loop_0 (sub1 i_0) ends-sep?_0))))))))
                 (loop_0 (sub1 len_0) #f)))
              (lambda (split-pos_0 ends-sep?_0)
                (if (not split-pos_0)
                  (if (let ((or-part_0
                             (is-sep?
                              (unsafe-bytes-ref bstr_0 0)
                              convention_0)))
                        (if or-part_0 or-part_0 (positive? drive-end6_0)))
                    (let ((new-p_0
                           (path1.1 (subbytes bstr_0 0 len_0) convention_0)))
                      (if explode?11_0 (list new-p_0) (values #f new-p_0 #t)))
                    (call-with-values
                     (lambda ()
                       (split-tail.1
                        ends-sep?_0
                        no-up?9_0
                        bstr_0
                        len_0
                        0
                        convention_0))
                     (lambda (name_0 is-dir?_0)
                       (if explode?11_0
                         (list name_0)
                         (values 'relative name_0 is-dir?_0)))))
                  (call-with-values
                   (lambda ()
                     (let ((temp72_0 (add1 split-pos_0)))
                       (split-tail.1
                        ends-sep?_0
                        no-up?9_0
                        bstr_0
                        len_0
                        temp72_0
                        convention_0)))
                   (lambda (name_0 is-dir?_0)
                     (if (zero? split-pos_0)
                       (let ((base_0
                              (if (eq? (unsafe-bytes-ref bstr_0 0) '#\x2f)
                                (path1.1 #vu8(47) convention_0)
                                (path1.1 (subbytes bstr_0 0 1) convention_0))))
                         (if explode?11_0
                           (list name_0 base_0)
                           (values base_0 name_0 is-dir?_0)))
                       (call-with-values
                        (lambda ()
                          (values
                           bstr_0
                           (let ((len_1 (add1 split-pos_0)))
                             (if (= len_1 drive-end6_0)
                               keep-drive-end_0
                               len_1))))
                        (lambda (exposed-bstr_0 exposed-len_0)
                          (if explode?11_0
                            (cons
                             name_0
                             (let ((temp76_0
                                    (path1.1 exposed-bstr_0 convention_0)))
                               (split-after-drive.1
                                allow-double-before10_0
                                drive-end6_0
                                #t
                                keep-drive-end_0
                                exposed-len_0
                                no-slash-sep?8_0
                                no-up?9_0
                                temp76_0)))
                            (let ((base_0
                                   (path1.1
                                    (subbytes exposed-bstr_0 0 exposed-len_0)
                                    convention_0)))
                              (values base_0 name_0 is-dir?_0))))))))))))))))))
(define split-tail.1
  (|#%name|
   split-tail
   (lambda (ends-sep?21_0
            no-up?22_0
            bstr25_0
            len26_0
            start-pos27_0
            convention28_0)
     (if (if (not no-up?22_0)
           (if (<= (+ start-pos27_0 2) len26_0)
             (if (eq? (unsafe-bytes-ref bstr25_0 start-pos27_0) 46)
               (if (eq? (unsafe-bytes-ref bstr25_0 (+ start-pos27_0 1)) 46)
                 (let ((or-part_0 (= (+ start-pos27_0 2) len26_0)))
                   (if or-part_0
                     or-part_0
                     (if (= (+ start-pos27_0 3) len26_0) ends-sep?21_0 #f)))
                 #f)
               #f)
             #f)
           #f)
       (values 'up #t)
       (if (if (not no-up?22_0)
             (if (<= (+ start-pos27_0 1) len26_0)
               (if (eq? (unsafe-bytes-ref bstr25_0 start-pos27_0) 46)
                 (let ((or-part_0 (= (+ start-pos27_0 1) len26_0)))
                   (if or-part_0
                     or-part_0
                     (if (= (+ start-pos27_0 2) len26_0) ends-sep?21_0 #f)))
                 #f)
               #f)
             #f)
         (values 'same #t)
         (let ((new-bstr_0
                (if ends-sep?21_0
                  (subbytes bstr25_0 start-pos27_0 (sub1 len26_0))
                  (if (zero? start-pos27_0)
                    (bytes->immutable-bytes bstr25_0)
                    (subbytes bstr25_0 start-pos27_0)))))
           (let ((prot-bstr_0
                  (if (if no-up?22_0 no-up?22_0 ends-sep?21_0)
                    (protect-path-element new-bstr_0 convention28_0)
                    new-bstr_0)))
             (values (path1.1 prot-bstr_0 convention28_0) ends-sep?21_0))))))))
(define parse-//?-drive
  (lambda (bstr_0)
    (call-with-values
     (lambda () (parse-backslash-backslash-questionmark bstr_0))
     (lambda (kind_0
              drive-len_0
              orig-drive-len_0
              clean-start-pos_0
              add-sep-pos_0)
       (values kind_0 drive-len_0 orig-drive-len_0)))))
(define parse-//-drive (lambda (bstr_0) (parse-unc.1 #f #f bstr_0 0)))
(define split-reld.1
  (|#%name|
   split-reld
   (lambda (explode?30_0 bstr32_0)
     (letrec*
      ((explode-loop_0
        (|#%name|
         explode-loop
         (lambda (bstr_0)
           (call-with-values
            (lambda ()
              (let ((len_0 (unsafe-bytes-length bstr_0)))
                (if (eqv? (unsafe-bytes-ref bstr_0 (sub1 len_0)) 92)
                  (values (sub1 len_0) #t)
                  (values len_0 #f))))
            (lambda (len_0 is-dir?_0)
              (call-with-values
               (lambda ()
                 (backslash-backslash-questionmark-dot-ups-end bstr_0 len_0))
               (lambda (dots-end_0 literal-start_0)
                 (if (< literal-start_0 len_0)
                   (letrec*
                    ((loop_0
                      (|#%name|
                       loop
                       (lambda (p_0)
                         (if (<
                              p_0
                              (if dots-end_0
                                (sub1 literal-start_0)
                                literal-start_0))
                           (if (eqv? (unsafe-bytes-ref bstr_0 6) 76)
                             (let ((elem_0
                                    (path1.1
                                     (if is-dir?_0
                                       (subbytes bstr_0 0 len_0)
                                       bstr_0)
                                     'windows)))
                               (if explode?30_0
                                 (list elem_0)
                                 (values 'relative elem_0 is-dir?_0)))
                             (let ((base_0 (path1.1 #vu8(92) 'windows)))
                               (let ((elem_0
                                      (path1.1
                                       (let ((app_0
                                              (if (eqv?
                                                   (unsafe-bytes-ref bstr_0 8)
                                                   92)
                                                #vu8()
                                                #vu8(92))))
                                         (bytes-append
                                          #vu8(92 92 63 92 82 69 76 92)
                                          app_0
                                          (subbytes
                                           bstr_0
                                           8
                                           (let ((len_1
                                                  (unsafe-bytes-length
                                                   bstr_0)))
                                             (if is-dir?_0
                                               (sub1 len_1)
                                               len_1)))))
                                       'windows)))
                                 (if explode?30_0
                                   (list elem_0 base_0)
                                   (values base_0 elem_0 is-dir?_0)))))
                           (if (eqv? (unsafe-bytes-ref bstr_0 p_0) 92)
                             (let ((elem-bstr_0
                                    (bytes-append
                                     #vu8(92 92 63 92 82 69 76 92 92)
                                     (subbytes bstr_0 (add1 p_0) len_0))))
                               (let ((nsep_0
                                      (if (let ((or-part_0
                                                 (eqv? dots-end_0 p_0)))
                                            (if or-part_0
                                              or-part_0
                                              (eqv? dots-end_0 (sub1 p_0))))
                                        (if (eqv? dots-end_0 p_0) 0 -1)
                                        (if (eqv?
                                             (unsafe-bytes-ref bstr_0 6)
                                             76)
                                          1
                                          (if (eqv?
                                               (unsafe-bytes-ref
                                                bstr_0
                                                (sub1 p_0))
                                               92)
                                            0
                                            1)))))
                                 (let ((base-bstr_0
                                        (subbytes bstr_0 0 (+ p_0 nsep_0))))
                                   (let ((elem_0
                                          (path1.1 elem-bstr_0 'windows)))
                                     (if explode?30_0
                                       (cons
                                        elem_0
                                        (explode-loop_0 base-bstr_0))
                                       (values
                                        (path1.1 base-bstr_0 'windows)
                                        elem_0
                                        is-dir?_0))))))
                             (loop_0 (sub1 p_0))))))))
                    (loop_0 (sub1 len_0)))
                   (if explode?30_0
                     (letrec*
                      ((loop_0
                        (|#%name|
                         loop
                         (lambda (dots-end_1)
                           (if (> dots-end_1 9)
                             (cons 'up (loop_0 (- dots-end_1 3)))
                             '())))))
                      (loop_0 dots-end_0))
                     (if (> (- dots-end_0 3) 8)
                       (values
                        (path1.1 (subbytes bstr_0 0 (- dots-end_0 3)) 'windows)
                        'up
                        #t)
                       (values 'relative 'up #t))))))))))))
      (explode-loop_0 bstr32_0)))))
(define 1/path->directory-path
  (|#%name|
   path->directory-path
   (lambda (p-in_0)
     (begin
       (check-path-argument 'path->directory-path p-in_0)
       (let ((p_0 (->path p-in_0)))
         (if (directory-path?.1 #t p_0)
           p_0
           (let ((tmp_0 (path-convention p_0)))
             (if (eq? tmp_0 'unix)
               (path1.1 (bytes-append (path-bytes p_0) #vu8(47)) 'unix)
               (if (eq? tmp_0 'windows)
                 (path1.1 (bytes-append (path-bytes p_0) #vu8(92)) 'windows)
                 (void))))))))))
(define directory-path?.1
  (|#%name|
   directory-path?
   (lambda (require-sep?1_0 p3_0)
     (let ((bstr_0 (path-bytes p3_0)))
       (let ((len_0 (unsafe-bytes-length bstr_0)))
         (let ((convention_0 (path-convention p3_0)))
           (let ((unixish-path-directory-path?_0
                  (|#%name|
                   unixish-path-directory-path?
                   (lambda ()
                     (let ((or-part_0
                            (is-sep?
                             (unsafe-bytes-ref bstr_0 (sub1 len_0))
                             convention_0)))
                       (if or-part_0
                         or-part_0
                         (if (not require-sep?1_0)
                           (let ((or-part_1
                                  (if (>= len_0 2)
                                    (if (eq?
                                         (unsafe-bytes-ref bstr_0 (sub1 len_0))
                                         46)
                                      (if (eq?
                                           (unsafe-bytes-ref
                                            bstr_0
                                            (- len_0 2))
                                           46)
                                        (let ((or-part_1 (= len_0 2)))
                                          (if or-part_1
                                            or-part_1
                                            (is-sep?
                                             (unsafe-bytes-ref
                                              bstr_0
                                              (- len_0 3))
                                             convention_0)))
                                        #f)
                                      #f)
                                    #f)))
                             (if or-part_1
                               or-part_1
                               (if (>= len_0 1)
                                 (if (eq?
                                      (unsafe-bytes-ref bstr_0 (sub1 len_0))
                                      46)
                                   (let ((or-part_2 (= len_0 1)))
                                     (if or-part_2
                                       or-part_2
                                       (is-sep?
                                        (unsafe-bytes-ref bstr_0 (- len_0 2))
                                        convention_0)))
                                   #f)
                                 #f)))
                           #f)))))))
             (if (eq? convention_0 'unix)
               (unixish-path-directory-path?_0)
               (if (eq? convention_0 'windows)
                 (if (backslash-backslash-questionmark? bstr_0)
                   (let ((or-part_0
                          (eqv? (unsafe-bytes-ref bstr_0 (sub1 len_0)) 92)))
                     (if or-part_0
                       or-part_0
                       (if (not require-sep?1_0)
                         (if (eq?
                              'rel
                              (backslash-backslash-questionmark-kind bstr_0))
                           (eqv?
                            len_0
                            (call-with-values
                             (lambda ()
                               (backslash-backslash-questionmark-dot-ups-end
                                bstr_0
                                len_0))
                             (lambda (dots-end_0 literal-start_0) dots-end_0)))
                           #f)
                         #f)))
                   (unixish-path-directory-path?_0))
                 (void))))))))))
(define host-path->host-path-without-trailing-separator
  (lambda (bstr_0)
    (let ((orig-len_0 (unsafe-bytes-length bstr_0)))
      (if (= orig-len_0 1)
        bstr_0
        (if (if (eq? (system-path-convention-type) 'windows)
              (backslash-backslash-questionmark? bstr_0)
              #f)
          bstr_0
          (let ((len_0
                 (letrec*
                  ((loop_0
                    (|#%name|
                     loop
                     (lambda (len_0)
                       (if (zero? len_0)
                         0
                         (let ((c_0 (unsafe-bytes-ref bstr_0 (sub1 len_0))))
                           (if (is-sep? c_0 (system-path-convention-type))
                             (loop_0 (sub1 len_0))
                             len_0)))))))
                  (loop_0 orig-len_0))))
            (if (< len_0 orig-len_0) (subbytes bstr_0 0 len_0) bstr_0)))))))
(define simplify-path-syntactically
  (let ((simplify-path-syntactically_0
         (|#%name|
          simplify-path-syntactically
          (lambda (who2_0 p3_0 use-filesystem1_0)
            (let ((convention_0 (path-convention p3_0)))
              (begin
                (if use-filesystem1_0
                  (if (eq? convention_0 (system-path-convention-type))
                    (void)
                    (raise-arguments-error
                     who2_0
                     "in use-filesystem mode, path is not for the current platform"
                     "path"
                     p3_0))
                  (void))
                (if (simple? p3_0 convention_0)
                  p3_0
                  (let ((clean-p_0 (do-cleanse-path p3_0 #t)))
                    (if (simple? clean-p_0 convention_0)
                      (if (let ((or-part_0 (not use-filesystem1_0)))
                            (if or-part_0
                              or-part_0
                              (if (eq? 'windows (system-type))
                                (same-modulo-slashes? p3_0 clean-p_0)
                                #f)))
                        clean-p_0
                        (let ((temp5_0 (current-directory$1)))
                          (path->complete-path.1 #t clean-p_0 temp5_0)))
                      (let ((l_0 (1/explode-path clean-p_0)))
                        (let ((simple-p_0
                               (if use-filesystem1_0
                                 (|#%app| use-filesystem1_0 who2_0 l_0)
                                 (let ((simpler-l_0
                                        (letrec*
                                         ((loop_0
                                           (|#%name|
                                            loop
                                            (lambda (l_1 accum_0)
                                              (if (null? l_1)
                                                (1/reverse accum_0)
                                                (if (eq? 'same (car l_1))
                                                  (loop_0 (cdr l_1) accum_0)
                                                  (if (eq? 'up (car l_1))
                                                    (if (pair? accum_0)
                                                      (if (if (null?
                                                               (cdr accum_0))
                                                            (1/absolute-path?
                                                             (car accum_0))
                                                            #f)
                                                        (loop_0
                                                         (cdr l_1)
                                                         accum_0)
                                                        (let ((app_0
                                                               (cdr l_1)))
                                                          (loop_0
                                                           app_0
                                                           (cdr accum_0))))
                                                      (cons
                                                       'up
                                                       (loop_0
                                                        (cdr l_1)
                                                        null)))
                                                    (let ((app_0 (cdr l_1)))
                                                      (loop_0
                                                       app_0
                                                       (cons
                                                        (car l_1)
                                                        accum_0))))))))))
                                         (loop_0 l_0 null))))
                                   (apply
                                    1/build-path/convention-type
                                    convention_0
                                    (if (null? simpler-l_0)
                                      '(same)
                                      simpler-l_0))))))
                          (let ((simpler-p_0
                                 (if (eq? convention_0 'windows)
                                   (simplify-backslash-backslash-questionmark
                                    simple-p_0)
                                   simple-p_0)))
                            (if (let ((or-part_0 (directory-path?.1 #f p3_0)))
                                  (if or-part_0
                                    or-part_0
                                    (if (eq? convention_0 'windows)
                                      (unc-without-trailing-separator?
                                       simpler-p_0)
                                      #f)))
                              (1/path->directory-path simpler-p_0)
                              simpler-p_0)))))))))))))
    (case-lambda
     ((who_0 p_0) (simplify-path-syntactically_0 who_0 p_0 #f))
     ((who_0 p_0 use-filesystem1_0)
      (simplify-path-syntactically_0 who_0 p_0 use-filesystem1_0)))))
(define simple?
  (lambda (p_0 convention_0)
    (let ((bstr_0 (path-bytes p_0)))
      (let ((len_0 (unsafe-bytes-length bstr_0)))
        (let ((is-a-sep?_0
               (|#%name|
                is-a-sep?
                (lambda (b_0)
                  (if (eq? convention_0 'windows)
                    (eqv? b_0 92)
                    (is-sep? b_0 convention_0))))))
          (if (if (eq? convention_0 'windows)
                (if (= len_0 2) (letter-drive-start? bstr_0 2) #f)
                #f)
            #f
            (let ((c1_0
                   (if (eq? convention_0 'windows)
                     (backslash-backslash-questionmark-simple-status bstr_0)
                     #f)))
              (if c1_0
                (eq? c1_0 'simple)
                (letrec*
                 ((loop_0
                   (|#%name|
                    loop
                    (lambda (i_0)
                      (if (= i_0 len_0)
                        #t
                        (if (is-a-sep?_0 (unsafe-bytes-ref bstr_0 i_0))
                          (if (= (add1 i_0) len_0)
                            #t
                            (if (is-a-sep?_0
                                 (unsafe-bytes-ref bstr_0 (add1 i_0)))
                              #f
                              (if (if (eqv?
                                       (unsafe-bytes-ref bstr_0 (add1 i_0))
                                       46)
                                    (let ((or-part_0 (= (+ i_0 2) len_0)))
                                      (if or-part_0
                                        or-part_0
                                        (let ((or-part_1
                                               (is-a-sep?_0
                                                (unsafe-bytes-ref
                                                 bstr_0
                                                 (+ i_0 2)))))
                                          (if or-part_1
                                            or-part_1
                                            (if (eqv?
                                                 (unsafe-bytes-ref
                                                  bstr_0
                                                  (+ i_0 2))
                                                 46)
                                              (let ((or-part_2
                                                     (= (+ i_0 3) len_0)))
                                                (if or-part_2
                                                  or-part_2
                                                  (is-a-sep?_0
                                                   (unsafe-bytes-ref
                                                    bstr_0
                                                    (+ i_0 3)))))
                                              #f)))))
                                    #f)
                                #f
                                (loop_0 (add1 i_0)))))
                          (if (if (zero? i_0)
                                (if (eqv? (unsafe-bytes-ref bstr_0 0) 46)
                                  (let ((or-part_0 (= 1 len_0)))
                                    (if or-part_0
                                      or-part_0
                                      (let ((or-part_1
                                             (is-sep?
                                              (unsafe-bytes-ref bstr_0 1)
                                              convention_0)))
                                        (if or-part_1
                                          or-part_1
                                          (if (eqv?
                                               (unsafe-bytes-ref bstr_0 1)
                                               46)
                                            (let ((or-part_2 (= 2 len_0)))
                                              (if or-part_2
                                                or-part_2
                                                (is-sep?
                                                 (unsafe-bytes-ref bstr_0 2)
                                                 convention_0)))
                                            #f)))))
                                  #f)
                                #f)
                            #f
                            (if (if (eq? convention_0 'windows)
                                  (eqv? (unsafe-bytes-ref bstr_0 i_0) 47)
                                  #f)
                              #f
                              (loop_0 (add1 i_0))))))))))
                 (loop_0 0))))))))))
(define backslash-backslash-questionmark-simple-status
  (lambda (bstr_0)
    (call-with-values
     (lambda () (parse-backslash-backslash-questionmark bstr_0))
     (lambda (kind_0 drive-len_0 orig-drive-len_0 clean-start-pos_0 sep-bstr_0)
       (if (not kind_0)
         #f
         (if (if (fx= (unsafe-bytes-ref bstr_0 4) 82)
               (fx= (unsafe-bytes-ref bstr_0 5) 69)
               #f)
           (letrec*
            ((loop_0
              (|#%name|
               loop
               (lambda (p_0 accum_0 as-dir?_0)
                 (call-with-values
                  (lambda () (1/split-path p_0))
                  (lambda (base-dir_0 name_0 dir?_0)
                    (if (symbol? name_0)
                      'non-simple
                      (let ((new-accum_0 (cons name_0 accum_0)))
                        (let ((new-as-dir?_0
                               (if (null? accum_0) dir?_0 as-dir?_0)))
                          (if (1/path? base-dir_0)
                            (loop_0 base-dir_0 new-accum_0 new-as-dir?_0)
                            (let ((rebuilt0-p_0
                                   (apply
                                    1/build-path/convention-type
                                    'windows
                                    new-accum_0)))
                              (let ((rebuilt-p_0
                                     (if new-as-dir?_0
                                       (path1.1
                                        (bytes-append
                                         (path-bytes rebuilt0-p_0)
                                         #vu8(92))
                                        'windows)
                                       rebuilt0-p_0)))
                                (let ((rebuilt-bstr_0
                                       (path-bytes
                                        (simplify-backslash-backslash-questionmark
                                         rebuilt-p_0))))
                                  (if (bytes=? bstr_0 rebuilt-bstr_0)
                                    'simple
                                    'non-simple))))))))))))))
            (loop_0 (path1.1 bstr_0 'windows) '() #f))
           'non-simple))))))
(define unc-without-trailing-separator?
  (lambda (p_0)
    (let ((bstr_0 (path-bytes p_0)))
      (let ((app_0 (parse-unc.1 #f #f bstr_0 0)))
        (eqv? app_0 (unsafe-bytes-length bstr_0))))))
(define simplify-backslash-backslash-questionmark
  (lambda (p_0)
    (let ((bstr_0 (path-bytes p_0)))
      (let ((len_0 (unsafe-bytes-length bstr_0)))
        (call-with-values
         (lambda () (parse-backslash-backslash-questionmark bstr_0))
         (lambda (kind_0
                  drive-len_0
                  orig-drive-len_0
                  clean-start-pos_0
                  sep-bstr_0)
           (let ((special-element?_0
                  (|#%name|
                   special-element?
                   (lambda (elem-start_0 i_0 at-end?_0)
                     (if (< elem-start_0 i_0)
                       (let ((or-part_0
                              (let ((b_0 (unsafe-bytes-ref bstr_0 (sub1 i_0))))
                                (let ((or-part_0
                                       (if (eqv? b_0 46)
                                         (if at-end?_0
                                           at-end?_0
                                           (let ((or-part_0
                                                  (= elem-start_0 (- i_0 1))))
                                             (if or-part_0
                                               or-part_0
                                               (if (= elem-start_0 (- i_0 2))
                                                 (eqv?
                                                  (unsafe-bytes-ref
                                                   bstr_0
                                                   elem-start_0)
                                                  46)
                                                 #f))))
                                         #f)))
                                  (if or-part_0
                                    or-part_0
                                    (if at-end?_0 (eqv? b_0 32) #f))))))
                         (if or-part_0
                           or-part_0
                           (let ((temp13_0 (subbytes bstr_0 elem-start_0 i_0)))
                             (special-filename?.1 #t temp13_0))))
                       #f)))))
             (let ((no-special-in-content?_0
                    (|#%name|
                     no-special-in-content?
                     (lambda (len9_0 start-pos11_0)
                       (let ((len_1
                              (if (eq? len9_0 unsafe-undefined) len_0 len9_0)))
                         (letrec*
                          ((loop_0
                            (|#%name|
                             loop
                             (lambda (i_0 elem-start_0)
                               (if (= i_0 len_1)
                                 (not (special-element?_0 elem-start_0 i_0 #t))
                                 (let ((b_0 (unsafe-bytes-ref bstr_0 i_0)))
                                   (if (eqv? b_0 92)
                                     (if (special-element?_0
                                          elem-start_0
                                          i_0
                                          #f)
                                       #f
                                       (let ((app_0 (add1 i_0)))
                                         (loop_0 app_0 (add1 i_0))))
                                     (if (let ((or-part_0 (eqv? b_0 47)))
                                           (if or-part_0
                                             or-part_0
                                             (let ((or-part_1 (eqv? b_0 58)))
                                               (if or-part_1
                                                 or-part_1
                                                 (let ((or-part_2
                                                        (eqv? b_0 34)))
                                                   (if or-part_2
                                                     or-part_2
                                                     (let ((or-part_3
                                                            (eqv? b_0 124)))
                                                       (if or-part_3
                                                         or-part_3
                                                         (let ((or-part_4
                                                                (eqv? b_0 60)))
                                                           (if or-part_4
                                                             or-part_4
                                                             (eqv?
                                                              b_0
                                                              62)))))))))))
                                       #f
                                       (loop_0 (add1 i_0) elem-start_0)))))))))
                          (loop_0 start-pos11_0 start-pos11_0)))))))
               (if (eq? kind_0 'abs)
                 (if (if (= drive-len_0 7)
                       (if (drive-letter? (unsafe-bytes-ref bstr_0 4))
                         (if (eqv? (unsafe-bytes-ref bstr_0 5) 58)
                           (no-special-in-content?_0
                            unsafe-undefined
                            orig-drive-len_0)
                           #f)
                         #f)
                       #f)
                   (path1.1 (subbytes bstr_0 4) 'windows)
                   p_0)
                 (if (eq? kind_0 'unc)
                   (let ((norm-bstr_0
                          (normalize-backslash-backslash-unc bstr_0)))
                     (if (let ((temp16_0
                                (if (= orig-drive-len_0 len_0)
                                  (sub1 len_0)
                                  len_0)))
                           (no-special-in-content?_0 temp16_0 4))
                       (path1.1
                        (bytes-append #vu8(92) (subbytes norm-bstr_0 7))
                        'windows)
                       (if (eq? norm-bstr_0 bstr_0)
                         p_0
                         (path1.1 norm-bstr_0 'windows))))
                   (if (eq? kind_0 'red)
                     (if (no-special-in-content?_0 unsafe-undefined 9)
                       (path1.1 (subbytes bstr_0 8) 'windows)
                       p_0)
                     (if (eq? kind_0 'rel)
                       (call-with-values
                        (lambda ()
                          (backslash-backslash-questionmark-dot-ups-end
                           bstr_0
                           len_0))
                        (lambda (dots-end_0 literal-start_0)
                          (if (no-special-in-content?_0
                               unsafe-undefined
                               literal-start_0)
                            (path1.1
                             (let ((app_0
                                    (if dots-end_0
                                      (subbytes bstr_0 8 (add1 dots-end_0))
                                      #vu8())))
                               (bytes-append
                                app_0
                                (subbytes bstr_0 literal-start_0)))
                             'windows)
                            p_0)))
                       p_0))))))))))))
(define normalize-backslash-backslash-unc
  (lambda (bstr_0)
    (if (if (eqv? (unsafe-bytes-ref bstr_0 4) 85)
          (if (eqv? (unsafe-bytes-ref bstr_0 5) 78)
            (eqv? (unsafe-bytes-ref bstr_0 6) 67)
            #f)
          #f)
      bstr_0
      (if (eqv? (unsafe-bytes-ref bstr_0 4) 92)
        (bytes-append #vu8(92 92 63 92 85 78 67) (subbytes bstr_0 8))
        (bytes-append #vu8(92 92 63 92 85 78 67) (subbytes bstr_0 7))))))
(define same-modulo-slashes?
  (lambda (p1_0 p2_0)
    (let ((bstr1_0 (path-bytes p1_0)))
      (let ((bstr2_0 (path-bytes p2_0)))
        (let ((len_0 (unsafe-bytes-length bstr1_0)))
          (if (fx= len_0 (unsafe-bytes-length bstr2_0))
            (letrec*
             ((loop_0
               (|#%name|
                loop
                (lambda (i_0)
                  (let ((or-part_0 (fx= i_0 len_0)))
                    (if or-part_0
                      or-part_0
                      (if (let ((b1_0 (unsafe-bytes-ref bstr1_0 i_0)))
                            (let ((b2_0 (unsafe-bytes-ref bstr2_0 i_0)))
                              (let ((b1_1 b1_0))
                                (let ((or-part_1 (fx= b1_1 b2_0)))
                                  (if or-part_1
                                    or-part_1
                                    (let ((or-part_2
                                           (if (fx= b1_1 92)
                                             (fx= b2_0 47)
                                             #f)))
                                      (if or-part_2
                                        or-part_2
                                        (if (fx= b1_1 47)
                                          (fx= b2_0 92)
                                          #f))))))))
                        (loop_0 (fx+ i_0 1))
                        #f)))))))
             (loop_0 0))
            #f))))))
(define port-number? (lambda (v_0) (if (fixnum? v_0) (<= 1 v_0 65535) #f)))
(define listen-port-number?
  (lambda (v_0) (if (fixnum? v_0) (<= 0 v_0 65535) #f)))
(define finish_2263
  (make-struct-type-install-properties
   '(security-guard)
   4
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1 2 3)
   #f
   'security-guard))
(define struct:security-guard
  (make-record-type-descriptor
   'security-guard
   #f
   (|#%nongenerative-uid| security-guard)
   #f
   #f
   '(4 . 0)))
(define effect_2369 (finish_2263 struct:security-guard))
(define security-guard1.1
  (|#%name|
   security-guard
   (record-constructor
    (make-record-constructor-descriptor struct:security-guard #f #f))))
(define 1/security-guard?_2766
  (|#%name| security-guard? (record-predicate struct:security-guard)))
(define 1/security-guard?
  (|#%name|
   security-guard?
   (lambda (v)
     (if (1/security-guard?_2766 v)
       #t
       ($value
        (if (impersonator? v)
          (1/security-guard?_2766 (impersonator-val v))
          #f))))))
(define security-guard-parent_2613
  (|#%name| security-guard-parent (record-accessor struct:security-guard 0)))
(define security-guard-parent
  (|#%name|
   security-guard-parent
   (lambda (s)
     (if (1/security-guard?_2766 s)
       (security-guard-parent_2613 s)
       ($value
        (impersonate-ref
         security-guard-parent_2613
         struct:security-guard
         0
         s
         'parent))))))
(define security-guard-file-guard_2311
  (|#%name|
   security-guard-file-guard
   (record-accessor struct:security-guard 1)))
(define security-guard-file-guard
  (|#%name|
   security-guard-file-guard
   (lambda (s)
     (if (1/security-guard?_2766 s)
       (security-guard-file-guard_2311 s)
       ($value
        (impersonate-ref
         security-guard-file-guard_2311
         struct:security-guard
         1
         s
         'file-guard))))))
(define security-guard-network-guard_2285
  (|#%name|
   security-guard-network-guard
   (record-accessor struct:security-guard 2)))
(define security-guard-network-guard
  (|#%name|
   security-guard-network-guard
   (lambda (s)
     (if (1/security-guard?_2766 s)
       (security-guard-network-guard_2285 s)
       ($value
        (impersonate-ref
         security-guard-network-guard_2285
         struct:security-guard
         2
         s
         'network-guard))))))
(define security-guard-link-guard_2431
  (|#%name|
   security-guard-link-guard
   (record-accessor struct:security-guard 3)))
(define security-guard-link-guard
  (|#%name|
   security-guard-link-guard
   (lambda (s)
     (if (1/security-guard?_2766 s)
       (security-guard-link-guard_2431 s)
       ($value
        (impersonate-ref
         security-guard-link-guard_2431
         struct:security-guard
         3
         s
         'link-guard))))))
(define root-security-guard (security-guard1.1 #f void void void))
(define 1/current-security-guard
  (make-parameter
   root-security-guard
   (lambda (v_0)
     (begin
       (if (1/security-guard? v_0)
         (void)
         (raise-argument-error 'current-security-guard "security-guard?" v_0))
       v_0))
   'current-security-guard))
(define 1/make-security-guard
  (let ((make-security-guard_0
         (|#%name|
          make-security-guard
          (lambda (parent3_0 file-guard4_0 network-guard5_0 link-guard2_0)
            (begin
              (if (1/security-guard? parent3_0)
                (void)
                (raise-argument-error
                 'make-security-guard
                 "security-guard?"
                 parent3_0))
              (if (if (procedure? file-guard4_0)
                    (procedure-arity-includes? file-guard4_0 3)
                    #f)
                (void)
                (raise-argument-error
                 'make-security-guard
                 "(procedure-arity-includes/c 3)"
                 file-guard4_0))
              (if (if (procedure? network-guard5_0)
                    (procedure-arity-includes? network-guard5_0 4)
                    #f)
                (void)
                (raise-argument-error
                 'make-security-guard
                 "(procedure-arity-includes/c 4)"
                 network-guard5_0))
              (if (let ((or-part_0 (not link-guard2_0)))
                    (if or-part_0
                      or-part_0
                      (if (procedure? link-guard2_0)
                        (procedure-arity-includes? link-guard2_0 3)
                        #f)))
                (void)
                (raise-argument-error
                 'make-security-guard
                 "(or/c #f (procedure-arity-includes/c 3))"
                 link-guard2_0))
              (security-guard1.1
               parent3_0
               file-guard4_0
               network-guard5_0
               (if link-guard2_0 link-guard2_0 void)))))))
    (|#%name|
     make-security-guard
     (case-lambda
      ((parent_0 file-guard_0 network-guard_0)
       (make-security-guard_0 parent_0 file-guard_0 network-guard_0 void))
      ((parent_0 file-guard_0 network-guard_0 link-guard2_0)
       (make-security-guard_0
        parent_0
        file-guard_0
        network-guard_0
        link-guard2_0))))))
(define 1/unsafe-make-security-guard-at-root
  (let ((unsafe-make-security-guard-at-root_0
         (|#%name|
          unsafe-make-security-guard-at-root
          (lambda (file-guard6_0 network-guard7_0 link-guard8_0)
            (begin
              (if (if (procedure? file-guard6_0)
                    (procedure-arity-includes? file-guard6_0 3)
                    #f)
                (void)
                (raise-argument-error
                 'unsafe-make-security-guard-at-root
                 "(procedure-arity-includes/c 3)"
                 file-guard6_0))
              (if (if (procedure? network-guard7_0)
                    (procedure-arity-includes? network-guard7_0 4)
                    #f)
                (void)
                (raise-argument-error
                 'unsafe-make-security-guard-at-root
                 "(procedure-arity-includes/c 4)"
                 network-guard7_0))
              (if (if (procedure? link-guard8_0)
                    (procedure-arity-includes? link-guard8_0 3)
                    #f)
                (void)
                (raise-argument-error
                 'unsafe-make-security-guard-at-root
                 "(procedure-arity-includes/c 3)"
                 link-guard8_0))
              (security-guard1.1
               #f
               file-guard6_0
               network-guard7_0
               link-guard8_0))))))
    (|#%name|
     unsafe-make-security-guard-at-root
     (case-lambda
      (() (unsafe-make-security-guard-at-root_0 void void void))
      ((file-guard_0 network-guard_0 link-guard8_0)
       (unsafe-make-security-guard-at-root_0
        file-guard_0
        network-guard_0
        link-guard8_0))
      ((file-guard_0 network-guard7_0)
       (unsafe-make-security-guard-at-root_0
        file-guard_0
        network-guard7_0
        void))
      ((file-guard6_0)
       (unsafe-make-security-guard-at-root_0 file-guard6_0 void void))))))
(define 1/security-guard-check-file
  (|#%name|
   security-guard-check-file
   (lambda (check-who_0 given-path_0 guards_0)
     (begin
       (if (symbol? check-who_0)
         (void)
         (raise-argument-error
          'security-guard-check-file
          "symbol?"
          check-who_0))
       (begin
         (if (let ((or-part_0 (not given-path_0)))
               (if or-part_0 or-part_0 (path-string? given-path_0)))
           (void)
           (raise-argument-error
            'security-guard-check-file
            "(or/c path-string? #f)"
            given-path_0))
         (begin
           (if (if (list? guards_0)
                 (letrec*
                  ((for-loop_0
                    (|#%name|
                     for-loop
                     (lambda (result_0 lst_0)
                       (if (pair? lst_0)
                         (let ((s_0 (unsafe-car lst_0)))
                           (let ((rest_0 (unsafe-cdr lst_0)))
                             (let ((or-part_0 (eq? s_0 'read)))
                               (let ((result_1
                                      (let ((result_1
                                             (if or-part_0
                                               or-part_0
                                               (let ((or-part_1
                                                      (eq? s_0 'write)))
                                                 (if or-part_1
                                                   or-part_1
                                                   (let ((or-part_2
                                                          (eq? s_0 'execute)))
                                                     (if or-part_2
                                                       or-part_2
                                                       (let ((or-part_3
                                                              (eq?
                                                               s_0
                                                               'delete)))
                                                         (if or-part_3
                                                           or-part_3
                                                           (eq?
                                                            s_0
                                                            'exists))))))))))
                                        (values result_1))))
                                 (if (if (not
                                          (let ((x_0 (list s_0)))
                                            (not result_1)))
                                       #t
                                       #f)
                                   (for-loop_0 result_1 rest_0)
                                   result_1)))))
                         result_0)))))
                  (for-loop_0 #t guards_0))
                 #f)
             (void)
             (raise-argument-error
              'security-guard-check-file
              "(or/c 'read 'write 'execute 'delete 'exists)"
              guards_0))
           (let ((path_0 (->path given-path_0)))
             (letrec*
              ((loop_0
                (|#%name|
                 loop
                 (lambda (sg_0)
                   (if sg_0
                     (begin
                       (|#%app|
                        (security-guard-file-guard sg_0)
                        check-who_0
                        path_0
                        guards_0)
                       (loop_0 (security-guard-parent sg_0)))
                     (void))))))
              (loop_0 (1/current-security-guard))))))))))
(define 1/security-guard-check-file-link
  (|#%name|
   security-guard-check-file-link
   (lambda (check-who_0 given-path_0 given-dest_0)
     (begin
       (if (symbol? check-who_0)
         (void)
         (raise-argument-error
          'security-guard-check-file-link
          "symbol?"
          check-who_0))
       (begin
         (if (if (path-string? given-path_0)
               (1/complete-path? given-path_0)
               #f)
           (void)
           (raise-argument-error
            'security-guard-check-file-link
            "(and/c path? complete-path?)"
            given-path_0))
         (begin
           (if (path-string? given-dest_0)
             (void)
             (raise-argument-error
              'security-guard-check-file-link
              "path-string?"
              given-dest_0))
           (let ((path_0 (->path given-path_0)))
             (let ((dest_0 (->path given-dest_0)))
               (letrec*
                ((loop_0
                  (|#%name|
                   loop
                   (lambda (sg_0)
                     (if sg_0
                       (begin
                         (|#%app|
                          (security-guard-link-guard sg_0)
                          check-who_0
                          path_0
                          dest_0)
                         (loop_0 (security-guard-parent sg_0)))
                       (void))))))
                (loop_0 (1/current-security-guard)))))))))))
(define 1/security-guard-check-network
  (|#%name|
   security-guard-check-network
   (lambda (check-who_0 given-host_0 port_0 mode_0)
     (begin
       (if (symbol? check-who_0)
         (void)
         (raise-argument-error
          'security-guard-check-network
          "symbol?"
          check-who_0))
       (begin
         (if (let ((or-part_0 (not given-host_0)))
               (if or-part_0 or-part_0 (string? given-host_0)))
           (void)
           (raise-argument-error
            'security-guard-check-network
            "(or/c string? #f)"
            given-host_0))
         (begin
           (if (let ((or-part_0 (not port_0)))
                 (if or-part_0 or-part_0 (listen-port-number? port_0)))
             (void)
             (raise-argument-error
              'security-guard-check-network
              "(or/c listen-port-number? #f)"
              port_0))
           (begin
             (if (let ((or-part_0 (eq? mode_0 'client)))
                   (if or-part_0 or-part_0 (eq? mode_0 'server)))
               (void)
               (raise-argument-error
                'security-guard-check-network
                "(or/c 'client 'server)"
                mode_0))
             (let ((host_0
                    (if given-host_0
                      (string->immutable-string given-host_0)
                      #f)))
               (letrec*
                ((loop_0
                  (|#%name|
                   loop
                   (lambda (sg_0)
                     (if sg_0
                       (begin
                         (|#%app|
                          (security-guard-network-guard sg_0)
                          check-who_0
                          host_0
                          port_0
                          mode_0)
                         (loop_0 (security-guard-parent sg_0)))
                       (void))))))
                (loop_0 (1/current-security-guard)))))))))))
(define ->host
  (lambda (p_0 who_0 guards_0)
    (let ((p_1 (->path p_0)))
      (begin
        (if who_0 (1/security-guard-check-file who_0 p_1 guards_0) (void))
        (path-bytes
         (handle-long-path
          who_0
          (let ((p_2 (path->complete-path.1 #f p_1 current-directory$1)))
            (do-cleanse-path p_2 #t))))))))
(define ->host/as-is
  (lambda (p_0 who_0 src_0)
    (let ((p_1 (->path p_0)))
      (begin
        (if who_0
          (if src_0
            (1/security-guard-check-file-link who_0 src_0 p_1)
            (1/security-guard-check-file who_0 p_1 '(exists)))
          (void))
        (path-bytes p_1)))))
(define host->
  (lambda (s_0)
    (path1.1 (bytes->immutable-bytes s_0) (system-path-convention-type))))
(define host-element->
  (lambda (s_0)
    (if (eq? 'windows (system-path-convention-type))
      (path1.1
       (protect-path-element (bytes->immutable-bytes s_0) 'windows)
       'windows)
      (host-> s_0))))
(define LONGEST-NON-BSBS-PATH 247)
(define handle-long-path
  (lambda (who_0 p_0)
    (if (eq? (system-type) 'windows)
      (let ((bstr_0 (path-bytes p_0)))
        (if (if (> (unsafe-bytes-length bstr_0) 247)
              (not
               (if (fx= (unsafe-bytes-ref bstr_0 0) 92)
                 (if (fx= (unsafe-bytes-ref bstr_0 1) 92)
                   (if (fx= (unsafe-bytes-ref bstr_0 2) 63)
                     (fx= (unsafe-bytes-ref bstr_0 3) 92)
                     #f)
                   #f)
                 #f))
              #f)
          (let ((simple-p_0 (simplify-path-syntactically who_0 p_0 #f)))
            (let ((simple-bstr_0 (path-bytes simple-p_0)))
              (if (<= (unsafe-bytes-length simple-bstr_0) 247)
                simple-p_0
                (if (fx= (unsafe-bytes-ref simple-bstr_0 0) 92)
                  (path1.1
                   (bytes-append
                    #vu8(92 92 63 92 85 78 67)
                    (subbytes simple-bstr_0 0))
                   'windows)
                  (path1.1
                   (bytes-append #vu8(92 92 63 92) simple-bstr_0)
                   'windows)))))
          p_0))
      p_0)))
(define permissions?
  (lambda (perms_0) (if (exact-integer? perms_0) (<= 0 perms_0 65535) #f)))
(define permissions-desc "(integer-in 0 65535)")
(define none$1 (gensym))
(define 1/open-input-file
  (let ((open-input-file_0
         (|#%name|
          open-input-file
          (lambda (path3_0 mode11_0 mode22_0)
            (let ((mode1_0
                   (if (eq? mode11_0 unsafe-undefined) none$1 mode11_0)))
              (let ((mode2_0
                     (if (eq? mode22_0 unsafe-undefined) none$1 mode22_0)))
                (begin
                  (if (path-string? path3_0)
                    (void)
                    (raise-argument-error
                     'open-input-file
                     "path-string?"
                     path3_0))
                  (let ((mode->flags_0
                         (|#%name|
                          mode->flags
                          (lambda (mode_0) (if (eq? mode_0 'text) 4 0)))))
                    (let ((host-path_0
                           (->host path3_0 'open-input-file '(read))))
                      (begin
                        (unsafe-start-atomic)
                        (begin
                          (check-current-custodian 'open-input-file)
                          (let ((fd_0
                                 (|#%app|
                                  rktio_open
                                  (unsafe-place-local-ref cell.1)
                                  host-path_0
                                  (let ((app_0 (mode->flags_0 mode1_0)))
                                    (+ 1 app_0 (mode->flags_0 mode2_0))))))
                            (begin
                              (if (vector? fd_0)
                                (begin
                                  (unsafe-end-atomic)
                                  (if (let ((or-part_0 (eq? mode1_0 'module)))
                                        (if or-part_0
                                          or-part_0
                                          (eq? mode2_0 'module)))
                                    (let ((app_0 maybe-raise-missing-module))
                                      (let ((app_1 (host-> host-path_0)))
                                        (|#%app|
                                         app_0
                                         'open-input-file
                                         app_1
                                         ""
                                         ""
                                         ""
                                         (format-rktio-system-error-message
                                          fd_0))))
                                    (void))
                                  (raise-filesystem-error
                                   'open-input-file
                                   fd_0
                                   (let ((app_0
                                          (string-append
                                           "cannot open input file\n"
                                           "  path: ~a")))
                                     (1/format app_0 (host-> host-path_0)))))
                                (void))
                              (let ((p_0
                                     (let ((temp43_0 (host-> host-path_0)))
                                       (open-input-fd.1
                                        unsafe-undefined
                                        unsafe-undefined
                                        fd_0
                                        temp43_0))))
                                (begin
                                  (unsafe-end-atomic)
                                  (if (1/port-count-lines-enabled)
                                    (1/port-count-lines! p_0)
                                    (void))
                                  p_0)))))))))))))))
    (|#%name|
     open-input-file
     (case-lambda
      ((path_0) (open-input-file_0 path_0 unsafe-undefined unsafe-undefined))
      ((path_0 mode1_0 mode22_0) (open-input-file_0 path_0 mode1_0 mode22_0))
      ((path_0 mode11_0)
       (open-input-file_0 path_0 mode11_0 unsafe-undefined))))))
(define do-open-output-file.1
  (|#%name|
   do-open-output-file
   (lambda (plus-input?4_0
            who6_0
            path7_0
            mode18_0
            mode29_0
            perms10_0
            replace-perms?11_0)
     (begin
       (if (path-string? path7_0)
         (void)
         (raise-argument-error who6_0 "path-string?" path7_0))
       (begin
         (if (permissions? perms10_0)
           (void)
           (raise-argument-error who6_0 permissions-desc perms10_0))
         (let ((mode->flags_0
                (|#%name|
                 mode->flags
                 (lambda (mode_0)
                   (if (eq? mode_0 'text)
                     4
                     (if (if (eq? mode_0 'truncate)
                           #t
                           (eq? mode_0 'truncate/replace))
                       72
                       (if (eq? mode_0 'must-truncate)
                         40
                         (if (eq? mode_0 'can-update)
                           64
                           (if (eq? mode_0 'update)
                             32
                             (if (eq? mode_0 'append) 16 0))))))))))
           (let ((mode?_0
                  (|#%name|
                   mode?
                   (lambda (v_0)
                     (let ((or-part_0 (eq? mode18_0 v_0)))
                       (if or-part_0 or-part_0 (eq? mode29_0 v_0)))))))
             (let ((host-path_0
                    (->host
                     path7_0
                     who6_0
                     (let ((app_0
                            (if (let ((or-part_0 (mode?_0 'replace)))
                                  (if or-part_0
                                    or-part_0
                                    (mode?_0 'truncate/replace)))
                              '(delete)
                              '())))
                       (append
                        '(write)
                        app_0
                        (if (let ((or-part_0 (mode?_0 'append)))
                              (if or-part_0
                                or-part_0
                                (let ((or-part_1 (mode?_0 'update)))
                                  (if or-part_1
                                    or-part_1
                                    (mode?_0 'must-update)))))
                          '(read)
                          '()))))))
               (begin
                 (unsafe-start-atomic)
                 (begin
                   (check-current-custodian who6_0)
                   (let ((flags_0
                          (let ((app_0 (mode->flags_0 mode18_0)))
                            (+
                             2
                             (if plus-input?4_0 1 0)
                             app_0
                             (mode->flags_0 mode29_0)
                             (if replace-perms?11_0 32768 0)))))
                     (let ((fd0_0
                            (|#%app|
                             rktio_open_with_create_permissions
                             (unsafe-place-local-ref cell.1)
                             host-path_0
                             flags_0
                             perms10_0)))
                       (let ((fd_0
                              (if (not (vector? fd0_0))
                                fd0_0
                                (if (if (let ((or-part_0
                                               (racket-error? fd0_0 4)))
                                          (if or-part_0
                                            or-part_0
                                            (racket-error? fd0_0 5)))
                                      (let ((or-part_0 (mode?_0 'replace)))
                                        (if or-part_0
                                          or-part_0
                                          (mode?_0 'truncate/replace)))
                                      #f)
                                  (let ((r_0
                                         (|#%app|
                                          rktio_delete_file
                                          (unsafe-place-local-ref cell.1)
                                          host-path_0
                                          (1/current-force-delete-permissions))))
                                    (begin
                                      (if (vector? r_0)
                                        (begin
                                          (unsafe-end-atomic)
                                          (raise-filesystem-error
                                           who6_0
                                           r_0
                                           (let ((app_0
                                                  (string-append
                                                   "error deleting file\n"
                                                   "  path: ~a")))
                                             (1/format
                                              app_0
                                              (host-> host-path_0)))))
                                        (void))
                                      (|#%app|
                                       rktio_open_with_create_permissions
                                       (unsafe-place-local-ref cell.1)
                                       host-path_0
                                       flags_0
                                       perms10_0)))
                                  fd0_0))))
                         (begin
                           (if (vector? fd_0)
                             (begin
                               (unsafe-end-atomic)
                               (raise-filesystem-error
                                who6_0
                                fd_0
                                (let ((app_0
                                       (string-append "~a\n" "  path: ~a")))
                                  (let ((app_1
                                         (if (racket-error? fd0_0 4)
                                           "file exists"
                                           (if (racket-error? fd0_0 9)
                                             "path is a directory"
                                             "error opening file"))))
                                    (1/format
                                     app_0
                                     app_1
                                     (host-> host-path_0))))))
                             (void))
                           (let ((opened-path_0 (host-> host-path_0)))
                             (let ((refcount_0 (box (if plus-input?4_0 2 1))))
                               (let ((op_0
                                      (open-output-fd.1
                                       'infer
                                       unsafe-undefined
                                       refcount_0
                                       unsafe-undefined
                                       fd_0
                                       opened-path_0)))
                                 (let ((ip_0
                                        (if plus-input?4_0
                                          (open-input-fd.1
                                           unsafe-undefined
                                           refcount_0
                                           fd_0
                                           opened-path_0)
                                          #f)))
                                   (begin
                                     (unsafe-end-atomic)
                                     (if (1/port-count-lines-enabled)
                                       (begin
                                         (1/port-count-lines! op_0)
                                         (if plus-input?4_0
                                           (1/port-count-lines! ip_0)
                                           (void)))
                                       (void))
                                     (if plus-input?4_0
                                       (values ip_0 op_0)
                                       op_0))))))))))))))))))))
(define DEFAULT-CREATE-PERMS 438)
(define 1/open-output-file
  (let ((open-output-file_0
         (|#%name|
          open-output-file
          (lambda (path17_0 mode113_0 mode214_0 perms15_0 replace-perms?16_0)
            (let ((mode1_0
                   (if (eq? mode113_0 unsafe-undefined) none$1 mode113_0)))
              (let ((mode2_0
                     (if (eq? mode214_0 unsafe-undefined) none$1 mode214_0)))
                (let ((perms_0
                       (if (eq? perms15_0 unsafe-undefined) 438 perms15_0)))
                  (do-open-output-file.1
                   #f
                   'open-output-file
                   path17_0
                   mode1_0
                   mode2_0
                   perms_0
                   replace-perms?16_0))))))))
    (|#%name|
     open-output-file
     (case-lambda
      ((path_0)
       (open-output-file_0
        path_0
        unsafe-undefined
        unsafe-undefined
        unsafe-undefined
        #f))
      ((path_0 mode1_0 mode2_0 perms_0 replace-perms?16_0)
       (open-output-file_0 path_0 mode1_0 mode2_0 perms_0 replace-perms?16_0))
      ((path_0 mode1_0 mode2_0 perms15_0)
       (open-output-file_0 path_0 mode1_0 mode2_0 perms15_0 #f))
      ((path_0 mode1_0 mode214_0)
       (open-output-file_0 path_0 mode1_0 mode214_0 unsafe-undefined #f))
      ((path_0 mode113_0)
       (open-output-file_0
        path_0
        mode113_0
        unsafe-undefined
        unsafe-undefined
        #f))))))
(define 1/open-input-output-file
  (let ((open-input-output-file_0
         (|#%name|
          open-input-output-file
          (lambda (path22_0 mode118_0 mode219_0 perms20_0 replace-perms?21_0)
            (let ((mode1_0
                   (if (eq? mode118_0 unsafe-undefined) none$1 mode118_0)))
              (let ((mode2_0
                     (if (eq? mode219_0 unsafe-undefined) none$1 mode219_0)))
                (let ((perms_0
                       (if (eq? perms20_0 unsafe-undefined) 438 perms20_0)))
                  (do-open-output-file.1
                   #t
                   'open-input-output-file
                   path22_0
                   mode1_0
                   mode2_0
                   perms_0
                   replace-perms?21_0))))))))
    (|#%name|
     open-input-output-file
     (case-lambda
      ((path_0)
       (open-input-output-file_0
        path_0
        unsafe-undefined
        unsafe-undefined
        unsafe-undefined
        #f))
      ((path_0 mode1_0 mode2_0 perms_0 replace-perms?21_0)
       (open-input-output-file_0
        path_0
        mode1_0
        mode2_0
        perms_0
        replace-perms?21_0))
      ((path_0 mode1_0 mode2_0 perms20_0)
       (open-input-output-file_0 path_0 mode1_0 mode2_0 perms20_0 #f))
      ((path_0 mode1_0 mode219_0)
       (open-input-output-file_0 path_0 mode1_0 mode219_0 unsafe-undefined #f))
      ((path_0 mode118_0)
       (open-input-output-file_0
        path_0
        mode118_0
        unsafe-undefined
        unsafe-undefined
        #f))))))
(define 1/call-with-input-file
  (let ((call-with-input-file_0
         (|#%name|
          call-with-input-file
          (lambda (path24_0 proc25_0 mode23_0)
            (let ((mode_0
                   (if (eq? mode23_0 unsafe-undefined) none$1 mode23_0)))
              (begin
                (if (path-string? path24_0)
                  (void)
                  (raise-argument-error
                   'call-with-input-file
                   "path-string?"
                   path24_0))
                (begin
                  (if (if (procedure? proc25_0)
                        (procedure-arity-includes? proc25_0 1)
                        #f)
                    (void)
                    (raise-argument-error
                     'call-with-input-file
                     "(procedure-arity-includes/c 1)"
                     proc25_0))
                  (let ((i_0 (1/open-input-file path24_0 mode_0)))
                    (begin0
                      (|#%app| proc25_0 i_0)
                      (1/close-input-port i_0))))))))))
    (|#%name|
     call-with-input-file
     (case-lambda
      ((path_0 proc_0) (call-with-input-file_0 path_0 proc_0 unsafe-undefined))
      ((path_0 proc_0 mode23_0)
       (call-with-input-file_0 path_0 proc_0 mode23_0))))))
(define 1/call-with-output-file
  (let ((call-with-output-file_0
         (|#%name|
          call-with-output-file
          (lambda (path30_0
                   proc31_0
                   mode126_0
                   mode227_0
                   perms28_0
                   replace-perms?29_0)
            (let ((mode1_0
                   (if (eq? mode126_0 unsafe-undefined) none$1 mode126_0)))
              (let ((mode2_0
                     (if (eq? mode227_0 unsafe-undefined) none$1 mode227_0)))
                (let ((perms_0
                       (if (eq? perms28_0 unsafe-undefined) 438 perms28_0)))
                  (begin
                    (if (path-string? path30_0)
                      (void)
                      (raise-argument-error
                       'call-with-output-file
                       "path-string?"
                       path30_0))
                    (begin
                      (if (if (procedure? proc31_0)
                            (procedure-arity-includes? proc31_0 1)
                            #f)
                        (void)
                        (raise-argument-error
                         'call-with-output-file
                         "(procedure-arity-includes/c 1)"
                         proc31_0))
                      (begin
                        (if (permissions? perms_0)
                          (void)
                          (raise-argument-error
                           'call-with-output-file
                           permissions-desc
                           perms_0))
                        (let ((o_0
                               (1/open-output-file
                                path30_0
                                mode1_0
                                mode2_0
                                perms_0
                                replace-perms?29_0)))
                          (begin0
                            (|#%app| proc31_0 o_0)
                            (1/close-output-port o_0)))))))))))))
    (|#%name|
     call-with-output-file
     (case-lambda
      ((path_0 proc_0)
       (call-with-output-file_0
        path_0
        proc_0
        unsafe-undefined
        unsafe-undefined
        unsafe-undefined
        #f))
      ((path_0 proc_0 mode1_0 mode2_0 perms_0 replace-perms?29_0)
       (call-with-output-file_0
        path_0
        proc_0
        mode1_0
        mode2_0
        perms_0
        replace-perms?29_0))
      ((path_0 proc_0 mode1_0 mode2_0 perms28_0)
       (call-with-output-file_0 path_0 proc_0 mode1_0 mode2_0 perms28_0 #f))
      ((path_0 proc_0 mode1_0 mode227_0)
       (call-with-output-file_0
        path_0
        proc_0
        mode1_0
        mode227_0
        unsafe-undefined
        #f))
      ((path_0 proc_0 mode126_0)
       (call-with-output-file_0
        path_0
        proc_0
        mode126_0
        unsafe-undefined
        unsafe-undefined
        #f))))))
(define 1/with-input-from-file
  (let ((with-input-from-file_0
         (|#%name|
          with-input-from-file
          (lambda (path33_0 proc34_0 mode32_0)
            (let ((mode_0
                   (if (eq? mode32_0 unsafe-undefined) none$1 mode32_0)))
              (begin
                (if (path-string? path33_0)
                  (void)
                  (raise-argument-error
                   'with-input-from-file
                   "path-string?"
                   path33_0))
                (begin
                  (if (if (procedure? proc34_0)
                        (procedure-arity-includes? proc34_0 0)
                        #f)
                    (void)
                    (raise-argument-error
                     'with-input-from-file
                     "(procedure-arity-includes/c 0)"
                     proc34_0))
                  (let ((i_0 (1/open-input-file path33_0 mode_0)))
                    (with-continuation-mark*
                     authentic
                     parameterization-key
                     (extend-parameterization
                      (continuation-mark-set-first #f parameterization-key)
                      1/current-input-port
                      i_0)
                     (dynamic-wind
                      void
                      proc34_0
                      (lambda () (1/close-input-port i_0))))))))))))
    (|#%name|
     with-input-from-file
     (case-lambda
      ((path_0 proc_0) (with-input-from-file_0 path_0 proc_0 unsafe-undefined))
      ((path_0 proc_0 mode32_0)
       (with-input-from-file_0 path_0 proc_0 mode32_0))))))
(define 1/with-output-to-file
  (let ((with-output-to-file_0
         (|#%name|
          with-output-to-file
          (lambda (path39_0
                   proc40_0
                   mode135_0
                   mode236_0
                   perms37_0
                   replace-perms?38_0)
            (let ((mode1_0
                   (if (eq? mode135_0 unsafe-undefined) none$1 mode135_0)))
              (let ((mode2_0
                     (if (eq? mode236_0 unsafe-undefined) none$1 mode236_0)))
                (let ((perms_0
                       (if (eq? perms37_0 unsafe-undefined) 438 perms37_0)))
                  (begin
                    (if (path-string? path39_0)
                      (void)
                      (raise-argument-error
                       'with-output-to-file
                       "path-string?"
                       path39_0))
                    (begin
                      (if (if (procedure? proc40_0)
                            (procedure-arity-includes? proc40_0 0)
                            #f)
                        (void)
                        (raise-argument-error
                         'with-output-to-file
                         "(procedure-arity-includes/c 0)"
                         proc40_0))
                      (begin
                        (if (permissions? perms_0)
                          (void)
                          (raise-argument-error
                           'with-output-to-file
                           permissions-desc
                           perms_0))
                        (let ((o_0
                               (1/open-output-file
                                path39_0
                                mode1_0
                                mode2_0
                                perms_0
                                replace-perms?38_0)))
                          (with-continuation-mark*
                           authentic
                           parameterization-key
                           (extend-parameterization
                            (continuation-mark-set-first
                             #f
                             parameterization-key)
                            1/current-output-port
                            o_0)
                           (dynamic-wind
                            void
                            proc40_0
                            (lambda () (1/close-output-port o_0)))))))))))))))
    (|#%name|
     with-output-to-file
     (case-lambda
      ((path_0 proc_0)
       (with-output-to-file_0
        path_0
        proc_0
        unsafe-undefined
        unsafe-undefined
        unsafe-undefined
        #f))
      ((path_0 proc_0 mode1_0 mode2_0 perms_0 replace-perms?38_0)
       (with-output-to-file_0
        path_0
        proc_0
        mode1_0
        mode2_0
        perms_0
        replace-perms?38_0))
      ((path_0 proc_0 mode1_0 mode2_0 perms37_0)
       (with-output-to-file_0 path_0 proc_0 mode1_0 mode2_0 perms37_0 #f))
      ((path_0 proc_0 mode1_0 mode236_0)
       (with-output-to-file_0
        path_0
        proc_0
        mode1_0
        mode236_0
        unsafe-undefined
        #f))
      ((path_0 proc_0 mode135_0)
       (with-output-to-file_0
        path_0
        proc_0
        mode135_0
        unsafe-undefined
        unsafe-undefined
        #f))))))
(define path-or-fd-identity.1
  (|#%name|
   path-or-fd-identity
   (lambda (as-link?2_0 fd3_0 host-path1_0 no-error?5_0 port4_0 who11_0)
     (let ((r0_0
            (if host-path1_0
              (|#%app|
               rktio_path_identity
               (unsafe-place-local-ref cell.1)
               host-path1_0
               (not as-link?2_0))
              (|#%app|
               rktio_fd_identity
               (unsafe-place-local-ref cell.1)
               fd3_0))))
       (let ((r_0
              (if (vector? r0_0)
                r0_0
                (begin0
                  (|#%app| rktio_identity_to_vector r0_0)
                  (|#%app| rktio_free r0_0)))))
         (begin
           (unsafe-end-atomic)
           (if (vector? r0_0)
             (if (not no-error?5_0)
               (raise-filesystem-error
                who11_0
                r_0
                (if host-path1_0
                  (let ((app_0
                         (string-append
                          "error obtaining identity for path\n"
                          "  path: ~a")))
                    (1/format app_0 (host-> host-path1_0)))
                  (1/format
                   (string-append
                    "error obtaining identity for port\n"
                    "  port: ~v")
                   port4_0)))
               #f)
             (let ((app_0 (vector-ref r_0 0)))
               (let ((app_1
                      (let ((app_1 (vector-ref r_0 1)))
                        (arithmetic-shift app_1 (vector-ref r_0 3)))))
                 (+
                  app_0
                  app_1
                  (let ((app_2 (vector-ref r_0 2)))
                    (arithmetic-shift
                     app_2
                     (let ((app_3 (vector-ref r_0 3)))
                       (+ app_3 (vector-ref r_0 4)))))))))))))))
(define 1/port-file-identity
  (|#%name|
   port-file-identity
   (lambda (p_0)
     (begin
       (if (1/file-stream-port? p_0)
         (void)
         (raise-argument-error 'port-file-identity "file-stream-port?" p_0))
       (let ((cp_0
              (let ((or-part_0 (->core-input-port.1 #f p_0 #f)))
                (if or-part_0 or-part_0 (->core-output-port.1 #f p_0 #f)))))
         (begin
           (unsafe-start-atomic)
           (begin
             (check-not-closed 'port-file-identity cp_0)
             (let ((fd_0 (|#%app| (file-stream-ref cp_0) cp_0)))
               (path-or-fd-identity.1
                #f
                fd_0
                #f
                #f
                p_0
                'port-file-identity)))))))))
(define path-or-fd-stat.1
  (|#%name|
   path-or-fd-stat
   (lambda (as-link?2_0 fd3_0 host-path1_0 port4_0 who9_0)
     (let ((r0_0
            (if fd3_0
              (|#%app| rktio_fd_stat (unsafe-place-local-ref cell.1) fd3_0)
              (|#%app|
               rktio_file_or_directory_stat
               (unsafe-place-local-ref cell.1)
               host-path1_0
               (not as-link?2_0)))))
       (let ((r_0
              (if (vector? r0_0)
                r0_0
                (begin0
                  (|#%app| rktio_stat_to_vector r0_0)
                  (|#%app| rktio_free r0_0)))))
         (begin
           (unsafe-end-atomic)
           (if (vector? r0_0)
             (raise-filesystem-error
              who9_0
              r_0
              (string-append
               "cannot get stat result\n"
               (if host-path1_0
                 (1/format "  path: ~a" (host-> host-path1_0))
                 "")))
             (let ((combined-nanoseconds_0
                    (|#%name|
                     combined-nanoseconds
                     (lambda (seconds-index_0)
                       (let ((app_0
                              (* 1000000000 (vector-ref r_0 seconds-index_0))))
                         (+ app_0 (vector-ref r_0 (add1 seconds-index_0))))))))
               (let ((main-hash_0
                      (let ((app_0 (vector-ref r_0 0)))
                        (let ((app_1 (vector-ref r_0 1)))
                          (let ((app_2 (vector-ref r_0 2)))
                            (let ((app_3 (vector-ref r_0 3)))
                              (let ((app_4 (vector-ref r_0 4)))
                                (let ((app_5 (vector-ref r_0 5)))
                                  (let ((app_6 (vector-ref r_0 6)))
                                    (let ((app_7 (vector-ref r_0 7)))
                                      (let ((app_8 (vector-ref r_0 8)))
                                        (let ((app_9 (vector-ref r_0 9)))
                                          (let ((app_10 (vector-ref r_0 10)))
                                            (let ((app_11
                                                   (combined-nanoseconds_0
                                                    10)))
                                              (let ((app_12
                                                     (vector-ref r_0 12)))
                                                (hasheq
                                                 'device-id
                                                 app_0
                                                 'inode
                                                 app_1
                                                 'mode
                                                 app_2
                                                 'hardlink-count
                                                 app_3
                                                 'user-id
                                                 app_4
                                                 'group-id
                                                 app_5
                                                 'device-id-for-special-file
                                                 app_6
                                                 'size
                                                 app_7
                                                 'block-size
                                                 app_8
                                                 'block-count
                                                 app_9
                                                 'access-time-seconds
                                                 app_10
                                                 'access-time-nanoseconds
                                                 app_11
                                                 'modify-time-seconds
                                                 app_12
                                                 'modify-time-nanoseconds
                                                 (combined-nanoseconds_0
                                                  12)))))))))))))))))
                 (let ((ctime-hash_0
                        (if (vector-ref r_0 15)
                          (let ((app_0 (vector-ref r_0 14)))
                            (hasheq
                             'change-time-seconds
                             app_0
                             'change-time-nanoseconds
                             (combined-nanoseconds_0 14)
                             'creation-time-seconds
                             0
                             'creation-time-nanoseconds
                             0))
                          (let ((app_0 (vector-ref r_0 14)))
                            (hasheq
                             'change-time-seconds
                             0
                             'change-time-nanoseconds
                             0
                             'creation-time-seconds
                             app_0
                             'creation-time-nanoseconds
                             (combined-nanoseconds_0 14))))))
                   (letrec*
                    ((for-loop_0
                      (|#%name|
                       for-loop
                       (lambda (new-hash_0 i_0)
                         (if i_0
                           (call-with-values
                            (lambda ()
                              (hash-iterate-key+value ctime-hash_0 i_0))
                            (lambda (key_0 value_0)
                              (let ((new-hash_1
                                     (let ((new-hash_1
                                            (hash-set
                                             new-hash_0
                                             key_0
                                             value_0)))
                                       (values new-hash_1))))
                                (for-loop_0
                                 new-hash_1
                                 (hash-iterate-next ctime-hash_0 i_0)))))
                           new-hash_0)))))
                    (for-loop_0
                     main-hash_0
                     (hash-iterate-first ctime-hash_0)))))))))))))
(define 1/port-file-stat
  (|#%name|
   port-file-stat
   (lambda (p_0)
     (begin
       (if (1/file-stream-port? p_0)
         (void)
         (raise-argument-error 'port-file-stat "file-stream-port?" p_0))
       (let ((cp_0
              (let ((or-part_0 (->core-input-port.1 #f p_0 #f)))
                (if or-part_0 or-part_0 (->core-output-port.1 #f p_0 #f)))))
         (begin
           (unsafe-start-atomic)
           (begin
             (check-not-closed 'port-file-stat cp_0)
             (let ((fd_0 (|#%app| (file-stream-ref cp_0) cp_0)))
               (path-or-fd-stat.1 #f fd_0 #f p_0 'port-file-stat)))))))))
(define 1/port-try-file-lock?
  (|#%name|
   port-try-file-lock?
   (lambda (p_0 mode_0)
     (begin
       (if (1/file-stream-port? p_0)
         (void)
         (raise-argument-error 'port-try-file-lock? "file-stream-port?" p_0))
       (begin
         (if (let ((or-part_0 (eq? mode_0 'shared)))
               (if or-part_0 or-part_0 (eq? mode_0 'exclusive)))
           (void)
           (raise-argument-error
            'port-try-file-lock?
            "(or/c 'shared 'exclusive)"
            mode_0))
         (let ((exclusive?_0 (eq? mode_0 'exclusive)))
           (begin
             (if (if exclusive?_0 (not (1/output-port? p_0)) #f)
               (raise-arguments-error
                'port-try-file-lock?
                "port for 'exclusive locking is not an output port"
                "port"
                p_0)
               (void))
             (begin
               (if (if (not exclusive?_0) (not (1/input-port? p_0)) #f)
                 (raise-arguments-error
                  'port-try-file-lock?
                  "port for 'shared locking is not an input port"
                  "port"
                  p_0)
                 (void))
               (let ((cp_0
                      (if (1/input-port? p_0)
                        (->core-input-port.1 unsafe-undefined p_0 #f)
                        (->core-output-port.1 unsafe-undefined p_0 #f))))
                 (begin
                   (unsafe-start-atomic)
                   (begin
                     (check-not-closed 'port-try-file-lock? cp_0)
                     (let ((fd_0 (|#%app| (file-stream-ref cp_0) cp_0)))
                       (let ((r_0
                              (|#%app|
                               rktio_file_lock_try
                               (unsafe-place-local-ref cell.1)
                               fd_0
                               exclusive?_0)))
                         (begin
                           (unsafe-end-atomic)
                           (if (vector? r_0)
                             (let ((base-msg_0
                                    (string-append
                                     "error getting file "
                                     (if exclusive?_0 "exclusive" "shared")
                                     " lock")))
                               (raise
                                (let ((app_0
                                       (let ((msg_0
                                              (string-append
                                               base-msg_0
                                               "\n  system error: "
                                               (format-rktio-system-error-message
                                                r_0))))
                                         (error-message->adjusted-string
                                          'port-try-file-lock?
                                          'racket/primitive
                                          msg_0
                                          'racket/primitive))))
                                  (|#%app|
                                   exn:fail
                                   app_0
                                   (current-continuation-marks)))))
                             (void))
                           (eqv? r_0 1)))))))))))))))
(define 1/port-file-unlock
  (|#%name|
   port-file-unlock
   (lambda (p_0)
     (begin
       (if (1/file-stream-port? p_0)
         (void)
         (raise-argument-error 'port-file-unlock "file-stream-port?" p_0))
       (let ((cp_0
              (if (1/input-port? p_0)
                (->core-input-port.1 unsafe-undefined p_0 #f)
                (->core-output-port.1 unsafe-undefined p_0 #f))))
         (begin
           (unsafe-start-atomic)
           (begin
             (check-not-closed 'port-file-unlock cp_0)
             (let ((fd_0 (|#%app| (file-stream-ref cp_0) cp_0)))
               (let ((r_0
                      (|#%app|
                       rktio_file_unlock
                       (unsafe-place-local-ref cell.1)
                       fd_0)))
                 (begin
                   (unsafe-end-atomic)
                   (if (vector? r_0)
                     (let ((base-msg_0 "error unlocking file"))
                       (raise
                        (let ((app_0
                               (let ((msg_0
                                      (string-append
                                       base-msg_0
                                       "\n  system error: "
                                       (format-rktio-system-error-message
                                        r_0))))
                                 (error-message->adjusted-string
                                  'port-file-unlock
                                  'racket/primitive
                                  msg_0
                                  'racket/primitive))))
                          (|#%app|
                           exn:fail
                           app_0
                           (current-continuation-marks)))))
                     (void))))))))))))
(define make-get-location
  (lambda (user-get-location_0)
    (lambda (self_0)
      (begin
        (unsafe-end-atomic)
        (call-with-values
         (lambda () (|#%app| user-get-location_0))
         (case-lambda
          ((line_0 col_0 pos_0)
           (begin
             (if (let ((or-part_0 (not line_0)))
                   (if or-part_0 or-part_0 (exact-positive-integer? line_0)))
               (void)
               (raise-result-error
                '|user port get-location|
                "(or/c #f exact-positive-integer?)"
                line_0))
             (if (let ((or-part_0 (not line_0)))
                   (if or-part_0 or-part_0 (exact-nonnegative-integer? col_0)))
               (void)
               (raise-result-error
                '|user port get-location|
                "(or/c #f exact-nonnegative-integer?)"
                col_0))
             (if (let ((or-part_0 (not line_0)))
                   (if or-part_0 or-part_0 (exact-positive-integer? pos_0)))
               (void)
               (raise-result-error
                '|user port get-location|
                "(or/c #f exact-positive-integer?)"
                pos_0))
             (unsafe-start-atomic)
             (values line_0 col_0 pos_0)))
          (args_0
           (apply
            raise-arity-error
            '|user port get-location return|
            3
            args_0))))))))
(define check-init-position
  (lambda (who_0 user-init-position_0)
    (if (let ((or-part_0 (exact-positive-integer? user-init-position_0)))
          (if or-part_0
            or-part_0
            (let ((or-part_1 (1/input-port? user-init-position_0)))
              (if or-part_1
                or-part_1
                (let ((or-part_2 (1/output-port? user-init-position_0)))
                  (if or-part_2
                    or-part_2
                    (let ((or-part_3 (not user-init-position_0)))
                      (if or-part_3
                        or-part_3
                        (if (procedure? user-init-position_0)
                          (procedure-arity-includes? user-init-position_0 0)
                          #f)))))))))
      (void)
      (raise-argument-error
       who_0
       "(or/c exact-positive-integer? port? #f (procedure-arity-includes/c 0))"
       user-init-position_0))))
(define make-init-offset+file-position
  (lambda (user-init-position_0)
    (let ((init-offset_0
           (if (let ((or-part_0 (procedure? user-init-position_0)))
                 (if or-part_0
                   or-part_0
                   (let ((or-part_1 (1/input-port? user-init-position_0)))
                     (if or-part_1
                       or-part_1
                       (let ((or-part_2 (1/output-port? user-init-position_0)))
                         (if or-part_2
                           or-part_2
                           (not user-init-position_0)))))))
             #f
             (sub1 user-init-position_0))))
      (let ((file-position_0
             (if (1/input-port? user-init-position_0)
               user-init-position_0
               (if (1/output-port? user-init-position_0)
                 user-init-position_0
                 (if (procedure? user-init-position_0)
                   (|#%name|
                    file-position
                    (lambda (self_0)
                      (let ((pos_0 (|#%app| user-init-position_0)))
                        (begin
                          (if (let ((or-part_0 (not pos_0)))
                                (if or-part_0
                                  or-part_0
                                  (exact-positive-integer? pos_0)))
                            (void)
                            (raise-result-error
                             '|user port init-position|
                             "(or/c exact-positive-integer? #f)"
                             pos_0))
                          (if pos_0 (sub1 pos_0) #f)))))
                   #f)))))
        (values init-offset_0 file-position_0)))))
(define check-buffer-mode
  (lambda (who_0 user-buffer-mode_0)
    (if (let ((or-part_0 (not user-buffer-mode_0)))
          (if or-part_0
            or-part_0
            (if (procedure? user-buffer-mode_0)
              (if (procedure-arity-includes? user-buffer-mode_0 0)
                (procedure-arity-includes? user-buffer-mode_0 1)
                #f)
              #f)))
      (void)
      (raise-argument-error
       who_0
       (string-append
        "(or/c #f (and/c (procedure-arity-includes/c 0)\n"
        "                (procedure-arity-includes/c 1)))")
       user-buffer-mode_0))))
(define make-buffer-mode.1
  (|#%name|
   make-buffer-mode
   (lambda (output?1_0 user-buffer-mode3_0)
     (case-lambda
      ((self_0)
       (begin
         (unsafe-end-atomic)
         (let ((m_0 (|#%app| user-buffer-mode3_0)))
           (if (let ((or-part_0 (not m_0)))
                 (if or-part_0
                   or-part_0
                   (let ((or-part_1 (eq? m_0 'block)))
                     (if or-part_1
                       or-part_1
                       (let ((or-part_2 (eq? m_0 'none)))
                         (if or-part_2
                           or-part_2
                           (if output?1_0 (eq? m_0 'line) #f)))))))
             (begin (unsafe-start-atomic) m_0)
             (raise-result-error
              '|user port buffer-mode|
              (if output?1_0
                "(or/c 'block 'line 'none #f)"
                "(or/c 'block 'none #f)")
              m_0)))))
      ((self_0 m_0)
       (begin
         (unsafe-end-atomic)
         (begin0 (|#%app| user-buffer-mode3_0 m_0) (unsafe-start-atomic))))))))
(define 1/make-input-port
  (let ((make-input-port_0
         (|#%name|
          make-input-port
          (lambda (name7_0
                   user-read-in8_0
                   user-peek-in9_0
                   user-close10_0
                   user-get-progress-evt1_0
                   user-commit2_0
                   user-get-location3_0
                   user-count-lines!4_0
                   user-init-position5_0
                   user-buffer-mode6_0)
            (begin
              (if (let ((or-part_0 (1/input-port? user-read-in8_0)))
                    (if or-part_0
                      or-part_0
                      (if (procedure? user-read-in8_0)
                        (procedure-arity-includes? user-read-in8_0 1)
                        #f)))
                (void)
                (raise-argument-error
                 'make-input-port
                 "(or/c (procedure-arity-includes/c 1) input-port?)"
                 user-read-in8_0))
              (begin
                (if (let ((or-part_0 (not user-peek-in9_0)))
                      (if or-part_0
                        or-part_0
                        (let ((or-part_1 (1/input-port? user-peek-in9_0)))
                          (if or-part_1
                            or-part_1
                            (if (procedure? user-peek-in9_0)
                              (procedure-arity-includes? user-peek-in9_0 3)
                              #f)))))
                  (void)
                  (raise-argument-error
                   'make-input-port
                   "(or/c (procedure-arity-includes/c 3) input-port? #f)"
                   user-peek-in9_0))
                (begin
                  (if (if (procedure? user-close10_0)
                        (procedure-arity-includes? user-close10_0 0)
                        #f)
                    (void)
                    (raise-argument-error
                     'make-input-port
                     "(procedure-arity-includes/c 0)"
                     user-close10_0))
                  (begin
                    (if (let ((or-part_0 (not user-get-progress-evt1_0)))
                          (if or-part_0
                            or-part_0
                            (if (procedure? user-get-progress-evt1_0)
                              (procedure-arity-includes?
                               user-get-progress-evt1_0
                               0)
                              #f)))
                      (void)
                      (raise-argument-error
                       'make-input-port
                       "(or/c (procedure-arity-includes/c 0) #f)"
                       user-get-progress-evt1_0))
                    (begin
                      (if (let ((or-part_0 (not user-commit2_0)))
                            (if or-part_0
                              or-part_0
                              (if (procedure? user-commit2_0)
                                (procedure-arity-includes? user-commit2_0 3)
                                #f)))
                        (void)
                        (raise-argument-error
                         'make-input-port
                         "(or/c (procedure-arity-includes/c 3) #f)"
                         user-commit2_0))
                      (begin
                        (if (let ((or-part_0 (not user-get-location3_0)))
                              (if or-part_0
                                or-part_0
                                (if (procedure? user-get-location3_0)
                                  (procedure-arity-includes?
                                   user-get-location3_0
                                   0)
                                  #f)))
                          (void)
                          (raise-argument-error
                           'make-input-port
                           "(or/c (procedure-arity-includes/c 0) #f)"
                           user-get-location3_0))
                        (begin
                          (if (let ((or-part_0 (not user-count-lines!4_0)))
                                (if or-part_0
                                  or-part_0
                                  (if (procedure? user-count-lines!4_0)
                                    (procedure-arity-includes?
                                     user-count-lines!4_0
                                     0)
                                    #f)))
                            (void)
                            (raise-argument-error
                             'make-input-port
                             "(or/c (procedure-arity-includes/c 0) #f)"
                             user-count-lines!4_0))
                          (begin
                            (check-init-position
                             'make-input-port
                             user-init-position5_0)
                            (begin
                              (check-buffer-mode
                               'make-input-port
                               user-buffer-mode6_0)
                              (begin
                                (if (not
                                     (let ((app_0
                                            (1/input-port? user-read-in8_0)))
                                       (eqv?
                                        app_0
                                        (1/input-port? user-peek-in9_0))))
                                  (raise-arguments-error
                                   'make-input-port
                                   (if (1/input-port? user-read-in8_0)
                                     "read argument is an input port, but peek argument is not a port"
                                     "read argument is not an input port, but peek argument is a port")
                                   "read argument"
                                   user-read-in8_0
                                   "peek argument"
                                   user-peek-in9_0)
                                  (void))
                                (begin
                                  (if (if (not user-peek-in9_0)
                                        user-get-progress-evt1_0
                                        #f)
                                    (raise-arguments-error
                                     'make-input-port
                                     "peek argument is #f, but progress-evt argument is not"
                                     "progress-evt argument"
                                     user-get-progress-evt1_0)
                                    (void))
                                  (begin
                                    (if (if (not user-get-progress-evt1_0)
                                          user-commit2_0
                                          #f)
                                      (raise-arguments-error
                                       'make-input-port
                                       "progress-evt argument is #f, but commit argument is not"
                                       "commit argument"
                                       user-commit2_0)
                                      (void))
                                    (begin
                                      (if (if (not user-commit2_0)
                                            user-get-progress-evt1_0
                                            #f)
                                        (raise-arguments-error
                                         'make-input-port
                                         "commit argument is #f, but progress-evt argument is not"
                                         "progress-evt argument"
                                         user-get-progress-evt1_0)
                                        (void))
                                      (let ((input-pipe_0 #f))
                                        (let ((protect-in_0
                                               (|#%name|
                                                protect-in
                                                (lambda (dest-bstr_0
                                                         dest-start_0
                                                         dest-end_0
                                                         copy?_0
                                                         user-read-in_0)
                                                  (let ((len_0
                                                         (-
                                                          dest-end_0
                                                          dest-start_0)))
                                                    (let ((user-bstr_0
                                                           (if (if copy?_0
                                                                 copy?_0
                                                                 (let ((or-part_0
                                                                        (not
                                                                         (zero?
                                                                          dest-start_0))))
                                                                   (if or-part_0
                                                                     or-part_0
                                                                     (not
                                                                      (=
                                                                       len_0
                                                                       dest-end_0)))))
                                                             (make-bytes
                                                              (min len_0 8192))
                                                             dest-bstr_0)))
                                                      (let ((n_0
                                                             (|#%app|
                                                              user-read-in_0
                                                              user-bstr_0)))
                                                        (if (eq?
                                                             user-bstr_0
                                                             dest-bstr_0)
                                                          n_0
                                                          (if (evt? n_0)
                                                            (wrap-evt
                                                             n_0
                                                             (lambda (n_1)
                                                               (begin
                                                                 (if (exact-positive-integer?
                                                                      n_1)
                                                                   (unsafe-bytes-copy!
                                                                    dest-bstr_0
                                                                    dest-start_0
                                                                    user-bstr_0
                                                                    0
                                                                    n_1)
                                                                   (void))
                                                                 n_1)))
                                                            (begin
                                                              (if (exact-positive-integer?
                                                                   n_0)
                                                                (unsafe-bytes-copy!
                                                                 dest-bstr_0
                                                                 dest-start_0
                                                                 user-bstr_0
                                                                 0
                                                                 n_0)
                                                                (void))
                                                              n_0))))))))))
                                          (let ((check-read-result_0
                                                 (|#%name|
                                                  check-read-result
                                                  (lambda (ok-false?13_0
                                                           peek?12_0
                                                           who16_0
                                                           r17_0
                                                           dest-start18_0
                                                           dest-end19_0)
                                                    (if (exact-nonnegative-integer?
                                                         r17_0)
                                                      (if (<=
                                                           r17_0
                                                           (-
                                                            dest-end19_0
                                                            dest-start18_0))
                                                        (void)
                                                        (begin
                                                          (unsafe-end-atomic)
                                                          (raise-arguments-error
                                                           who16_0
                                                           "result integer is larger than the supplied byte string"
                                                           "result"
                                                           r17_0
                                                           "byte-string length"
                                                           (-
                                                            dest-end19_0
                                                            dest-start18_0))))
                                                      (if (eof-object? r17_0)
                                                        (void)
                                                        (if (if (procedure?
                                                                 r17_0)
                                                              (procedure-arity-includes?
                                                               r17_0
                                                               4)
                                                              #f)
                                                          (if user-peek-in9_0
                                                            (void)
                                                            (begin
                                                              (unsafe-end-atomic)
                                                              (raise-arguments-error
                                                               who16_0
                                                               (string-append
                                                                "the port has no specific peek procedure, so"
                                                                " a special read result is not allowed")
                                                               "special result"
                                                               r17_0)))
                                                          (if (pipe-input-port?*
                                                               r17_0)
                                                            (set! input-pipe_0
                                                              r17_0)
                                                            (if (evt? r17_0)
                                                              r17_0
                                                              (if (if peek?12_0
                                                                    (not r17_0)
                                                                    #f)
                                                                (if ok-false?13_0
                                                                  (void)
                                                                  (begin
                                                                    (unsafe-end-atomic)
                                                                    (raise-arguments-error
                                                                     who16_0
                                                                     "returned #f when no progress evt was supplied")))
                                                                (begin
                                                                  (unsafe-end-atomic)
                                                                  (raise-result-error
                                                                   who16_0
                                                                   (string-append
                                                                    "(or/c exact-nonnegative-integer? eof-object? evt? pipe-input-port?"
                                                                    (if (if peek?12_0
                                                                          ok-false?13_0
                                                                          #f)
                                                                      " #f"
                                                                      "")
                                                                    (if user-peek-in9_0
                                                                      " (procedure-arity-includes/c 4)"
                                                                      "")
                                                                    ")")
                                                                   r17_0))))))))))))
                                            (letrec*
                                             ((wrap-check-read-evt-result_0
                                               (|#%name|
                                                wrap-check-read-evt-result
                                                (lambda (who_0
                                                         evt_0
                                                         dest-start_0
                                                         dest-end_0
                                                         peek?_0
                                                         ok-false?_0)
                                                  (wrap-evt
                                                   evt_0
                                                   (lambda (r_0)
                                                     (begin
                                                       (unsafe-start-atomic)
                                                       (check-read-result_0
                                                        ok-false?_0
                                                        peek?_0
                                                        who_0
                                                        r_0
                                                        dest-start_0
                                                        dest-end_0)
                                                       (unsafe-end-atomic)
                                                       (if (pipe-input-port?*
                                                            r_0)
                                                         0
                                                         (if (evt? r_0)
                                                           (wrap-check-read-evt-result_0
                                                            who_0
                                                            r_0
                                                            dest-start_0
                                                            dest-end_0
                                                            peek?_0
                                                            ok-false?_0)
                                                           r_0)))))))))
                                             (let ((wrap-procedure-result_0
                                                    (|#%name|
                                                     wrap-procedure-result
                                                     (lambda (r_0)
                                                       (let ((called?_0 #f))
                                                         (let ((called!_0
                                                                (|#%name|
                                                                 called!
                                                                 (lambda ()
                                                                   (begin
                                                                     (if called?_0
                                                                       (raise-arguments-error
                                                                        'read-special
                                                                        "cannot be called a second time")
                                                                       (void))
                                                                     (set! called?_0
                                                                       #t))))))
                                                           (let ((four-args_0
                                                                  (|#%name|
                                                                   four-args
                                                                   (lambda (a_0
                                                                            b_0
                                                                            c_0
                                                                            d_0)
                                                                     (begin
                                                                       (called!_0)
                                                                       (if (let ((or-part_0
                                                                                  (not
                                                                                   b_0)))
                                                                             (if or-part_0
                                                                               or-part_0
                                                                               (exact-positive-integer?
                                                                                b_0)))
                                                                         (void)
                                                                         (raise-argument-error
                                                                          'read-special
                                                                          "(or/c exact-positive-integer? #f)"
                                                                          b_0))
                                                                       (if (let ((or-part_0
                                                                                  (not
                                                                                   c_0)))
                                                                             (if or-part_0
                                                                               or-part_0
                                                                               (exact-nonnegative-integer?
                                                                                c_0)))
                                                                         (void)
                                                                         (raise-argument-error
                                                                          'read-special
                                                                          "(or/c exact-nonnegative-integer? #f)"
                                                                          c_0))
                                                                       (if (let ((or-part_0
                                                                                  (not
                                                                                   d_0)))
                                                                             (if or-part_0
                                                                               or-part_0
                                                                               (exact-positive-integer?
                                                                                d_0)))
                                                                         (void)
                                                                         (raise-argument-error
                                                                          'read-special
                                                                          "(or/c exact-positive-integer? #f)"
                                                                          d_0))
                                                                       (|#%app|
                                                                        r_0
                                                                        a_0
                                                                        b_0
                                                                        c_0
                                                                        d_0))))))
                                                             (if (procedure-arity-includes?
                                                                  r_0
                                                                  0)
                                                               (case-lambda
                                                                (()
                                                                 (begin
                                                                   (called!_0)
                                                                   (|#%app|
                                                                    r_0)))
                                                                ((a_0
                                                                  b_0
                                                                  c_0
                                                                  d_0)
                                                                 (four-args_0
                                                                  a_0
                                                                  b_0
                                                                  c_0
                                                                  d_0)))
                                                               four-args_0))))))))
                                               (letrec*
                                                ((read-in_0
                                                  (|#%name|
                                                   read-in
                                                   (lambda (self_0
                                                            dest-bstr_0
                                                            dest-start_0
                                                            dest-end_0
                                                            copy?_0)
                                                     (if input-pipe_0
                                                       (if (zero?
                                                            (1/pipe-content-length
                                                             input-pipe_0))
                                                         (begin
                                                           (set! input-pipe_0
                                                             #f)
                                                           (read-in_0
                                                            self_0
                                                            dest-bstr_0
                                                            dest-start_0
                                                            dest-end_0
                                                            copy?_0))
                                                         (let ((o_0
                                                                input-pipe_0))
                                                           (|#%app|
                                                            (core-input-port-methods-read-in.1
                                                             (core-port-vtable
                                                              o_0))
                                                            o_0
                                                            dest-bstr_0
                                                            dest-start_0
                                                            dest-end_0
                                                            copy?_0)))
                                                       (let ((r_0
                                                              (with-continuation-mark*
                                                               push-authentic
                                                               break-enabled-key
                                                               (make-thread-cell
                                                                #f)
                                                               (begin
                                                                 (check-for-break)
                                                                 (begin
                                                                   (unsafe-end-atomic)
                                                                   (begin0
                                                                     (protect-in_0
                                                                      dest-bstr_0
                                                                      dest-start_0
                                                                      dest-end_0
                                                                      copy?_0
                                                                      user-read-in8_0)
                                                                     (unsafe-start-atomic)))))))
                                                         (begin
                                                           (check-read-result_0
                                                            #f
                                                            #f
                                                            '|user port read|
                                                            r_0
                                                            dest-start_0
                                                            dest-end_0)
                                                           (if (pipe-input-port?*
                                                                r_0)
                                                             (read-in_0
                                                              self_0
                                                              dest-bstr_0
                                                              dest-start_0
                                                              dest-end_0
                                                              copy?_0)
                                                             (if (evt? r_0)
                                                               (wrap-check-read-evt-result_0
                                                                '|user port read|
                                                                r_0
                                                                dest-start_0
                                                                dest-end_0
                                                                #f
                                                                #f)
                                                               (if (procedure?
                                                                    r_0)
                                                                 (wrap-procedure-result_0
                                                                  r_0)
                                                                 r_0))))))))))
                                                (let ((read-in/inner_0
                                                       (|#%name|
                                                        read-in/inner
                                                        (lambda (self_0
                                                                 dest-bstr_0
                                                                 dest-start_0
                                                                 dest-end_0
                                                                 copy?_0
                                                                 to-buffer_0)
                                                          (read-in_0
                                                           self_0
                                                           dest-bstr_0
                                                           dest-start_0
                                                           dest-end_0
                                                           copy?_0)))))
                                                  (letrec*
                                                   ((peek-in_0
                                                     (|#%name|
                                                      peek-in
                                                      (lambda (self_0
                                                               dest-bstr_0
                                                               dest-start_0
                                                               dest-end_0
                                                               skip-k_0
                                                               progress-evt_0
                                                               copy?_0)
                                                        (if input-pipe_0
                                                          (if (<=
                                                               (1/pipe-content-length
                                                                input-pipe_0)
                                                               skip-k_0)
                                                            (begin
                                                              (set! input-pipe_0
                                                                #f)
                                                              (peek-in_0
                                                               self_0
                                                               dest-bstr_0
                                                               dest-start_0
                                                               dest-end_0
                                                               skip-k_0
                                                               progress-evt_0
                                                               copy?_0))
                                                            (let ((o_0
                                                                   input-pipe_0))
                                                              (|#%app|
                                                               (core-input-port-methods-peek-in.1
                                                                (core-port-vtable
                                                                 o_0))
                                                               o_0
                                                               dest-bstr_0
                                                               dest-start_0
                                                               dest-end_0
                                                               skip-k_0
                                                               progress-evt_0
                                                               copy?_0)))
                                                          (let ((r_0
                                                                 (with-continuation-mark*
                                                                  push-authentic
                                                                  break-enabled-key
                                                                  (make-thread-cell
                                                                   #f)
                                                                  (begin
                                                                    (check-for-break)
                                                                    (begin
                                                                      (unsafe-end-atomic)
                                                                      (begin0
                                                                        (protect-in_0
                                                                         dest-bstr_0
                                                                         dest-start_0
                                                                         dest-end_0
                                                                         copy?_0
                                                                         (lambda (user-bstr_0)
                                                                           (|#%app|
                                                                            user-peek-in9_0
                                                                            user-bstr_0
                                                                            skip-k_0
                                                                            progress-evt_0)))
                                                                        (unsafe-start-atomic)))))))
                                                            (begin
                                                              (check-read-result_0
                                                               progress-evt_0
                                                               #t
                                                               '|user port peek|
                                                               r_0
                                                               dest-start_0
                                                               dest-end_0)
                                                              (if (pipe-input-port?*
                                                                   r_0)
                                                                (peek-in_0
                                                                 self_0
                                                                 dest-bstr_0
                                                                 dest-start_0
                                                                 dest-end_0
                                                                 skip-k_0
                                                                 progress-evt_0
                                                                 copy?_0)
                                                                (if (evt? r_0)
                                                                  (wrap-check-read-evt-result_0
                                                                   '|user port peek|
                                                                   r_0
                                                                   dest-start_0
                                                                   dest-end_0
                                                                   #t
                                                                   progress-evt_0)
                                                                  (if (procedure?
                                                                       r_0)
                                                                    (wrap-procedure-result_0
                                                                     r_0)
                                                                    r_0))))))))))
                                                   (let ((byte-ready_0
                                                          (|#%name|
                                                           byte-ready
                                                           (lambda (self_0
                                                                    work-done!_0)
                                                             (if (if input-pipe_0
                                                                   (positive?
                                                                    (1/pipe-content-length
                                                                     input-pipe_0))
                                                                   #f)
                                                               #t
                                                               (let ((bstr_0
                                                                      (make-bytes
                                                                       1)))
                                                                 (let ((v_0
                                                                        (peek-in_0
                                                                         self_0
                                                                         bstr_0
                                                                         0
                                                                         1
                                                                         0
                                                                         #f
                                                                         #f)))
                                                                   (begin
                                                                     (|#%app|
                                                                      work-done!_0)
                                                                     (if (evt?
                                                                          v_0)
                                                                       v_0
                                                                       (not
                                                                        (eqv?
                                                                         v_0
                                                                         0)))))))))))
                                                     (let ((close_0
                                                            (|#%name|
                                                             close
                                                             (lambda (self_0)
                                                               (begin
                                                                 (unsafe-end-atomic)
                                                                 (|#%app|
                                                                  user-close10_0)
                                                                 (unsafe-start-atomic))))))
                                                       (let ((get-progress-evt_0
                                                              (|#%name|
                                                               get-progress-evt
                                                               (lambda (self_0)
                                                                 (let ((r_0
                                                                        (|#%app|
                                                                         user-get-progress-evt1_0)))
                                                                   (begin
                                                                     (if (evt?
                                                                          r_0)
                                                                       (void)
                                                                       (raise-result-error
                                                                        '|user port progress-evt|
                                                                        "evt?"
                                                                        r_0))
                                                                     r_0))))))
                                                         (let ((commit_0
                                                                (|#%name|
                                                                 commit
                                                                 (lambda (self_0
                                                                          amt_0
                                                                          evt_0
                                                                          ext-evt_0
                                                                          finish_0)
                                                                   (let ((r_0
                                                                          (with-continuation-mark*
                                                                           push-authentic
                                                                           break-enabled-key
                                                                           (make-thread-cell
                                                                            #f)
                                                                           (begin
                                                                             (check-for-break)
                                                                             (begin
                                                                               (unsafe-end-atomic)
                                                                               (begin0
                                                                                 (|#%app|
                                                                                  user-commit2_0
                                                                                  amt_0
                                                                                  evt_0
                                                                                  ext-evt_0)
                                                                                 (unsafe-start-atomic)))))))
                                                                     (if (not
                                                                          r_0)
                                                                       #f
                                                                       (if (bytes?
                                                                            r_0)
                                                                         (begin
                                                                           (|#%app|
                                                                            finish_0
                                                                            r_0)
                                                                           #t)
                                                                         (begin
                                                                           (|#%app|
                                                                            finish_0
                                                                            (make-bytes
                                                                             amt_0
                                                                             120))
                                                                           #t))))))))
                                                           (let ((get-location_0
                                                                  (if user-get-location3_0
                                                                    (make-get-location
                                                                     user-get-location3_0)
                                                                    #f)))
                                                             (let ((count-lines!_0
                                                                    (if user-count-lines!4_0
                                                                      (|#%name|
                                                                       count-lines!
                                                                       (lambda (self_0)
                                                                         (begin
                                                                           (unsafe-end-atomic)
                                                                           (|#%app|
                                                                            user-count-lines!4_0)
                                                                           (unsafe-start-atomic))))
                                                                      #f)))
                                                               (call-with-values
                                                                (lambda ()
                                                                  (make-init-offset+file-position
                                                                   user-init-position5_0))
                                                                (lambda (init-offset_0
                                                                         file-position_0)
                                                                  (let ((buffer-mode_0
                                                                         (if user-buffer-mode6_0
                                                                           (make-buffer-mode.1
                                                                            #f
                                                                            user-buffer-mode6_0)
                                                                           #f)))
                                                                    (finish-port/count
                                                                     (if user-peek-in9_0
                                                                       (let ((app_0
                                                                              (let ((app_0
                                                                                     (core-input-port-methods-prepare-change.1
                                                                                      core-input-port-vtable.1)))
                                                                                (let ((app_1
                                                                                       (if (1/input-port?
                                                                                            user-read-in8_0)
                                                                                         user-read-in8_0
                                                                                         read-in_0)))
                                                                                  (let ((app_2
                                                                                         (if (1/input-port?
                                                                                              user-peek-in9_0)
                                                                                           user-peek-in9_0
                                                                                           peek-in_0)))
                                                                                    (core-input-port-methods6.1
                                                                                     close_0
                                                                                     count-lines!_0
                                                                                     get-location_0
                                                                                     file-position_0
                                                                                     buffer-mode_0
                                                                                     app_0
                                                                                     app_1
                                                                                     app_2
                                                                                     (if (1/input-port?
                                                                                          user-peek-in9_0)
                                                                                       user-peek-in9_0
                                                                                       byte-ready_0)
                                                                                     (if user-get-progress-evt1_0
                                                                                       get-progress-evt_0
                                                                                       #f)
                                                                                     (if user-commit2_0
                                                                                       commit_0
                                                                                       #f)))))))
                                                                         (create-core-input-port
                                                                          app_0
                                                                          name7_0
                                                                          (direct2.1
                                                                           #f
                                                                           0
                                                                           0)
                                                                          #f
                                                                          #f
                                                                          init-offset_0
                                                                          #f
                                                                          #f
                                                                          #f))
                                                                       (let ((app_0
                                                                              (let ((app_0
                                                                                     (core-input-port-methods-prepare-change.1
                                                                                      peek-via-read-input-port-vtable.1)))
                                                                                (let ((app_1
                                                                                       (core-input-port-methods-read-in.1
                                                                                        peek-via-read-input-port-vtable.1)))
                                                                                  (let ((app_2
                                                                                         (core-input-port-methods-peek-in.1
                                                                                          peek-via-read-input-port-vtable.1)))
                                                                                    (let ((app_3
                                                                                           (core-input-port-methods-byte-ready.1
                                                                                            peek-via-read-input-port-vtable.1)))
                                                                                      (let ((app_4
                                                                                             (core-input-port-methods-get-progress-evt.1
                                                                                              peek-via-read-input-port-vtable.1)))
                                                                                        (let ((app_5
                                                                                               (core-input-port-methods-commit.1
                                                                                                peek-via-read-input-port-vtable.1)))
                                                                                          (peek-via-read-input-port-methods10.1
                                                                                           (values
                                                                                            (lambda (self_0)
                                                                                              (begin
                                                                                                (close_0
                                                                                                 self_0)
                                                                                                (temp7.1
                                                                                                 self_0))))
                                                                                           count-lines!_0
                                                                                           get-location_0
                                                                                           file-position_0
                                                                                           (if buffer-mode_0
                                                                                             buffer-mode_0
                                                                                             (case-lambda
                                                                                              ((self_0)
                                                                                               (temp9.1
                                                                                                self_0))
                                                                                              ((self_0
                                                                                                mode_0)
                                                                                               (temp9.1
                                                                                                self_0
                                                                                                mode_0))))
                                                                                           app_0
                                                                                           app_1
                                                                                           app_2
                                                                                           app_3
                                                                                           app_4
                                                                                           app_5
                                                                                           read-in/inner_0
                                                                                           (peek-via-read-input-port-methods-byte-ready/inner.1
                                                                                            peek-via-read-input-port-vtable.1))))))))))
                                                                         (let ((app_1
                                                                                (direct2.1
                                                                                 #f
                                                                                 0
                                                                                 0)))
                                                                           (create-peek-via-read-input-port
                                                                            app_0
                                                                            name7_0
                                                                            app_1
                                                                            #f
                                                                            #f
                                                                            init-offset_0
                                                                            #f
                                                                            #f
                                                                            #f
                                                                            #f
                                                                            #f
                                                                            (make-bytes
                                                                             4096)
                                                                            0
                                                                            0
                                                                            #f
                                                                            'block)))))))))))))))))))))))))))))))))))))))
    (|#%name|
     make-input-port
     (case-lambda
      ((name_0 user-read-in_0 user-peek-in_0 user-close_0)
       (make-input-port_0
        name_0
        user-read-in_0
        user-peek-in_0
        user-close_0
        #f
        #f
        #f
        void
        1
        #f))
      ((name_0
        user-read-in_0
        user-peek-in_0
        user-close_0
        user-get-progress-evt_0
        user-commit_0
        user-get-location_0
        user-count-lines!_0
        user-init-position_0
        user-buffer-mode6_0)
       (make-input-port_0
        name_0
        user-read-in_0
        user-peek-in_0
        user-close_0
        user-get-progress-evt_0
        user-commit_0
        user-get-location_0
        user-count-lines!_0
        user-init-position_0
        user-buffer-mode6_0))
      ((name_0
        user-read-in_0
        user-peek-in_0
        user-close_0
        user-get-progress-evt_0
        user-commit_0
        user-get-location_0
        user-count-lines!_0
        user-init-position5_0)
       (make-input-port_0
        name_0
        user-read-in_0
        user-peek-in_0
        user-close_0
        user-get-progress-evt_0
        user-commit_0
        user-get-location_0
        user-count-lines!_0
        user-init-position5_0
        #f))
      ((name_0
        user-read-in_0
        user-peek-in_0
        user-close_0
        user-get-progress-evt_0
        user-commit_0
        user-get-location_0
        user-count-lines!4_0)
       (make-input-port_0
        name_0
        user-read-in_0
        user-peek-in_0
        user-close_0
        user-get-progress-evt_0
        user-commit_0
        user-get-location_0
        user-count-lines!4_0
        1
        #f))
      ((name_0
        user-read-in_0
        user-peek-in_0
        user-close_0
        user-get-progress-evt_0
        user-commit_0
        user-get-location3_0)
       (make-input-port_0
        name_0
        user-read-in_0
        user-peek-in_0
        user-close_0
        user-get-progress-evt_0
        user-commit_0
        user-get-location3_0
        void
        1
        #f))
      ((name_0
        user-read-in_0
        user-peek-in_0
        user-close_0
        user-get-progress-evt_0
        user-commit2_0)
       (make-input-port_0
        name_0
        user-read-in_0
        user-peek-in_0
        user-close_0
        user-get-progress-evt_0
        user-commit2_0
        #f
        void
        1
        #f))
      ((name_0
        user-read-in_0
        user-peek-in_0
        user-close_0
        user-get-progress-evt1_0)
       (make-input-port_0
        name_0
        user-read-in_0
        user-peek-in_0
        user-close_0
        user-get-progress-evt1_0
        #f
        #f
        void
        1
        #f))))))
(define 1/make-output-port
  (let ((make-output-port_0
         (|#%name|
          make-output-port
          (lambda (name8_0
                   evt9_0
                   user-write-out10_0
                   user-close11_0
                   user-write-out-special1_0
                   user-get-write-evt2_0
                   user-get-write-special-evt3_0
                   user-get-location4_0
                   user-count-lines!5_0
                   user-init-position6_0
                   user-buffer-mode7_0)
            (begin
              (if (evt? evt9_0)
                (void)
                (raise-argument-error 'make-output-port "evt?" evt9_0))
              (begin
                (if (let ((or-part_0 (1/output-port? user-write-out10_0)))
                      (if or-part_0
                        or-part_0
                        (if (procedure? user-write-out10_0)
                          (procedure-arity-includes? user-write-out10_0 5)
                          #f)))
                  (void)
                  (raise-argument-error
                   'make-output-port
                   "(or/c output-port? (procedure-arity-includes/c 5))"
                   user-write-out10_0))
                (begin
                  (if (if (procedure? user-close11_0)
                        (procedure-arity-includes? user-close11_0 0)
                        #f)
                    (void)
                    (raise-argument-error
                     'make-output-port
                     "(procedure-arity-includes/c 0)"
                     user-close11_0))
                  (begin
                    (if (let ((or-part_0 (not user-write-out-special1_0)))
                          (if or-part_0
                            or-part_0
                            (let ((or-part_1
                                   (1/output-port? user-write-out-special1_0)))
                              (if or-part_1
                                or-part_1
                                (if (procedure? user-write-out-special1_0)
                                  (procedure-arity-includes?
                                   user-write-out-special1_0
                                   3)
                                  #f)))))
                      (void)
                      (raise-argument-error
                       'make-output-port
                       "(or/c #f output-port? (procedure-arity-includes/c 3))"
                       user-write-out-special1_0))
                    (begin
                      (if (let ((or-part_0 (not user-get-write-evt2_0)))
                            (if or-part_0
                              or-part_0
                              (if (procedure? user-get-write-evt2_0)
                                (procedure-arity-includes?
                                 user-get-write-evt2_0
                                 3)
                                #f)))
                        (void)
                        (raise-argument-error
                         'make-output-port
                         "(or/c #f (procedure-arity-includes/c 3))"
                         user-get-write-evt2_0))
                      (begin
                        (if (let ((or-part_0
                                   (not user-get-write-special-evt3_0)))
                              (if or-part_0
                                or-part_0
                                (if (procedure? user-get-write-special-evt3_0)
                                  (procedure-arity-includes?
                                   user-get-write-special-evt3_0
                                   1)
                                  #f)))
                          (void)
                          (raise-argument-error
                           'make-output-port
                           "(or/c #f (procedure-arity-includes/c 1))"
                           user-get-write-special-evt3_0))
                        (begin
                          (if (let ((or-part_0 (not user-get-location4_0)))
                                (if or-part_0
                                  or-part_0
                                  (if (procedure? user-get-location4_0)
                                    (procedure-arity-includes?
                                     user-get-location4_0
                                     0)
                                    #f)))
                            (void)
                            (raise-argument-error
                             'make-output-port
                             "(or/c #f (procedure-arity-includes/c 0))"
                             user-get-location4_0))
                          (begin
                            (if (if (procedure? user-count-lines!5_0)
                                  (procedure-arity-includes?
                                   user-count-lines!5_0
                                   0)
                                  #f)
                              (void)
                              (raise-argument-error
                               'make-output-port
                               "(procedure-arity-includes/c 0)"
                               user-count-lines!5_0))
                            (begin
                              (check-init-position
                               'make-output-port
                               user-init-position6_0)
                              (begin
                                (check-buffer-mode
                                 'make-output-port
                                 user-buffer-mode7_0)
                                (begin
                                  (if (if (not user-write-out-special1_0)
                                        user-get-write-special-evt3_0
                                        #f)
                                    (raise-arguments-error
                                     'make-output-port
                                     "write-special argument is #f, but get-write-special-evt argument is not"
                                     "get-write-special-evt argument"
                                     user-get-write-special-evt3_0)
                                    (void))
                                  (begin
                                    (if (if (not user-get-write-evt2_0)
                                          user-get-write-special-evt3_0
                                          #f)
                                      (raise-arguments-error
                                       'make-output-port
                                       "get-write-evt argument is #f, but get-write-special-evt argument is not"
                                       "get-write-special-evt argument"
                                       user-get-write-special-evt3_0)
                                      (void))
                                    (begin
                                      (if (if (not
                                               user-get-write-special-evt3_0)
                                            (if user-get-write-evt2_0
                                              user-write-out-special1_0
                                              #f)
                                            #f)
                                        (raise-arguments-error
                                         'make-output-port
                                         "get-write-special-evt argument is #f, but get-write-evt argument is not, and write-special argument is not"
                                         "get-write-evt argument"
                                         user-get-write-evt2_0
                                         "get-write-special-evt argument"
                                         user-get-write-special-evt3_0)
                                        (void))
                                      (let ((output-pipe_0 #f))
                                        (let ((check-write-result_0
                                               (|#%name|
                                                check-write-result
                                                (lambda (as-evt?13_0
                                                         who15_0
                                                         r16_0
                                                         start17_0
                                                         end18_0
                                                         non-block/buffer?19_0)
                                                  (if (exact-nonnegative-integer?
                                                       r16_0)
                                                    (if (eqv? r16_0 0)
                                                      (if (= start17_0 end18_0)
                                                        (void)
                                                        (begin
                                                          (unsafe-end-atomic)
                                                          (raise-arguments-error
                                                           who15_0
                                                           (string-append
                                                            "bad result for non-flush write"
                                                            (if as-evt?13_0
                                                              " event"
                                                              ""))
                                                           "result"
                                                           r16_0)))
                                                      (if (<=
                                                           r16_0
                                                           (-
                                                            end18_0
                                                            start17_0))
                                                        (void)
                                                        (begin
                                                          (unsafe-end-atomic)
                                                          (raise-arguments-error
                                                           who15_0
                                                           "result integer is larger than the supplied byte string"
                                                           "result"
                                                           r16_0
                                                           "byte string length"
                                                           (-
                                                            end18_0
                                                            start17_0)))))
                                                    (if (not r16_0)
                                                      r16_0
                                                      (if (pipe-output-port?*
                                                           r16_0)
                                                        (begin
                                                          (if (=
                                                               start17_0
                                                               end18_0)
                                                            (begin
                                                              (unsafe-end-atomic)
                                                              (raise-arguments-error
                                                               who15_0
                                                               "bad result for a flushing write"
                                                               "result"
                                                               r16_0))
                                                            (void))
                                                          (if non-block/buffer?19_0
                                                            (begin
                                                              (unsafe-end-atomic)
                                                              (raise-arguments-error
                                                               who15_0
                                                               "bad result for a non-blocking write"
                                                               "result"
                                                               r16_0))
                                                            (void))
                                                          (set! output-pipe_0
                                                            r16_0))
                                                        (if (evt? r16_0)
                                                          (void)
                                                          (begin
                                                            (unsafe-end-atomic)
                                                            (raise-result-error
                                                             who15_0
                                                             "(or/c exact-nonnegative-integer? #f evt?)"
                                                             r16_0))))))))))
                                          (letrec*
                                           ((wrap-check-write-evt-result_0
                                             (|#%name|
                                              wrap-check-write-evt-result
                                              (lambda (who_0
                                                       evt_0
                                                       start_0
                                                       end_0
                                                       non-block/buffer?_0)
                                                (wrap-evt
                                                 evt_0
                                                 (lambda (r_0)
                                                   (begin
                                                     (unsafe-start-atomic)
                                                     (check-write-result_0
                                                      #t
                                                      who_0
                                                      r_0
                                                      start_0
                                                      end_0
                                                      non-block/buffer?_0)
                                                     (unsafe-end-atomic)
                                                     (if (pipe-output-port?*
                                                          r_0)
                                                       0
                                                       (if (evt? r_0)
                                                         (wrap-check-write-evt-result_0
                                                          who_0
                                                          r_0
                                                          start_0
                                                          end_0
                                                          non-block/buffer?_0)
                                                         r_0)))))))))
                                           (letrec*
                                            ((write-out_0
                                              (|#%name|
                                               write-out
                                               (lambda (self_0
                                                        bstr_0
                                                        start_0
                                                        end_0
                                                        non-block/buffer?_0
                                                        enable-break?_0
                                                        copy?_0)
                                                 (if output-pipe_0
                                                   (if (if non-block/buffer?_0
                                                         non-block/buffer?_0
                                                         (let ((or-part_0
                                                                (=
                                                                 start_0
                                                                 end_0)))
                                                           (if or-part_0
                                                             or-part_0
                                                             (not
                                                              (sync/timeout
                                                               0
                                                               output-pipe_0)))))
                                                     (begin
                                                       (set! output-pipe_0 #f)
                                                       (write-out_0
                                                        self_0
                                                        bstr_0
                                                        start_0
                                                        end_0
                                                        non-block/buffer?_0
                                                        enable-break?_0
                                                        copy?_0))
                                                     (let ((o_0 output-pipe_0))
                                                       (|#%app|
                                                        (core-output-port-methods-write-out.1
                                                         (core-port-vtable
                                                          o_0))
                                                        o_0
                                                        bstr_0
                                                        start_0
                                                        end_0
                                                        non-block/buffer?_0
                                                        enable-break?_0
                                                        copy?_0)))
                                                   (call-with-values
                                                    (lambda ()
                                                      (if (if copy?_0
                                                            (not
                                                             (immutable?
                                                              bstr_0))
                                                            #f)
                                                        (let ((app_0
                                                               (unsafe-bytes->immutable-bytes!
                                                                (subbytes
                                                                 bstr_0
                                                                 start_0
                                                                 end_0))))
                                                          (values
                                                           app_0
                                                           0
                                                           (- end_0 start_0)))
                                                        (values
                                                         (unsafe-bytes->immutable-bytes!
                                                          bstr_0)
                                                         start_0
                                                         end_0)))
                                                    (lambda (imm-bstr_0
                                                             imm-start_0
                                                             imm-end_0)
                                                      (let ((r_0
                                                             (let ((enable-break?_1
                                                                    (if (not
                                                                         non-block/buffer?_0)
                                                                      (break-enabled)
                                                                      #f)))
                                                               (with-continuation-mark*
                                                                push-authentic
                                                                break-enabled-key
                                                                (make-thread-cell
                                                                 #f)
                                                                (begin
                                                                  (check-for-break)
                                                                  (begin
                                                                    (unsafe-end-atomic)
                                                                    (begin0
                                                                      (|#%app|
                                                                       user-write-out10_0
                                                                       imm-bstr_0
                                                                       imm-start_0
                                                                       imm-end_0
                                                                       non-block/buffer?_0
                                                                       enable-break?_1)
                                                                      (unsafe-start-atomic))))))))
                                                        (begin
                                                          (check-write-result_0
                                                           #f
                                                           '|user port write|
                                                           r_0
                                                           imm-start_0
                                                           imm-end_0
                                                           non-block/buffer?_0)
                                                          (if (pipe-output-port?*
                                                               r_0)
                                                            (write-out_0
                                                             self_0
                                                             imm-bstr_0
                                                             imm-start_0
                                                             imm-end_0
                                                             non-block/buffer?_0
                                                             enable-break?_0
                                                             copy?_0)
                                                            (if (evt? r_0)
                                                              (wrap-check-write-evt-result_0
                                                               '|user port write|
                                                               r_0
                                                               imm-start_0
                                                               imm-end_0
                                                               non-block/buffer?_0)
                                                              r_0)))))))))))
                                            (let ((get-write-evt_0
                                                   (|#%name|
                                                    get-write-evt
                                                    (lambda (self_0
                                                             bstr_0
                                                             start_0
                                                             end_0)
                                                      (call-with-values
                                                       (lambda ()
                                                         (if (immutable?
                                                              bstr_0)
                                                           (values
                                                            bstr_0
                                                            start_0
                                                            end_0)
                                                           (let ((app_0
                                                                  (unsafe-bytes->immutable-bytes!
                                                                   (subbytes
                                                                    bstr_0
                                                                    start_0
                                                                    end_0))))
                                                             (values
                                                              app_0
                                                              0
                                                              (-
                                                               end_0
                                                               start_0)))))
                                                       (lambda (imm-bstr_0
                                                                imm-start_0
                                                                imm-end_0)
                                                         (begin
                                                           (unsafe-end-atomic)
                                                           (let ((r_0
                                                                  (|#%app|
                                                                   user-get-write-evt2_0
                                                                   imm-bstr_0
                                                                   imm-start_0
                                                                   imm-end_0)))
                                                             (begin
                                                               (if (evt? r_0)
                                                                 (void)
                                                                 (raise-result-error
                                                                  '|user port get-write-evt|
                                                                  "evt?"
                                                                  r_0))
                                                               (unsafe-start-atomic)
                                                               (wrap-check-write-evt-result_0
                                                                '|user port write-evt|
                                                                r_0
                                                                imm-start_0
                                                                imm-end_0
                                                                #t))))))))))
                                              (let ((write-out-special_0
                                                     (|#%name|
                                                      write-out-special
                                                      (lambda (self_0
                                                               v_0
                                                               non-block/buffer?_0
                                                               enable-break?_0)
                                                        (let ((enable-break?_1
                                                               (if (not
                                                                    non-block/buffer?_0)
                                                                 (break-enabled)
                                                                 #f)))
                                                          (with-continuation-mark*
                                                           authentic
                                                           break-enabled-key
                                                           (make-thread-cell
                                                            #f)
                                                           (begin
                                                             (check-for-break)
                                                             (begin
                                                               (unsafe-end-atomic)
                                                               (begin0
                                                                 (|#%app|
                                                                  user-write-out-special1_0
                                                                  v_0
                                                                  non-block/buffer?_0
                                                                  enable-break?_1)
                                                                 (unsafe-start-atomic))))))))))
                                                (let ((get-location_0
                                                       (if user-get-location4_0
                                                         (make-get-location
                                                          user-get-location4_0)
                                                         #f)))
                                                  (let ((count-lines!_0
                                                         (if user-count-lines!5_0
                                                           (|#%name|
                                                            count-lines!
                                                            (lambda (self_0)
                                                              (begin
                                                                (unsafe-end-atomic)
                                                                (|#%app|
                                                                 user-count-lines!5_0)
                                                                (unsafe-start-atomic))))
                                                           #f)))
                                                    (call-with-values
                                                     (lambda ()
                                                       (make-init-offset+file-position
                                                        user-init-position6_0))
                                                     (lambda (init-offset_0
                                                              file-position_0)
                                                       (let ((buffer-mode_0
                                                              (if user-buffer-mode7_0
                                                                (make-buffer-mode.1
                                                                 #t
                                                                 user-buffer-mode7_0)
                                                                #f)))
                                                         (let ((close_0
                                                                (|#%name|
                                                                 close
                                                                 (lambda (self_0)
                                                                   (begin
                                                                     (unsafe-end-atomic)
                                                                     (|#%app|
                                                                      user-close11_0)
                                                                     (unsafe-start-atomic))))))
                                                           (finish-port/count
                                                            (let ((app_0
                                                                   (let ((app_0
                                                                          (if (1/output-port?
                                                                               user-write-out10_0)
                                                                            user-write-out10_0
                                                                            write-out_0)))
                                                                     (core-output-port-methods6.1
                                                                      close_0
                                                                      count-lines!_0
                                                                      get-location_0
                                                                      file-position_0
                                                                      buffer-mode_0
                                                                      app_0
                                                                      (if (1/output-port?
                                                                           user-write-out-special1_0)
                                                                        user-write-out-special1_0
                                                                        (if user-write-out-special1_0
                                                                          write-out-special_0
                                                                          #f))
                                                                      (if user-get-write-evt2_0
                                                                        get-write-evt_0
                                                                        #f)
                                                                      (if user-get-write-special-evt3_0
                                                                        (lambda (self_0
                                                                                 v_0)
                                                                          (|#%app|
                                                                           user-get-write-special-evt3_0
                                                                           v_0))
                                                                        #f)))))
                                                              (create-core-output-port
                                                               app_0
                                                               name8_0
                                                               (direct2.1
                                                                #f
                                                                0
                                                                0)
                                                               #f
                                                               #f
                                                               init-offset_0
                                                               #f
                                                               evt9_0
                                                               #f
                                                               #f
                                                               #f))))))))))))))))))))))))))))))))
    (|#%name|
     make-output-port
     (case-lambda
      ((name_0 evt_0 user-write-out_0 user-close_0)
       (make-output-port_0
        name_0
        evt_0
        user-write-out_0
        user-close_0
        #f
        #f
        #f
        #f
        void
        1
        #f))
      ((name_0
        evt_0
        user-write-out_0
        user-close_0
        user-write-out-special_0
        user-get-write-evt_0
        user-get-write-special-evt_0
        user-get-location_0
        user-count-lines!_0
        user-init-position_0
        user-buffer-mode7_0)
       (make-output-port_0
        name_0
        evt_0
        user-write-out_0
        user-close_0
        user-write-out-special_0
        user-get-write-evt_0
        user-get-write-special-evt_0
        user-get-location_0
        user-count-lines!_0
        user-init-position_0
        user-buffer-mode7_0))
      ((name_0
        evt_0
        user-write-out_0
        user-close_0
        user-write-out-special_0
        user-get-write-evt_0
        user-get-write-special-evt_0
        user-get-location_0
        user-count-lines!_0
        user-init-position6_0)
       (make-output-port_0
        name_0
        evt_0
        user-write-out_0
        user-close_0
        user-write-out-special_0
        user-get-write-evt_0
        user-get-write-special-evt_0
        user-get-location_0
        user-count-lines!_0
        user-init-position6_0
        #f))
      ((name_0
        evt_0
        user-write-out_0
        user-close_0
        user-write-out-special_0
        user-get-write-evt_0
        user-get-write-special-evt_0
        user-get-location_0
        user-count-lines!5_0)
       (make-output-port_0
        name_0
        evt_0
        user-write-out_0
        user-close_0
        user-write-out-special_0
        user-get-write-evt_0
        user-get-write-special-evt_0
        user-get-location_0
        user-count-lines!5_0
        1
        #f))
      ((name_0
        evt_0
        user-write-out_0
        user-close_0
        user-write-out-special_0
        user-get-write-evt_0
        user-get-write-special-evt_0
        user-get-location4_0)
       (make-output-port_0
        name_0
        evt_0
        user-write-out_0
        user-close_0
        user-write-out-special_0
        user-get-write-evt_0
        user-get-write-special-evt_0
        user-get-location4_0
        void
        1
        #f))
      ((name_0
        evt_0
        user-write-out_0
        user-close_0
        user-write-out-special_0
        user-get-write-evt_0
        user-get-write-special-evt3_0)
       (make-output-port_0
        name_0
        evt_0
        user-write-out_0
        user-close_0
        user-write-out-special_0
        user-get-write-evt_0
        user-get-write-special-evt3_0
        #f
        void
        1
        #f))
      ((name_0
        evt_0
        user-write-out_0
        user-close_0
        user-write-out-special_0
        user-get-write-evt2_0)
       (make-output-port_0
        name_0
        evt_0
        user-write-out_0
        user-close_0
        user-write-out-special_0
        user-get-write-evt2_0
        #f
        #f
        void
        1
        #f))
      ((name_0 evt_0 user-write-out_0 user-close_0 user-write-out-special1_0)
       (make-output-port_0
        name_0
        evt_0
        user-write-out_0
        user-close_0
        user-write-out-special1_0
        #f
        #f
        #f
        void
        1
        #f))))))
(define 1/port-read-handler
  (|#%name|
   port-read-handler
   (case-lambda
    ((i_0)
     (begin
       (if (1/input-port? i_0)
         (void)
         (raise-argument-error 'port-read-handler "input-port?" i_0))
       (let ((i_1 (->core-input-port.1 unsafe-undefined i_0 #f)))
         (let ((or-part_0 (core-input-port-read-handler i_1)))
           (if or-part_0 or-part_0 default-port-read-handler)))))
    ((i_0 h_0)
     (begin
       (if (1/input-port? i_0)
         (void)
         (raise-argument-error 'port-read-handler "input-port?" i_0))
       (if (if (procedure? h_0)
             (if (procedure-arity-includes? h_0 1)
               (procedure-arity-includes? h_0 2)
               #f)
             #f)
         (void)
         (raise-argument-error
          'port-read-handler
          "(and/c (procedure-arity-includes/c 1) (procedure-arity-includes/c 2))"
          h_0))
       (let ((i_1 (->core-input-port.1 unsafe-undefined i_0 #f)))
         (set-core-input-port-read-handler! i_1 h_0)))))))
(define default-port-read-handler
  (case-lambda
   ((i_0)
    (begin
      (if (1/input-port? i_0)
        (void)
        (raise-argument-error 'default-port-read-handler "input-port?" i_0))
      (maybe-flush-stdout i_0)
      (|#%app| installed-read i_0)))
   ((i_0 src_0)
    (begin
      (if (1/input-port? i_0)
        (void)
        (raise-argument-error 'default-port-read-handler "input-port?" i_0))
      (maybe-flush-stdout i_0)
      (|#%app| installed-read-syntax src_0 i_0)))))
(define installed-read #f)
(define installed-read-syntax #f)
(define installed-read-accept-reader #f)
(define installed-read-accept-lang #f)
(define install-reader!
  (lambda (read_0 read-syntax_0 read-accept-reader_0 read-accept-lang_0)
    (begin
      (set! installed-read read_0)
      (set! installed-read-syntax read-syntax_0)
      (set! installed-read-accept-reader installed-read-accept-reader)
      (set! installed-read-accept-lang read-accept-lang_0))))
(define 1/port-write-handler
  (|#%name|
   port-write-handler
   (case-lambda
    ((o_0)
     (begin
       (if (1/output-port? o_0)
         (void)
         (raise-argument-error 'port-write-handler "output-port?" o_0))
       (let ((o_1 (->core-output-port.1 unsafe-undefined o_0 #f)))
         (let ((or-part_0 (core-output-port-write-handler o_1)))
           (if or-part_0 or-part_0 default-port-write-handler)))))
    ((o_0 h_0)
     (begin
       (if (1/output-port? o_0)
         (void)
         (raise-argument-error 'port-write-handler "output-port?" o_0))
       (if (if (procedure? h_0) (procedure-arity-includes? h_0 2) #f)
         (void)
         (raise-argument-error
          'port-write-handler
          "(procedure-arity-includes/c 2)"
          h_0))
       (let ((o_1 (->core-output-port.1 unsafe-undefined o_0 #f)))
         (set-core-output-port-write-handler!
          o_1
          (if (eq? h_0 default-port-write-handler) #f h_0))))))))
(define default-port-write-handler
  (lambda (v_0 o_0)
    (let ((co_0
           (->core-output-port.1
            unsafe-undefined
            o_0
            'default-port-write-handler)))
      (do-write 'write v_0 co_0))))
(define 1/port-display-handler
  (|#%name|
   port-display-handler
   (case-lambda
    ((o_0)
     (begin
       (if (1/output-port? o_0)
         (void)
         (raise-argument-error 'port-display-handler "output-port?" o_0))
       (let ((o_1 (->core-output-port.1 unsafe-undefined o_0 #f)))
         (let ((or-part_0 (core-output-port-display-handler o_1)))
           (if or-part_0 or-part_0 default-port-display-handler)))))
    ((o_0 h_0)
     (begin
       (if (1/output-port? o_0)
         (void)
         (raise-argument-error 'port-display-handler "output-port?" o_0))
       (if (if (procedure? h_0) (procedure-arity-includes? h_0 2) #f)
         (void)
         (raise-argument-error
          'port-display-handler
          "(procedure-arity-includes/c 2)"
          h_0))
       (let ((o_1 (->core-output-port.1 unsafe-undefined o_0 #f)))
         (set-core-output-port-display-handler!
          o_1
          (if (eq? h_0 default-port-display-handler) #f h_0))))))))
(define default-port-display-handler
  (lambda (v_0 o_0)
    (let ((co_0
           (->core-output-port.1
            unsafe-undefined
            o_0
            'default-port-display-handler)))
      (do-display 'display v_0 co_0))))
(define 1/port-print-handler
  (|#%name|
   port-print-handler
   (case-lambda
    ((o_0)
     (begin
       (if (1/output-port? o_0)
         (void)
         (raise-argument-error 'port-print-handler "output-port?" o_0))
       (let ((o_1 (->core-output-port.1 unsafe-undefined o_0 #f)))
         (let ((or-part_0 (core-output-port-print-handler o_1)))
           (if or-part_0 or-part_0 default-port-print-handler)))))
    ((o_0 h_0)
     (begin
       (if (1/output-port? o_0)
         (void)
         (raise-argument-error 'port-print-handler "output-port?" o_0))
       (if (if (procedure? h_0) (procedure-arity-includes? h_0 2) #f)
         (void)
         (raise-argument-error
          'port-print-handler
          "(procedure-arity-includes/c 2)"
          h_0))
       (let ((o_1 (->core-output-port.1 unsafe-undefined o_0 #f)))
         (set-core-output-port-print-handler!
          o_1
          (if (eq? h_0 default-port-print-handler)
            #f
            (if (procedure-arity-includes? h_0 3)
              h_0
              (let ((.../io/port/handler.rkt:118:49_0
                     (|#%name|
                      .../io/port/handler.rkt:118:49
                      (lambda (v27_0 o28_0 w26_0) (|#%app| h_0 v27_0 o28_0)))))
                (|#%name|
                 .../io/port/handler.rkt:118:49
                 (case-lambda
                  ((v_0 o_2) (.../io/port/handler.rkt:118:49_0 v_0 o_2 #f))
                  ((v_0 o_2 w26_0)
                   (.../io/port/handler.rkt:118:49_0
                    v_0
                    o_2
                    w26_0))))))))))))))
(define default-port-print-handler
  (let ((default-port-print-handler_0
         (|#%name|
          default-port-print-handler
          (lambda (v2_0 o3_0 quote-depth1_0)
            (begin
              (if (1/output-port? o3_0)
                (void)
                (raise-argument-error
                 'default-port-print-handler
                 "output-port?"
                 o3_0))
              (if (let ((or-part_0 (eq? quote-depth1_0 0)))
                    (if or-part_0 or-part_0 (eq? quote-depth1_0 1)))
                (void)
                (raise-argument-error
                 'default-port-print-handler
                 "(or/c 0 1)"
                 quote-depth1_0))
              (|#%app|
               (1/global-port-print-handler)
               v2_0
               o3_0
               quote-depth1_0))))))
    (case-lambda
     ((v_0 o_0) (default-port-print-handler_0 v_0 o_0 0))
     ((v_0 o_0 quote-depth1_0)
      (default-port-print-handler_0 v_0 o_0 quote-depth1_0)))))
(define 1/default-global-port-print-handler
  (let ((default-global-port-print-handler_0
         (|#%name|
          default-global-port-print-handler
          (lambda (v5_0 o6_0 quote-depth4_0)
            (let ((co_0
                   (->core-output-port.1
                    unsafe-undefined
                    o6_0
                    'default-global-port-print-handler)))
              (begin
                (if (let ((or-part_0 (eq? quote-depth4_0 0)))
                      (if or-part_0 or-part_0 (eq? quote-depth4_0 1)))
                  (void)
                  (raise-argument-error
                   'default-global-port-print-handler
                   "(or/c 0 1)"
                   quote-depth4_0))
                (do-print 'print v5_0 co_0 quote-depth4_0)))))))
    (|#%name|
     default-global-port-print-handler
     (case-lambda
      ((v_0 o_0) (default-global-port-print-handler_0 v_0 o_0 0))
      ((v_0 o_0 quote-depth4_0)
       (default-global-port-print-handler_0 v_0 o_0 quote-depth4_0))))))
(define 1/global-port-print-handler
  (make-parameter
   1/default-global-port-print-handler
   (lambda (p_0)
     (begin
       (if (if (procedure? p_0) (procedure-arity-includes? p_0 2) #f)
         (void)
         (raise-argument-error
          'global-port-print-handler
          (string-append
           "(or/c (->* (any/c output-port?) ((or/c 0 1)) any)\n"
           "      (any/c output-port? . -> . any))")
          p_0))
       (if (procedure-arity-includes? p_0 3)
         p_0
         (let ((.../io/port/handler.rkt:145:24_0
                (|#%name|
                 .../io/port/handler.rkt:145:24
                 (lambda (v35_0 o36_0 quote-depth34_0)
                   (|#%app| p_0 v35_0 o36_0)))))
           (|#%name|
            .../io/port/handler.rkt:145:24
            (case-lambda
             ((v_0 o_0) (.../io/port/handler.rkt:145:24_0 v_0 o_0 0))
             ((v_0 o_0 quote-depth34_0)
              (.../io/port/handler.rkt:145:24_0 v_0 o_0 quote-depth34_0))))))))
   'global-port-print-handler))
(define effect_2350
  (begin
    (void
     (install-do-global-print!
      1/global-port-print-handler
      1/default-global-port-print-handler))
    (void)))
(define 1/byte-ready?
  (let ((byte-ready?_0
         (|#%name|
          byte-ready?
          (lambda (in1_0)
            (let ((in_0
                   (if (eq? in1_0 unsafe-undefined)
                     (1/current-input-port)
                     in1_0)))
              (begin
                (if (1/input-port? in_0)
                  (void)
                  (raise-argument-error 'byte-ready? "input-port?" in_0))
                (letrec*
                 ((loop_0
                   (|#%name|
                    loop
                    (lambda (in_1)
                      (let ((byte-ready_0
                             (core-input-port-methods-byte-ready.1
                              (core-port-vtable in_1))))
                        (if (1/input-port? byte-ready_0)
                          (loop_0
                           (->core-input-port.1
                            unsafe-undefined
                            byte-ready_0
                            #f))
                          (begin
                            (unsafe-start-atomic)
                            (begin
                              (prepare-change in_1)
                              (begin
                                (check-not-closed 'byte-ready? in_1)
                                (let ((r_0 (|#%app| byte-ready_0 in_1 void)))
                                  (begin
                                    (unsafe-end-atomic)
                                    (let ((or-part_0 (eq? #t r_0)))
                                      (if or-part_0
                                        or-part_0
                                        (if r_0
                                          (if (sync/timeout 0 r_0) #t #f)
                                          #f))))))))))))))
                 (loop_0 (->core-input-port.1 unsafe-undefined in_0 #f)))))))))
    (|#%name|
     byte-ready?
     (case-lambda
      (() (byte-ready?_0 unsafe-undefined))
      ((in1_0) (byte-ready?_0 in1_0))))))
(define 1/char-ready?
  (let ((char-ready?_0
         (|#%name|
          char-ready?
          (lambda (in2_0)
            (let ((in_0
                   (if (eq? in2_0 unsafe-undefined)
                     (1/current-input-port)
                     in2_0)))
              (begin
                (if (1/input-port? in_0)
                  (void)
                  (raise-argument-error 'char-ready? "input-port?" in_0))
                (let ((in_1 (->core-input-port.1 unsafe-undefined in_0 #f)))
                  (if (1/byte-ready? in_1)
                    (let ((b_0 (peek-a-byte.1 #f 'char-ready? in_1 0)))
                      (if (if b_0
                            (let ((or-part_0 (eof-object? b_0)))
                              (if or-part_0 or-part_0 (< b_0 128)))
                            #f)
                        #t
                        (let ((bstr_0 (make-bytes 1)))
                          (letrec*
                           ((loop_0
                             (|#%name|
                              loop
                              (lambda (offset_0 state_0)
                                (if (eq?
                                     1
                                     (1/peek-bytes-avail!*
                                      bstr_0
                                      offset_0
                                      #f
                                      in_1))
                                  (call-with-values
                                   (lambda ()
                                     (utf-8-decode!.1
                                      'state
                                      '#\x3f
                                      state_0
                                      bstr_0
                                      0
                                      1
                                      #f
                                      0
                                      #f))
                                   (lambda (used-bytes_0
                                            got-chars_0
                                            new-state_0)
                                     (if (utf-8-state? new-state_0)
                                       (loop_0 (add1 offset_0) new-state_0)
                                       #t)))
                                  #f)))))
                           (loop_0 0 #f)))))
                    #f))))))))
    (|#%name|
     char-ready?
     (case-lambda
      (() (char-ready?_0 unsafe-undefined))
      ((in2_0) (char-ready?_0 in2_0))))))
(define call-with-resource
  (lambda (r_0 destroy_0 handle_0)
    (if (let ((or-part_0 (vector? r_0)))
          (if or-part_0 or-part_0 (if (box? r_0) (vector? (unbox r_0)) #f)))
      (|#%app| handle_0 r_0)
      (let ((completed?_0 #f))
        (let ((do-destroy_0
               (|#%name|
                do-destroy
                (lambda () (if completed?_0 (void) (|#%app| destroy_0 r_0))))))
          (begin
            (|#%app| thread-push-kill-callback! do-destroy_0)
            (dynamic-wind
             void
             (lambda () (begin0 (|#%app| handle_0 r_0) (set! completed?_0 #t)))
             (lambda ()
               (begin
                 (unsafe-start-atomic)
                 (|#%app| thread-pop-kill-callback!)
                 (do-destroy_0)
                 (unsafe-end-atomic))))))))))
(define 1/directory-exists?
  (|#%name|
   directory-exists?
   (lambda (p_0)
     (begin
       (if (path-string? p_0)
         (void)
         (raise-argument-error 'directory-exists? "path-string?" p_0))
       (|#%app|
        rktio_directory_exists
        (unsafe-place-local-ref cell.1)
        (->host p_0 'directory-exists? '(exists)))))))
(define 1/file-exists?
  (|#%name|
   file-exists?
   (lambda (p_0)
     (begin
       (if (path-string? p_0)
         (void)
         (raise-argument-error 'file-exists? "path-string?" p_0))
       (let ((host-path_0 (->host p_0 'file-exists? '(exists))))
         (if (if (eq? 'windows (system-type))
               (special-filename?.1 #f host-path_0)
               #f)
           #t
           (|#%app|
            rktio_file_exists
            (unsafe-place-local-ref cell.1)
            host-path_0)))))))
(define 1/link-exists?
  (|#%name|
   link-exists?
   (lambda (p_0)
     (begin
       (if (path-string? p_0)
         (void)
         (raise-argument-error 'link-exists? "path-string?" p_0))
       (|#%app|
        rktio_link_exists
        (unsafe-place-local-ref cell.1)
        (->host p_0 'link-exists? '(exists)))))))
(define 1/file-or-directory-type
  (let ((file-or-directory-type_0
         (|#%name|
          file-or-directory-type
          (lambda (p2_0 must-exist?1_0)
            (begin
              (if (path-string? p2_0)
                (void)
                (raise-argument-error
                 'file-or-directory-type
                 "path-string?"
                 p2_0))
              (let ((host-path_0
                     (->host p2_0 'file-or-directory-type '(exists))))
                (if (if (eq? 'windows (system-type))
                      (special-filename?.1 #f host-path_0)
                      #f)
                  'file
                  (let ((r_0
                         (|#%app|
                          rktio_file_type
                          (unsafe-place-local-ref cell.1)
                          host-path_0)))
                    (if (eqv? r_0 1)
                      'file
                      (if (eqv? r_0 2)
                        'directory
                        (if (eqv? r_0 3)
                          'link
                          (if (eqv? r_0 4)
                            'directory-link
                            (if must-exist?1_0
                              (raise-filesystem-error
                               'file-or-directory-type
                               r_0
                               (let ((app_0
                                      (string-append
                                       "access failed\n"
                                       "  path: ~a")))
                                 (1/format app_0 (host-> host-path_0))))
                              #f)))))))))))))
    (|#%name|
     file-or-directory-type
     (case-lambda
      ((p_0) (file-or-directory-type_0 p_0 #f))
      ((p_0 must-exist?1_0) (file-or-directory-type_0 p_0 must-exist?1_0))))))
(define 1/make-directory
  (let ((make-directory_0
         (|#%name|
          make-directory
          (lambda (p4_0 perms3_0)
            (let ((perms_0 (if (eq? perms3_0 unsafe-undefined) 511 perms3_0)))
              (begin
                (if (path-string? p4_0)
                  (void)
                  (raise-argument-error 'make-directory "path-string?" p4_0))
                (begin
                  (if (permissions? perms_0)
                    (void)
                    (raise-argument-error
                     'make-directory
                     permissions-desc
                     perms_0))
                  (let ((host-path_0 (->host p4_0 'make-directory '(write))))
                    (let ((r_0
                           (|#%app|
                            rktio_make_directory_with_permissions
                            (unsafe-place-local-ref cell.1)
                            host-path_0
                            perms_0)))
                      (if (vector? r_0)
                        (raise-filesystem-error
                         'make-directory
                         r_0
                         (let ((app_0
                                (string-append
                                 "cannot make directory~a\n"
                                 "  path: ~a")))
                           (let ((app_1
                                  (if (racket-error? r_0 4)
                                    ";\n the path already exists"
                                    "")))
                             (1/format app_0 app_1 (host-> host-path_0)))))
                        (void)))))))))))
    (|#%name|
     make-directory
     (case-lambda
      ((p_0) (make-directory_0 p_0 unsafe-undefined))
      ((p_0 perms3_0) (make-directory_0 p_0 perms3_0))))))
(define simplify-path/dl (lambda (p_0) p_0))
(define set-simplify-path-for-directory-list!
  (lambda (proc_0) (set! simplify-path/dl proc_0)))
(define 1/directory-list
  (let ((directory-list_0
         (|#%name|
          directory-list
          (lambda (p5_0)
            (let ((p_0
                   (if (eq? p5_0 unsafe-undefined)
                     (current-directory$1)
                     p5_0)))
              (begin
                (if (path-string? p_0)
                  (void)
                  (raise-argument-error 'directory-list "path-string?" p_0))
                (let ((host-path/initial_0
                       (->host p_0 'directory-list '(read))))
                  (let ((host-path_0
                         (let ((tmp_0 (system-type)))
                           (if (eq? tmp_0 'windows)
                             (->host
                              (let ((app_0 simplify-path/dl))
                                (|#%app| app_0 (host-> host-path/initial_0)))
                              #f
                              '())
                             host-path/initial_0))))
                    (begin
                      (unsafe-start-atomic)
                      (begin0
                        (call-with-resource
                         (|#%app|
                          rktio_directory_list_start
                          (unsafe-place-local-ref cell.1)
                          host-path_0)
                         (lambda (dl_0)
                           (|#%app|
                            rktio_directory_list_stop
                            (unsafe-place-local-ref cell.1)
                            dl_0))
                         (lambda (dl_0)
                           (if (vector? dl_0)
                             (begin
                               (unsafe-end-atomic)
                               (raise-filesystem-error
                                'directory-list
                                dl_0
                                (let ((app_0
                                       (string-append
                                        "could not open directory\n"
                                        "  path: ~a")))
                                  (1/format app_0 (host-> host-path_0)))))
                             (begin
                               (unsafe-end-atomic)
                               (letrec*
                                ((loop_0
                                  (|#%name|
                                   loop
                                   (lambda (accum_0)
                                     (begin
                                       (unsafe-start-atomic)
                                       (let ((fnp_0
                                              (|#%app|
                                               rktio_directory_list_step
                                               (unsafe-place-local-ref cell.1)
                                               dl_0)))
                                         (let ((fn_0
                                                (if (vector? fnp_0)
                                                  fnp_0
                                                  (|#%app|
                                                   rktio_to_bytes
                                                   fnp_0))))
                                           (if (vector? fn_0)
                                             (begin
                                               (unsafe-end-atomic)
                                               (check-rktio-error
                                                fn_0
                                                "error reading directory"))
                                             (if (equal? fn_0 #vu8())
                                               accum_0
                                               (begin
                                                 (|#%app| rktio_free fnp_0)
                                                 (unsafe-end-atomic)
                                                 (loop_0
                                                  (cons
                                                   (host-element-> fn_0)
                                                   accum_0))))))))))))
                                (loop_0 null))))))
                        (unsafe-end-atomic)))))))))))
    (|#%name|
     directory-list
     (case-lambda
      (() (directory-list_0 unsafe-undefined))
      ((p5_0) (directory-list_0 p5_0))))))
(define 1/delete-file
  (|#%name|
   delete-file
   (lambda (p_0)
     (begin
       (if (path-string? p_0)
         (void)
         (raise-argument-error 'delete-file "path-string?" p_0))
       (let ((host-path_0 (->host p_0 'delete-file '(delete))))
         (let ((r_0
                (|#%app|
                 rktio_delete_file
                 (unsafe-place-local-ref cell.1)
                 host-path_0
                 (1/current-force-delete-permissions))))
           (if (vector? r_0)
             (raise-filesystem-error
              'delete-file
              r_0
              (let ((app_0
                     (string-append "cannot delete file\n" "  path: ~a")))
                (1/format app_0 (host-> host-path_0))))
             (void))))))))
(define 1/delete-directory
  (|#%name|
   delete-directory
   (lambda (p_0)
     (begin
       (if (path-string? p_0)
         (void)
         (raise-argument-error 'delete-directory "path-string?" p_0))
       (let ((host-path_0 (->host p_0 'delete-directory '(delete))))
         (let ((r_0
                (let ((app_0 (->host (current-directory$1) #f #f)))
                  (|#%app|
                   rktio_delete_directory
                   (unsafe-place-local-ref cell.1)
                   host-path_0
                   app_0
                   (1/current-force-delete-permissions)))))
           (if (vector? r_0)
             (raise-filesystem-error
              'delete-directory
              r_0
              (let ((app_0
                     (string-append "cannot delete directory\n" "  path: ~a")))
                (1/format app_0 (host-> host-path_0))))
             (void))))))))
(define 1/rename-file-or-directory
  (let ((rename-file-or-directory_0
         (|#%name|
          rename-file-or-directory
          (lambda (old7_0 new8_0 exists-ok?6_0)
            (begin
              (if (path-string? old7_0)
                (void)
                (raise-argument-error
                 'rename-file-or-directory
                 "path-string?"
                 old7_0))
              (begin
                (if (path-string? new8_0)
                  (void)
                  (raise-argument-error
                   'rename-file-or-directory
                   "path-string?"
                   new8_0))
                (let ((host-old_0
                       (->host old7_0 'rename-file-or-directory '(read))))
                  (let ((host-new_0
                         (->host new8_0 'rename-file-or-directory '(write))))
                    (let ((r_0
                           (|#%app|
                            rktio_rename_file
                            (unsafe-place-local-ref cell.1)
                            host-new_0
                            host-old_0
                            exists-ok?6_0)))
                      (if (vector? r_0)
                        (raise-filesystem-error
                         'rename-file-or-directory
                         r_0
                         (let ((app_0
                                (string-append
                                 "cannot rename file or directory~a\n"
                                 "  source path: ~a\n"
                                 "  dest path: ~a")))
                           (let ((app_1
                                  (if (racket-error? r_0 4)
                                    ";\n the destination path already exists"
                                    "")))
                             (let ((app_2 (host-> host-old_0)))
                               (1/format
                                app_0
                                app_1
                                app_2
                                (host-> host-new_0))))))
                        (void)))))))))))
    (|#%name|
     rename-file-or-directory
     (case-lambda
      ((old_0 new_0) (rename-file-or-directory_0 old_0 new_0 #f))
      ((old_0 new_0 exists-ok?6_0)
       (rename-file-or-directory_0 old_0 new_0 exists-ok?6_0))))))
(define 1/file-or-directory-modify-seconds
  (|#%name|
   file-or-directory-modify-seconds
   (case-lambda
    ((p_0)
     (begin
       (if (path-string? p_0)
         (void)
         (raise-argument-error
          'file-or-directory-modify-seconds
          "path-string?"
          p_0))
       (do-file-or-directory-modify-seconds
        'file-or-directory-modify-seconds
        p_0
        #f
        #f)))
    ((p_0 secs_0)
     (begin
       (if (path-string? p_0)
         (void)
         (raise-argument-error
          'file-or-directory-modify-seconds
          "path-string?"
          p_0))
       (if (let ((or-part_0 (not secs_0)))
             (if or-part_0 or-part_0 (exact-integer? secs_0)))
         (void)
         (raise-argument-error
          'file-or-directory-modify-seconds
          "(or/c #f exact-integer?)"
          secs_0))
       (do-file-or-directory-modify-seconds
        'file-or-directory-modify-seconds
        p_0
        secs_0
        #f)))
    ((p_0 secs_0 fail_0)
     (begin
       (if (path-string? p_0)
         (void)
         (raise-argument-error
          'file-or-directory-modify-seconds
          "path-string?"
          p_0))
       (if (let ((or-part_0 (not secs_0)))
             (if or-part_0 or-part_0 (exact-integer? secs_0)))
         (void)
         (raise-argument-error
          'file-or-directory-modify-seconds
          "(or/c #f exact-integer?)"
          secs_0))
       (if (if (procedure? fail_0) (procedure-arity-includes? fail_0 0) #f)
         (void)
         (raise-argument-error
          'file-or-directory-modify-seconds
          "(procedure-arity-includes/c 0)"
          fail_0))
       (do-file-or-directory-modify-seconds
        'file-or-directory-modify-seconds
        p_0
        secs_0
        fail_0))))))
(define do-file-or-directory-modify-seconds
  (lambda (who_0 p_0 secs_0 fail_0)
    (begin
      (if secs_0
        (if (|#%app| rktio_is_timestamp secs_0)
          (void)
          (raise-arguments-error
           who_0
           "integer value is out-of-range"
           "value"
           secs_0))
        (void))
      (let ((host-path_0 (->host p_0 who_0 (if secs_0 '(write) '(read)))))
        (begin
          (unsafe-start-atomic)
          (let ((r0_0
                 (if secs_0
                   (|#%app|
                    rktio_set_file_modify_seconds
                    (unsafe-place-local-ref cell.1)
                    host-path_0
                    secs_0)
                   (|#%app|
                    rktio_get_file_modify_seconds
                    (unsafe-place-local-ref cell.1)
                    host-path_0))))
            (let ((r_0
                   (if (if (not secs_0) (not (vector? r0_0)) #f)
                     (begin0
                       (|#%app| rktio_timestamp_ref r0_0)
                       (|#%app| rktio_free r0_0))
                     r0_0)))
              (begin
                (unsafe-end-atomic)
                (if (vector? r_0)
                  (if fail_0
                    (|#%app| fail_0)
                    (raise-filesystem-error
                     who_0
                     r_0
                     (let ((app_0
                            (string-append
                             "error ~a file/directory time\n"
                             "  path: ~a")))
                       (1/format
                        app_0
                        (if secs_0 "setting" "getting")
                        (host-> host-path_0)))))
                  (if secs_0 (void) r_0))))))))))
(define 1/file-or-directory-permissions
  (let ((file-or-directory-permissions_0
         (|#%name|
          file-or-directory-permissions
          (lambda (p10_0 mode9_0)
            (begin
              (if (path-string? p10_0)
                (void)
                (raise-argument-error
                 'file-or-directory-permissions
                 "path-string?"
                 p10_0))
              (begin
                (if (let ((or-part_0 (not mode9_0)))
                      (if or-part_0
                        or-part_0
                        (let ((or-part_1 (eq? mode9_0 'bits)))
                          (if or-part_1
                            or-part_1
                            (if (exact-integer? mode9_0)
                              (<= 0 mode9_0 65535)
                              #f)))))
                  (void)
                  (raise-argument-error
                   'file-or-directory-permissions
                   "(or/c #f 'bits (integer-in 0 65535))"
                   mode9_0))
                (let ((host-path_0
                       (->host
                        p10_0
                        'file-or-directory-permissions
                        (if (integer? mode9_0) '(write) '(read)))))
                  (let ((r_0
                         (if (integer? mode9_0)
                           (|#%app|
                            rktio_set_file_or_directory_permissions
                            (unsafe-place-local-ref cell.1)
                            host-path_0
                            mode9_0)
                           (|#%app|
                            rktio_get_file_or_directory_permissions
                            (unsafe-place-local-ref cell.1)
                            host-path_0
                            (eq? mode9_0 'bits)))))
                    (begin
                      (if (vector? r_0)
                        (raise-filesystem-error
                         'file-or-directory-permissions
                         r_0
                         (let ((app_0
                                (string-append
                                 "~a failed~a\n"
                                 "  path: ~a~a")))
                           (let ((app_1
                                  (if (racket-error? r_0 4)
                                    ";\n unsupported bit combination"
                                    "")))
                             (let ((app_2 (host-> host-path_0)))
                               (1/format
                                app_0
                                (if (integer? mode9_0) "update" "access")
                                app_1
                                app_2
                                (if (racket-error? r_0 4)
                                  (1/format "\n  permission value: ~a" mode9_0)
                                  ""))))))
                        (void))
                      (if (integer? mode9_0)
                        (void)
                        (if (eq? 'bits mode9_0)
                          r_0
                          (let ((set?_0
                                 (|#%name|
                                  set?
                                  (lambda (n_0)
                                    (eqv? n_0 (bitwise-and r_0 n_0))))))
                            (let ((l_0 (if (set?_0 4) (cons 'read '()) '())))
                              (let ((l_1
                                     (if (set?_0 2) (cons 'write l_0) l_0)))
                                (let ((l_2
                                       (if (set?_0 1)
                                         (cons 'execute l_1)
                                         l_1)))
                                  l_2)))))))))))))))
    (|#%name|
     file-or-directory-permissions
     (case-lambda
      ((p_0) (file-or-directory-permissions_0 p_0 #f))
      ((p_0 mode9_0) (file-or-directory-permissions_0 p_0 mode9_0))))))
(define 1/file-or-directory-stat
  (let ((file-or-directory-stat_0
         (|#%name|
          file-or-directory-stat
          (lambda (p12_0 as-link?11_0)
            (begin
              (if (path-string? p12_0)
                (void)
                (raise-argument-error
                 'file-or-directory-stat
                 "path-string?"
                 p12_0))
              (let ((host-path_0
                     (->host p12_0 'file-or-directory-stat '(exists))))
                (begin
                  (unsafe-start-atomic)
                  (path-or-fd-stat.1
                   as-link?11_0
                   #f
                   host-path_0
                   #f
                   'file-or-directory-stat))))))))
    (|#%name|
     file-or-directory-stat
     (case-lambda
      ((p_0) (file-or-directory-stat_0 p_0 #f))
      ((p_0 as-link?11_0) (file-or-directory-stat_0 p_0 as-link?11_0))))))
(define 1/file-or-directory-identity
  (let ((file-or-directory-identity_0
         (|#%name|
          file-or-directory-identity
          (lambda (p14_0 as-link?13_0)
            (begin
              (if (path-string? p14_0)
                (void)
                (raise-argument-error
                 'file-or-directory-identity
                 "path-string?"
                 p14_0))
              (let ((host-path_0
                     (->host p14_0 'file-or-directory-identity '(exists))))
                (begin
                  (unsafe-start-atomic)
                  (path-or-fd-identity.1
                   as-link?13_0
                   #f
                   host-path_0
                   #f
                   #f
                   'file-or-directory-identity))))))))
    (|#%name|
     file-or-directory-identity
     (case-lambda
      ((p_0) (file-or-directory-identity_0 p_0 #f))
      ((p_0 as-link?13_0) (file-or-directory-identity_0 p_0 as-link?13_0))))))
(define 1/file-size
  (|#%name|
   file-size
   (lambda (p_0)
     (begin
       (if (path-string? p_0)
         (void)
         (raise-argument-error 'file-size "path-string?" p_0))
       (let ((host-path_0 (->host p_0 'file-size '(read))))
         (begin
           (unsafe-start-atomic)
           (let ((r0_0
                  (|#%app|
                   rktio_file_size
                   (unsafe-place-local-ref cell.1)
                   host-path_0)))
             (let ((r_0
                    (if (vector? r0_0)
                      r0_0
                      (begin0
                        (|#%app| rktio_filesize_ref r0_0)
                        (|#%app| rktio_free r0_0)))))
               (begin
                 (unsafe-end-atomic)
                 (if (vector? r_0)
                   (raise-filesystem-error
                    'file-size
                    r_0
                    (let ((app_0
                           (string-append "cannot get size\n" "  path: ~a")))
                      (1/format app_0 (host-> host-path_0))))
                   r_0))))))))))
(define 1/copy-file
  (let ((copy-file_0
         (|#%name|
          copy-file
          (lambda (src18_0
                   dest19_0
                   exists-ok?15_0
                   permissions16_0
                   override-create-permissions?17_0)
            (begin
              (if (path-string? src18_0)
                (void)
                (raise-argument-error 'copy-file "path-string?" src18_0))
              (begin
                (if (path-string? dest19_0)
                  (void)
                  (raise-argument-error 'copy-file "path-string?" dest19_0))
                (begin
                  (if (let ((or-part_0 (not permissions16_0)))
                        (if or-part_0
                          or-part_0
                          (if (exact-integer? permissions16_0)
                            (<= 0 permissions16_0 65535)
                            #f)))
                    (void)
                    (raise-argument-error
                     'copy-file
                     "(or/c #f (integer-in 0 65535))"
                     permissions16_0))
                  (let ((src-host_0 (->host src18_0 'copy-file '(read))))
                    (let ((dest-host_0
                           (->host dest19_0 'copy-file '(write delete))))
                      (let ((report-error_0
                             (|#%name|
                              report-error
                              (lambda (r_0)
                                (raise-filesystem-error
                                 'copy-file
                                 r_0
                                 (let ((app_0
                                        (string-append
                                         "~a\n"
                                         "  source path: ~a\n"
                                         "  destination path: ~a")))
                                   (let ((app_1 (copy-file-step-string r_0)))
                                     (let ((app_2 (host-> src-host_0)))
                                       (1/format
                                        app_0
                                        app_1
                                        app_2
                                        (host-> dest-host_0))))))))))
                        (begin
                          (unsafe-start-atomic)
                          (let ((cp_0
                                 (|#%app|
                                  rktio_copy_file_start_permissions
                                  (unsafe-place-local-ref cell.1)
                                  dest-host_0
                                  src-host_0
                                  exists-ok?15_0
                                  permissions16_0
                                  (if permissions16_0 permissions16_0 0)
                                  override-create-permissions?17_0)))
                            (if (vector? cp_0)
                              (begin (unsafe-end-atomic) (report-error_0 cp_0))
                              (begin
                                (|#%app|
                                 thread-push-kill-callback!
                                 (lambda ()
                                   (|#%app|
                                    rktio_copy_file_stop
                                    (unsafe-place-local-ref cell.1)
                                    cp_0)))
                                (dynamic-wind
                                 void
                                 (lambda ()
                                   (begin
                                     (unsafe-end-atomic)
                                     (letrec*
                                      ((loop_0
                                        (|#%name|
                                         loop
                                         (lambda ()
                                           (if (|#%app|
                                                rktio_copy_file_is_done
                                                (unsafe-place-local-ref cell.1)
                                                cp_0)
                                             (let ((r_0
                                                    (|#%app|
                                                     rktio_copy_file_finish_permissions
                                                     (unsafe-place-local-ref
                                                      cell.1)
                                                     cp_0)))
                                               (if (vector? r_0)
                                                 (report-error_0 r_0)
                                                 (void)))
                                             (let ((r_0
                                                    (|#%app|
                                                     rktio_copy_file_step
                                                     (unsafe-place-local-ref
                                                      cell.1)
                                                     cp_0)))
                                               (begin
                                                 (if (vector? r_0)
                                                   (report-error_0 r_0)
                                                   (void))
                                                 (loop_0))))))))
                                      (loop_0))))
                                 (lambda ()
                                   (begin
                                     (unsafe-start-atomic)
                                     (|#%app|
                                      rktio_copy_file_stop
                                      (unsafe-place-local-ref cell.1)
                                      cp_0)
                                     (|#%app| thread-pop-kill-callback!)
                                     (unsafe-end-atomic))))))))))))))))))
    (|#%name|
     copy-file
     (case-lambda
      ((src_0 dest_0) (copy-file_0 src_0 dest_0 #f #f #t))
      ((src_0
        dest_0
        exists-ok?_0
        permissions_0
        override-create-permissions?17_0)
       (copy-file_0
        src_0
        dest_0
        exists-ok?_0
        permissions_0
        override-create-permissions?17_0))
      ((src_0 dest_0 exists-ok?_0 permissions16_0)
       (copy-file_0 src_0 dest_0 exists-ok?_0 permissions16_0 #t))
      ((src_0 dest_0 exists-ok?15_0)
       (copy-file_0 src_0 dest_0 exists-ok?15_0 #f #t))))))
(define 1/make-file-or-directory-link
  (|#%name|
   make-file-or-directory-link
   (lambda (to_0 path_0)
     (begin
       (if (path-string? to_0)
         (void)
         (raise-argument-error
          'make-file-or-directory-link
          "path-string?"
          to_0))
       (begin
         (if (path-string? path_0)
           (void)
           (raise-argument-error
            'make-file-or-directory-link
            "path-string?"
            path_0))
         (let ((to-path_0 (->path to_0)))
           (let ((path-host_0
                  (->host path_0 'make-file-or-directory-link '(write))))
             (let ((to-host_0
                    (->host/as-is
                     to-path_0
                     'make-file-or-directory-link
                     (host-> path-host_0))))
               (let ((r_0
                      (|#%app|
                       rktio_make_link
                       (unsafe-place-local-ref cell.1)
                       path-host_0
                       to-host_0
                       (directory-path?.1 #f to-path_0))))
                 (if (vector? r_0)
                   (raise-filesystem-error
                    'make-file-or-directory-link
                    r_0
                    (let ((app_0
                           (string-append
                            "cannot make link~a\n"
                            "  path: ~a")))
                      (let ((app_1
                             (if (racket-error? r_0 4)
                               ";\n the path already exists"
                               "")))
                        (1/format app_0 app_1 (host-> path-host_0)))))
                   (void)))))))))))
(define do-resolve-path
  (lambda (p_0 who_0)
    (begin
      (if (path-string? p_0)
        (void)
        (raise-argument-error who_0 "path-string?" p_0))
      (let ((p-path_0 (->path p_0)))
        (let ((host-path_0 (->host p-path_0 who_0 '(exists))))
          (let ((host-path/no-sep_0
                 (host-path->host-path-without-trailing-separator
                  host-path_0)))
            (begin
              (unsafe-start-atomic)
              (let ((r0_0
                     (|#%app|
                      rktio_readlink
                      (unsafe-place-local-ref cell.1)
                      host-path/no-sep_0)))
                (let ((r_0
                       (if (vector? r0_0)
                         r0_0
                         (begin0
                           (|#%app| rktio_to_bytes r0_0)
                           (|#%app| rktio_free r0_0)))))
                  (begin
                    (unsafe-end-atomic)
                    (if (vector? r_0)
                      (let ((new-path_0 (1/cleanse-path p-path_0)))
                        (if (equal? new-path_0 p-path_0) p-path_0 new-path_0))
                      (host-> r_0))))))))))))
(define 1/resolve-path
  (|#%name| resolve-path (lambda (p_0) (do-resolve-path p_0 'resolve-path))))
(define 1/expand-user-path
  (|#%name|
   expand-user-path
   (lambda (p_0)
     (begin
       (if (path-string? p_0)
         (void)
         (raise-argument-error 'expand-user-path "path-string?" p_0))
       (let ((path_0 (->path p_0)))
         (let ((bstr_0 (path-bytes path_0)))
           (if (if (positive? (unsafe-bytes-length bstr_0))
                 (eqv? (unsafe-bytes-ref bstr_0 0) 126)
                 #f)
             (let ((host-path_0 (->host/as-is path_0 'expand-user-path #f)))
               (begin
                 (unsafe-start-atomic)
                 (let ((r0_0
                        (|#%app|
                         rktio_expand_user_tilde
                         (unsafe-place-local-ref cell.1)
                         host-path_0)))
                   (let ((r_0
                          (if (vector? r0_0)
                            r0_0
                            (begin0
                              (|#%app| rktio_to_bytes r0_0)
                              (|#%app| rktio_free r0_0)))))
                     (begin
                       (unsafe-end-atomic)
                       (if (vector? r_0)
                         (raise-filesystem-error
                          'expand-user-path
                          r_0
                          (let ((app_0
                                 (string-append
                                  "bad username in path\n"
                                  "  path: ~a")))
                            (1/format app_0 (host-> host-path_0))))
                         (void))
                       (host-> r_0))))))
             path_0)))))))
(define 1/filesystem-root-list
  (|#%name|
   filesystem-root-list
   (lambda ()
     (begin
       (1/security-guard-check-file 'filesystem-root-list #f '(exists))
       (begin
         (unsafe-start-atomic)
         (let ((r0_0
                (|#%app|
                 rktio_filesystem_roots
                 (unsafe-place-local-ref cell.1))))
           (let ((r_0
                  (if (vector? r0_0) r0_0 (|#%app| rktio_to_bytes_list r0_0))))
             (begin
               (unsafe-end-atomic)
               (if (vector? r_0)
                 (raise-filesystem-error
                  'filesystem-root-list
                  r_0
                  "cannot get roots")
                 (void))
               (1/reverse
                (letrec*
                 ((for-loop_0
                   (|#%name|
                    for-loop
                    (lambda (fold-var_0 lst_0)
                      (if (pair? lst_0)
                        (let ((p_0 (unsafe-car lst_0)))
                          (let ((rest_0 (unsafe-cdr lst_0)))
                            (let ((fold-var_1
                                   (let ((fold-var_1
                                          (cons (host-> p_0) fold-var_0)))
                                     (values fold-var_1))))
                              (for-loop_0 fold-var_1 rest_0))))
                        fold-var_0)))))
                 (for-loop_0 null r_0)))))))))))
(define resolve-path-for-simplify
  (lambda (p_0) (do-resolve-path p_0 'simplify-path)))
(define 1/simplify-path
  (let ((simplify-path_0
         (|#%name|
          simplify-path
          (lambda (p-in2_0 use-filesystem?1_0)
            (begin
              (check-path-argument 'simplify-path p-in2_0)
              (let ((p_0 (->path p-in2_0)))
                (simplify-path-syntactically
                 'simplify-path
                 p_0
                 (if use-filesystem?1_0 use-filesystem #f))))))))
    (|#%name|
     simplify-path
     (case-lambda
      ((p-in_0) (simplify-path_0 p-in_0 #t))
      ((p-in_0 use-filesystem?1_0)
       (simplify-path_0 p-in_0 use-filesystem?1_0))))))
(define use-filesystem
  (lambda (who_0 l_0)
    (let ((combine_0
           (|#%name|
            combine
            (lambda (base_0 accum_0)
              (if (null? accum_0)
                base_0
                (apply 1/build-path base_0 (1/reverse accum_0)))))))
      (letrec*
       ((loop_0
         (|#%name|
          loop
          (lambda (l_1 base_0 accum_0 seen_0)
            (if (null? l_1)
              (combine_0 base_0 accum_0)
              (if (eq? 'same (car l_1))
                (loop_0 (cdr l_1) base_0 accum_0 seen_0)
                (if (eq? 'up (car l_1))
                  (let ((new-base_0 (combine_0 base_0 accum_0)))
                    (let ((target_0
                           (do-resolve-path new-base_0 'simplify-path)))
                      (if (eq? target_0 new-base_0)
                        (call-with-values
                         (lambda () (1/split-path new-base_0))
                         (lambda (next-base_0 name_0 dir?_0)
                           (if (not next-base_0)
                             (loop_0 (cdr l_1) new-base_0 '() seen_0)
                             (loop_0 (cdr l_1) next-base_0 '() seen_0))))
                        (begin
                          (if (hash-ref seen_0 new-base_0 #f)
                            (raise
                             (let ((app_0
                                    (let ((msg_0
                                           (string-append
                                            "cycle detected at link"
                                            "\n  link path: "
                                            (path->string new-base_0))))
                                      (error-message->adjusted-string
                                       who_0
                                       'racket/primitive
                                       msg_0
                                       'racket/primitive))))
                               (|#%app|
                                exn:fail:filesystem
                                app_0
                                (current-continuation-marks))))
                            (void))
                          (let ((new-seen_0 (hash-set seen_0 new-base_0 #t)))
                            (if (1/complete-path? target_0)
                              (let ((new-l_0 (1/explode-path target_0)))
                                (let ((app_0 (append (cdr new-l_0) l_1)))
                                  (loop_0
                                   app_0
                                   (car new-l_0)
                                   null
                                   new-seen_0)))
                              (call-with-values
                               (lambda () (1/split-path new-base_0))
                               (lambda (base-dir_0 name_0 dir?_0)
                                 (loop_0
                                  (append (1/explode-path target_0) l_1)
                                  base-dir_0
                                  null
                                  new-seen_0)))))))))
                  (let ((app_0 (cdr l_1)))
                    (loop_0
                     app_0
                     base_0
                     (cons (car l_1) accum_0)
                     seen_0)))))))))
       (let ((app_0 (if (1/path? (car l_0)) (cdr l_0) l_0)))
         (loop_0
          app_0
          (if (1/path? (car l_0))
            (let ((temp4_0 (car l_0)))
              (let ((temp5_0 (current-directory$1)))
                (let ((temp4_1 temp4_0))
                  (path->complete-path.1 #t temp4_1 temp5_0))))
            (current-directory$1))
          '()
          hash2725))))))
(define effect_2475
  (begin (void (set! simplify-path/dl 1/simplify-path)) (void)))
(define bytes-no-nuls?
  (lambda (s_0)
    (if (bytes? s_0)
      (not
       (call-with-values
        (lambda () (values s_0 (unsafe-bytes-length s_0)))
        (lambda (vec_0 len_0)
          (letrec*
           ((for-loop_0
             (|#%name|
              for-loop
              (lambda (result_0 pos_0)
                (if (unsafe-fx< pos_0 len_0)
                  (let ((c_0 (unsafe-bytes-ref vec_0 pos_0)))
                    (let ((result_1
                           (let ((result_1 (= c_0 0))) (values result_1))))
                      (if (if (not (let ((x_0 (list c_0))) result_1)) #t #f)
                        (for-loop_0 result_1 (unsafe-fx+ 1 pos_0))
                        result_1)))
                  result_0)))))
           (for-loop_0 #f 0)))))
      #f)))
(define bytes-environment-variable-name?
  (lambda (k_0)
    (if (bytes-no-nuls? k_0)
      (|#%app| rktio_is_ok_envvar_name (unsafe-place-local-ref cell.1) k_0)
      #f)))
(define normalize-key
  (lambda (k_0)
    (if (|#%app|
         rktio_are_envvar_names_case_insensitive
         (unsafe-place-local-ref cell.1))
      (bytes->immutable-bytes
       (1/string->bytes/locale (string-foldcase (1/bytes->string/locale k_0))))
      k_0)))
(define finish_2186
  (make-struct-type-install-properties
   '(environment-variables)
   1
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'environment-variables))
(define struct:environment-variables
  (make-record-type-descriptor
   'environment-variables
   #f
   (|#%nongenerative-uid| environment-variables)
   #f
   #f
   '(1 . 1)))
(define effect_2329 (finish_2186 struct:environment-variables))
(define environment-variables1.1
  (|#%name|
   environment-variables
   (record-constructor
    (make-record-constructor-descriptor struct:environment-variables #f #f))))
(define 1/environment-variables?
  (|#%name|
   environment-variables?
   (record-predicate struct:environment-variables)))
(define environment-variables-ht
  (|#%name|
   environment-variables-ht
   (record-accessor struct:environment-variables 0)))
(define set-environment-variables-ht!
  (|#%name|
   set-environment-variables-ht!
   (record-mutator struct:environment-variables 0)))
(define 1/current-environment-variables
  (make-parameter
   (environment-variables1.1 #f)
   (lambda (v_0)
     (begin
       (if (1/environment-variables? v_0)
         (void)
         (raise-argument-error
          'current-environment-variables
          "environment-variables?"
          v_0))
       v_0))
   'current-environment-variables))
(define 1/make-environment-variables
  (|#%name|
   make-environment-variables
   (lambda args_0
     (letrec*
      ((loop_0
        (|#%name|
         loop
         (lambda (args_1 ht_0)
           (if (null? args_1)
             (environment-variables1.1 ht_0)
             (let ((key0_0 (car args_1)))
               (let ((key_0
                      (if (bytes? key0_0)
                        (bytes->immutable-bytes key0_0)
                        key0_0)))
                 (begin
                   (if (bytes-environment-variable-name? key_0)
                     (void)
                     (raise-argument-error
                      'make-environment-variables
                      "bytes-environment-variable-name?"
                      key_0))
                   (if (null? args_1)
                     (raise-arguments-error
                      'make-environment-variables
                      "key does not have a value (i.e., an odd number of arguments were provided)"
                      "key"
                      (car args_1))
                     (let ((val0_0 (cadr args_1)))
                       (let ((val_0
                              (if (bytes? val0_0)
                                (if (bytes->immutable-bytes val0_0) val0_0 #f)
                                #f)))
                         (begin
                           (if (bytes-no-nuls? val_0)
                             (void)
                             (raise-argument-error
                              'make-environment-variables
                              "bytes-no-nuls?"
                              val_0))
                           (let ((app_0 (cddr args_1)))
                             (loop_0
                              app_0
                              (let ((app_1 (normalize-key key_0)))
                                (hash-set
                                 ht_0
                                 app_1
                                 (cons key_0 val_0)))))))))))))))))
      (loop_0 args_0 hash2725)))))
(define 1/environment-variables-ref
  (|#%name|
   environment-variables-ref
   (lambda (e_0 k_0)
     (begin
       (if (1/environment-variables? e_0)
         (void)
         (raise-argument-error
          'environment-variables-ref
          "environment-variables?"
          e_0))
       (begin
         (if (bytes-environment-variable-name? k_0)
           (void)
           (raise-argument-error
            'environment-variables-ref
            "bytes-environment-variable-name?"
            k_0))
         (let ((ht_0 (environment-variables-ht e_0)))
           (if (not ht_0)
             (begin
               (unsafe-start-atomic)
               (let ((v_0
                      (|#%app|
                       rktio_getenv
                       (unsafe-place-local-ref cell.1)
                       k_0)))
                 (let ((s_0
                        (if (not (vector? v_0))
                          (begin0
                            (|#%app| rktio_to_bytes v_0)
                            (|#%app| rktio_free v_0))
                          #f)))
                   (begin (unsafe-end-atomic) s_0))))
             (cdr (hash-ref ht_0 (normalize-key k_0) '(#f . #f))))))))))
(define none (gensym 'none))
(define 1/environment-variables-set!
  (let ((environment-variables-set!_0
         (|#%name|
          environment-variables-set!
          (lambda (e3_0 k04_0 v05_0 fail2_0)
            (let ((fail_0 (if (eq? fail2_0 unsafe-undefined) none fail2_0)))
              (begin
                (if (1/environment-variables? e3_0)
                  (void)
                  (raise-argument-error
                   'environment-variables-set!
                   "environment-variables?"
                   e3_0))
                (let ((k_0
                       (if (bytes? k04_0)
                         (bytes->immutable-bytes k04_0)
                         k04_0)))
                  (begin
                    (if (bytes-environment-variable-name? k_0)
                      (void)
                      (raise-argument-error
                       'environment-variables-set!
                       "bytes-environment-variable-name?"
                       k_0))
                    (let ((v_0
                           (if (bytes? v05_0)
                             (bytes->immutable-bytes v05_0)
                             v05_0)))
                      (begin
                        (if (let ((or-part_0 (not v_0)))
                              (if or-part_0 or-part_0 (bytes-no-nuls? v_0)))
                          (void)
                          (raise-argument-error
                           'environment-variables-set!
                           "(or/c bytes-no-nuls? #f)"
                           v_0))
                        (begin
                          (if (eq? fail_0 none)
                            (void)
                            (if (if (procedure? fail_0)
                                  (procedure-arity-includes? fail_0 0)
                                  #f)
                              (void)
                              (raise-argument-error
                               'environment-variables-set!
                               "(procedure-arity-includes/c 0)"
                               fail_0)))
                          (let ((ht_0 (environment-variables-ht e3_0)))
                            (if (not ht_0)
                              (let ((r_0
                                     (|#%app|
                                      rktio_setenv
                                      (unsafe-place-local-ref cell.1)
                                      k_0
                                      v_0)))
                                (if (vector? r_0)
                                  (if (eq? fail_0 none)
                                    (let ((base-msg_0 "change failed"))
                                      (raise
                                       (let ((app_0
                                              (let ((msg_0
                                                     (string-append
                                                      base-msg_0
                                                      "\n  system error: "
                                                      (format-rktio-system-error-message
                                                       r_0))))
                                                (error-message->adjusted-string
                                                 'environment-variables-set!
                                                 'racket/primitive
                                                 msg_0
                                                 'racket/primitive))))
                                         (|#%app|
                                          exn:fail
                                          app_0
                                          (current-continuation-marks)))))
                                    (|#%app| fail_0))
                                  (void)))
                              (let ((nk_0 (normalize-key k_0)))
                                (set-environment-variables-ht!
                                 e3_0
                                 (if v_0
                                   (hash-set ht_0 nk_0 (cons k_0 v_0))
                                   (hash-remove ht_0 nk_0)))))))))))))))))
    (|#%name|
     environment-variables-set!
     (case-lambda
      ((e_0 k0_0 v0_0)
       (environment-variables-set!_0 e_0 k0_0 v0_0 unsafe-undefined))
      ((e_0 k0_0 v0_0 fail2_0)
       (environment-variables-set!_0 e_0 k0_0 v0_0 fail2_0))))))
(define 1/environment-variables-copy
  (|#%name|
   environment-variables-copy
   (lambda (e_0)
     (begin
       (if (1/environment-variables? e_0)
         (void)
         (raise-argument-error
          'environment-variables-copy
          "environment-variables?"
          e_0))
       (let ((ht_0 (environment-variables-ht e_0)))
         (if (not ht_0)
           (begin
             (unsafe-start-atomic)
             (let ((ev_0
                    (|#%app| rktio_envvars (unsafe-place-local-ref cell.1))))
               (let ((ht_1
                      (if (vector? ev_0)
                        hash2725
                        (begin0
                          (let ((table_0 hash2725))
                            (let ((table_1 table_0))
                              (let ((end_0
                                     (|#%app|
                                      rktio_envvars_count
                                      (unsafe-place-local-ref cell.1)
                                      ev_0)))
                                (letrec*
                                 ((for-loop_0
                                   (|#%name|
                                    for-loop
                                    (lambda (table_2 pos_0)
                                      (if (< pos_0 end_0)
                                        (let ((table_3
                                               (let ((table_3
                                                      (call-with-values
                                                       (lambda ()
                                                         (let ((k_0
                                                                (|#%app|
                                                                 rktio_envvars_name_ref
                                                                 (unsafe-place-local-ref
                                                                  cell.1)
                                                                 ev_0
                                                                 pos_0)))
                                                           (let ((v_0
                                                                  (|#%app|
                                                                   rktio_envvars_value_ref
                                                                   (unsafe-place-local-ref
                                                                    cell.1)
                                                                   ev_0
                                                                   pos_0)))
                                                             (let ((case-k_0
                                                                    (begin0
                                                                      (bytes->immutable-bytes
                                                                       (|#%app|
                                                                        rktio_to_bytes
                                                                        k_0))
                                                                      (|#%app|
                                                                       rktio_free
                                                                       k_0))))
                                                               (let ((app_0
                                                                      (normalize-key
                                                                       case-k_0)))
                                                                 (values
                                                                  app_0
                                                                  (cons
                                                                   case-k_0
                                                                   (begin0
                                                                     (bytes->immutable-bytes
                                                                      (|#%app|
                                                                       rktio_to_bytes
                                                                       v_0))
                                                                     (|#%app|
                                                                      rktio_free
                                                                      v_0)))))))))
                                                       (lambda (key_0 val_0)
                                                         (hash-set
                                                          table_2
                                                          key_0
                                                          val_0)))))
                                                 (values table_3))))
                                          (for-loop_0 table_3 (+ pos_0 1)))
                                        table_2)))))
                                 (for-loop_0 table_1 0)))))
                          (|#%app|
                           rktio_envvars_free
                           (unsafe-place-local-ref cell.1)
                           ev_0)))))
                 (begin (unsafe-end-atomic) (environment-variables1.1 ht_1)))))
           (environment-variables1.1 ht_0)))))))
(define 1/environment-variables-names
  (|#%name|
   environment-variables-names
   (lambda (e_0)
     (begin
       (if (1/environment-variables? e_0)
         (void)
         (raise-argument-error
          'environment-variables-names
          "environment-variables?"
          e_0))
       (let ((ht_0 (environment-variables-ht e_0)))
         (if (not ht_0)
           (1/environment-variables-names (1/environment-variables-copy e_0))
           (map_2353 car (hash-values ht_0))))))))
(define 1/find-system-path
  (|#%name|
   find-system-path
   (lambda (key_0)
     (let ((as-dir_0
            (|#%name| as-dir (lambda (p_0) (1/path->directory-path p_0)))))
       (begin0
         (let ((index_0
                (if (symbol? key_0)
                  (hash-ref hash2702 key_0 (lambda () 0))
                  0)))
           (if (unsafe-fx< index_0 9)
             (if (unsafe-fx< index_0 4)
               (if (unsafe-fx< index_0 1)
                 (raise-argument-error
                  'find-system-path
                  (string-append
                   "(or/c 'home-dir 'pref-dir 'pref-file 'temp-dir\n"
                   "      'init-dir 'init-file 'addon-dir 'cache-dir\n"
                   "      'doc-dir 'desk-dir 'sys-dir 'exec-file 'run-file\n"
                   "      'collects-dir 'config-dir 'orig-dir\n"
                   "      'host-collects-dir 'host-config-dir)")
                  key_0)
                 (if (unsafe-fx< index_0 2)
                   (let ((or-part_0 exec-file))
                     (if or-part_0
                       or-part_0
                       (string->path$1 "/usr/local/bin/racket")))
                   (if (unsafe-fx< index_0 3)
                     (let ((or-part_0 run-file))
                       (if or-part_0
                         or-part_0
                         (1/find-system-path 'exec-file)))
                     (let ((p_0
                            (let ((or-part_0 config-dir))
                              (if or-part_0
                                or-part_0
                                (string->path$1 "../etc")))))
                       (1/path->directory-path p_0)))))
               (if (unsafe-fx< index_0 6)
                 (if (unsafe-fx< index_0 5)
                   (let ((p_0
                          (let ((or-part_0 collects-dir))
                            (if or-part_0
                              or-part_0
                              (string->path$1 "../collects")))))
                     (1/path->directory-path p_0))
                   (let ((p_0
                          (let ((or-part_0 host-config-dir))
                            (if or-part_0
                              or-part_0
                              (let ((or-part_1 config-dir))
                                (if or-part_1
                                  or-part_1
                                  (string->path$1 "../etc")))))))
                     (1/path->directory-path p_0)))
                 (if (unsafe-fx< index_0 7)
                   (let ((p_0
                          (let ((or-part_0 host-collects-dir))
                            (if or-part_0
                              or-part_0
                              (let ((or-part_1 collects-dir))
                                (if or-part_1
                                  or-part_1
                                  (string->path$1 "../collects")))))))
                     (1/path->directory-path p_0))
                   (if (unsafe-fx< index_0 8)
                     (1/path->directory-path orig-dir)
                     (let ((p_0 (rktio-system-path 'find-system-path 1)))
                       (1/path->directory-path p_0))))))
             (if (unsafe-fx< index_0 13)
               (if (unsafe-fx< index_0 10)
                 (let ((p_0 (rktio-system-path 'find-system-path 0)))
                   (1/path->directory-path p_0))
                 (if (unsafe-fx< index_0 11)
                   (let ((p_0 (rktio-system-path 'find-system-path 2)))
                     (1/path->directory-path p_0))
                   (if (unsafe-fx< index_0 12)
                     (rktio-system-path 'find-system-path 3)
                     (let ((p_0
                            (let ((or-part_0 addon-dir))
                              (if or-part_0
                                or-part_0
                                (rktio-system-path 'find-system-path 4)))))
                       (1/path->directory-path p_0)))))
               (if (unsafe-fx< index_0 15)
                 (if (unsafe-fx< index_0 14)
                   (let ((p_0 (rktio-system-path 'find-system-path 10)))
                     (1/path->directory-path p_0))
                   (let ((p_0 (rktio-system-path 'find-system-path 5)))
                     (1/path->directory-path p_0)))
                 (if (unsafe-fx< index_0 16)
                   (let ((p_0 (rktio-system-path 'find-system-path 6)))
                     (1/path->directory-path p_0))
                   (if (unsafe-fx< index_0 17)
                     (let ((p_0 (rktio-system-path 'find-system-path 7)))
                       (1/path->directory-path p_0))
                     (if (unsafe-fx< index_0 18)
                       (let ((p_0 (rktio-system-path 'find-system-path 8)))
                         (1/path->directory-path p_0))
                       (rktio-system-path 'find-system-path 9))))))))
         (1/security-guard-check-file 'find-system-path #f '(exists)))))))
(define exec-file #f)
(define set-exec-file! (lambda (p_0) (set! exec-file p_0)))
(define run-file #f)
(define set-run-file! (lambda (p_0) (set! run-file p_0)))
(define orig-dir
  (let ((os-host-dir_0
         (let ((dir_0
                (|#%app|
                 rktio_get_current_directory
                 (unsafe-place-local-ref cell.1))))
           (if (vector? dir_0)
             (let ((tmp_0 (system-path-convention-type)))
               (if (eq? tmp_0 'unix)
                 #vu8(47)
                 (if (eq? tmp_0 'windows) #vu8(67 58 92) (void))))
             (|#%app| rktio_to_bytes dir_0)))))
    (let ((os-dir_0 (1/path->directory-path (host-> os-host-dir_0))))
      (let ((tmp_0 (system-type 'os)))
        (if (eq? tmp_0 'windows)
          os-dir_0
          (let ((pwd_0
                 (1/environment-variables-ref
                  (1/current-environment-variables)
                  #vu8(80 87 68))))
            (if (not pwd_0)
              os-dir_0
              (let ((os-dir-id_0
                     (begin
                       (unsafe-start-atomic)
                       (path-or-fd-identity.1
                        #f
                        #f
                        os-host-dir_0
                        #t
                        #f
                        'original-directory))))
                (let ((pwd-id_0
                       (begin
                         (unsafe-start-atomic)
                         (path-or-fd-identity.1
                          #f
                          #f
                          pwd_0
                          #t
                          #f
                          'original-directory))))
                  (if (if os-dir-id_0 (eqv? os-dir-id_0 pwd-id_0) #f)
                    (1/path->directory-path (host-> pwd_0))
                    os-dir_0))))))))))
(define collects-dir #f)
(define set-collects-dir! (lambda (p_0) (set! collects-dir p_0)))
(define config-dir #f)
(define set-config-dir! (lambda (p_0) (set! config-dir p_0)))
(define addon-dir #f)
(define set-addon-dir! (lambda (p_0) (set! addon-dir p_0)))
(define host-collects-dir #f)
(define set-host-collects-dir! (lambda (p_0) (set! host-collects-dir p_0)))
(define host-config-dir #f)
(define set-host-config-dir! (lambda (p_0) (set! host-config-dir p_0)))
(define rktio-system-path
  (lambda (who_0 key_0)
    (begin
      (unsafe-start-atomic)
      (let ((s_0
             (|#%app|
              rktio_system_path
              (unsafe-place-local-ref cell.1)
              key_0)))
        (if (vector? s_0)
          (begin
            (unsafe-end-atomic)
            (let ((base-msg_0 "path lookup failed"))
              (raise
               (let ((app_0
                      (let ((msg_0
                             (string-append
                              base-msg_0
                              "\n  system error: "
                              (format-rktio-system-error-message s_0))))
                        (error-message->adjusted-string
                         who_0
                         'racket/primitive
                         msg_0
                         'racket/primitive))))
                 (|#%app| exn:fail app_0 (current-continuation-marks))))))
          (let ((bstr_0 (|#%app| rktio_to_bytes s_0)))
            (begin
              (|#%app| rktio_free s_0)
              (unsafe-end-atomic)
              (path1.1 bstr_0 (system-path-convention-type)))))))))
(define init-current-directory!
  (lambda ()
    (begin
      (current-directory$1 orig-dir)
      (current-directory-for-user$1 orig-dir))))
(define effect_3139 (begin (void (init-current-directory!)) (void)))
(define 1/path->complete-path
  (|#%name|
   path->complete-path
   (case-lambda
    ((p_0)
     (path->complete-path.1 #f p_0 current-directory-for-path->complete-path))
    ((p_0 wrt_0) (path->complete-path.1 #t p_0 wrt_0)))))
(define 1/current-drive
  (|#%name|
   current-drive
   (lambda ()
     (begin
       (1/security-guard-check-file 'current-drive #f '(exists))
       (if (eq? (system-path-convention-type) 'unix)
         (string->path$1 "/")
         (let ((dir_0 (|#%app| 1/current-directory)))
           (path1.1 (split-drive (path-bytes dir_0)) 'windows)))))))
(define make-guard-paths
  (lambda (who_0 normalize?_0)
    (lambda (path_0)
      (if (path-string? path_0)
        (begin
          (->host path_0 who_0 '(exists))
          (if normalize?_0
            (1/path->directory-path (1/simplify-path path_0))
            path_0))
        path_0))))
(define make-wrap-paths
  (lambda (who_0)
    (lambda (path_0)
      (begin (1/security-guard-check-file who_0 #f '(exists)) path_0))))
(define 1/current-directory
  (let ((app_0 (make-guard-paths 'current-directory #t)))
    (make-derived-parameter
     current-directory$1
     app_0
     (make-wrap-paths 'current-directory))))
(define current-directory-for-path->complete-path
  (let ((app_0 (make-guard-paths 'path->complete-path #f)))
    (make-derived-parameter
     current-directory$1
     app_0
     (make-wrap-paths 'path->complete-path))))
(define 1/current-directory-for-user
  (let ((app_0 (make-guard-paths 'current-directory-for-user #t)))
    (make-derived-parameter
     current-directory-for-user$1
     app_0
     (make-wrap-paths 'current-directory-for-user))))
(define 1/current-load-relative-directory
  (let ((guard_0 (make-guard-paths 'current-load-relative-directory #f)))
    (let ((full-guard_0
           (|#%name|
            full-guard
            (case-lambda
             (() (|#%app| guard_0))
             ((v_0)
              (begin
                (if v_0
                  (if (if (path-string? v_0) (1/complete-path? v_0) #f)
                    (void)
                    (raise-argument-error
                     'current-load-relative-directory
                     "(or/c (and/c path-string? complete-path?) #f)"
                     v_0))
                  (void))
                (|#%app| guard_0 v_0)))))))
      (make-derived-parameter
       current-load-relative-directory$1
       full-guard_0
       full-guard_0))))
(define 1/_path
  (make-ctype
   _bytes
   (lambda (p_0)
     (begin
       (if (let ((or-part_0 (not p_0)))
             (if or-part_0 or-part_0 (path-string? p_0)))
         (void)
         (raise-argument-error '_path "(or/c path-string? #f)" p_0))
       (if p_0 (bytes-append (path-bytes (->path p_0)) #vu8(0)) #f)))
   (lambda (bstr_0)
     (if bstr_0
       (path1.1 (bytes->immutable-bytes bstr_0) (system-path-convention-type))
       #f))))
(define 1/bytes->path
  (let ((bytes->path_0
         (|#%name|
          bytes->path
          (lambda (bstr2_0 convention1_0)
            (let ((convention_0
                   (if (eq? convention1_0 unsafe-undefined)
                     (system-path-convention-type)
                     convention1_0)))
              (begin
                (if (bytes? bstr2_0)
                  (void)
                  (raise-argument-error 'bytes->path "bytes?" bstr2_0))
                (check-convention 'bytes->path convention_0)
                (check-path-bytes 'bytes->path bstr2_0)
                (path1.1 (bytes->immutable-bytes bstr2_0) convention_0)))))))
    (|#%name|
     bytes->path
     (case-lambda
      ((bstr_0) (bytes->path_0 bstr_0 unsafe-undefined))
      ((bstr_0 convention1_0) (bytes->path_0 bstr_0 convention1_0))))))
(define 1/path->bytes
  (|#%name|
   path->bytes
   (lambda (p_0)
     (begin
       (if (1/path? p_0)
         (void)
         (raise-argument-error 'path->bytes "path-for-some-system?" p_0))
       (bytes-copy (path-bytes p_0))))))
(define 1/string->path-element
  (let ((string->path-element_0
         (|#%name|
          string->path-element
          (lambda (s4_0 false-on-non-element?3_0)
            (begin
              (if (string? s4_0)
                (void)
                (raise-argument-error 'string->path-element "string?" s4_0))
              (check-path-string 'string->path-element s4_0)
              (do-bytes->path-element
               (string->path-bytes s4_0)
               (system-path-convention-type)
               'string->path-element
               s4_0
               false-on-non-element?3_0))))))
    (|#%name|
     string->path-element
     (case-lambda
      ((s_0) (string->path-element_0 s_0 #f))
      ((s_0 false-on-non-element?3_0)
       (string->path-element_0 s_0 false-on-non-element?3_0))))))
(define 1/bytes->path-element
  (let ((bytes->path-element_0
         (|#%name|
          bytes->path-element
          (lambda (bstr7_0 convention5_0 false-on-non-element?6_0)
            (let ((convention_0
                   (if (eq? convention5_0 unsafe-undefined)
                     (system-path-convention-type)
                     convention5_0)))
              (begin
                (if (bytes? bstr7_0)
                  (void)
                  (raise-argument-error 'bytes->path-element "bytes?" bstr7_0))
                (check-convention 'bytes->path-element convention_0)
                (check-path-bytes 'bytes->path-element bstr7_0)
                (do-bytes->path-element
                 bstr7_0
                 convention_0
                 'bytes->path-element
                 bstr7_0
                 false-on-non-element?6_0)))))))
    (|#%name|
     bytes->path-element
     (case-lambda
      ((bstr_0) (bytes->path-element_0 bstr_0 unsafe-undefined #f))
      ((bstr_0 convention_0 false-on-non-element?6_0)
       (bytes->path-element_0 bstr_0 convention_0 false-on-non-element?6_0))
      ((bstr_0 convention5_0)
       (bytes->path-element_0 bstr_0 convention5_0 #f))))))
(define path-element-clean.1
  (|#%name|
   path-element-clean
   (lambda (try-quick?8_0 p10_0)
     (if (1/path? p10_0)
       (let ((bstr_0 (path-bytes p10_0)))
         (let ((convention_0 (path-convention p10_0)))
           (if (let ((or-part_0 (not try-quick?8_0)))
                 (if or-part_0
                   or-part_0
                   (let ((or-part_1 (not (eq? convention_0 'unix))))
                     (if or-part_1
                       or-part_1
                       (not
                        (call-with-values
                         (lambda ()
                           (unsafe-normalise-inputs
                            unsafe-bytes-length
                            bstr_0
                            0
                            (letrec*
                             ((loop_0
                               (|#%name|
                                loop
                                (lambda (end_0)
                                  (if (zero? end_0)
                                    0
                                    (if (is-sep?
                                         (unsafe-bytes-ref bstr_0 (sub1 end_0))
                                         convention_0)
                                      (loop_0 (sub1 end_0))
                                      end_0))))))
                             (loop_0 (unsafe-bytes-length bstr_0)))
                            1))
                         (lambda (v*_0 start*_0 stop*_0 step*_0)
                           (let ((start_0 0))
                             (let ((v*_1 v*_0)
                                   (start*_1 start*_0)
                                   (stop*_1 stop*_0)
                                   (step*_1 step*_0))
                               (letrec*
                                ((for-loop_0
                                  (|#%name|
                                   for-loop
                                   (lambda (result_0 idx_0 pos_0)
                                     (if (if (unsafe-fx< idx_0 stop*_1) #t #f)
                                       (let ((c_0
                                              (unsafe-bytes-ref v*_1 idx_0)))
                                         (let ((result_1
                                                (let ((result_1
                                                       (if (is-sep?
                                                            c_0
                                                            convention_0)
                                                         pos_0
                                                         #f)))
                                                  (values result_1))))
                                           (if (if (not
                                                    (let ((x_0 (list c_0)))
                                                      result_1))
                                                 (if (not
                                                      (let ((x_0 (list pos_0)))
                                                        result_1))
                                                   #t
                                                   #f)
                                                 #f)
                                             (for-loop_0
                                              result_1
                                              (unsafe-fx+ idx_0 1)
                                              (+ pos_0 1))
                                             result_1)))
                                       result_0)))))
                                (for-loop_0 #f start*_1 start_0)))))))))))
             (call-with-values
              (lambda () (1/split-path p10_0))
              (lambda (base_0 name_0 dir?_0)
                (if (symbol? base_0) (if (1/path? name_0) name_0 #f) #f)))
             #f)))
       #f))))
(define path-element? (lambda (p_0) (if (path-element-clean.1 #t p_0) #t #f)))
(define do-bytes->path-element
  (lambda (bstr_0 convention_0 who_0 orig-arg_0 false-on-non-element?_0)
    (let ((bad-element_0
           (|#%name|
            bad-element
            (lambda ()
              (raise-arguments-error
               who_0
               "cannot be converted to a path element"
               "path"
               orig-arg_0
               "explanation"
               (unquoted-printing-string
                "path can be split, is not relative, or names a special element"))))))
      (if (if (eq? 'windows convention_0)
            (call-with-values
             (lambda () (values bstr_0 (unsafe-bytes-length bstr_0)))
             (lambda (vec_0 len_0)
               (letrec*
                ((for-loop_0
                  (|#%name|
                   for-loop
                   (lambda (result_0 pos_0)
                     (if (unsafe-fx< pos_0 len_0)
                       (let ((b_0 (unsafe-bytes-ref vec_0 pos_0)))
                         (let ((result_1 (eqv? b_0 92)))
                           (let ((result_2 (values result_1)))
                             (if (if (not (let ((x_0 (list b_0))) result_2))
                                   #t
                                   #f)
                               (for-loop_0 result_2 (unsafe-fx+ 1 pos_0))
                               result_2))))
                       result_0)))))
                (for-loop_0 #f 0))))
            #f)
        (if (not false-on-non-element?_0) (bad-element_0) #f)
        (let ((len_0 (unsafe-bytes-length bstr_0)))
          (let ((p_0
                 (path1.1
                  (protect-path-element
                   (bytes->immutable-bytes bstr_0)
                   convention_0)
                  convention_0)))
            (if (path-element? p_0)
              p_0
              (if false-on-non-element?_0 #f (bad-element_0)))))))))
(define 1/path-element->string
  (|#%name|
   path-element->string
   (lambda (p_0)
     (let ((clean-p_0 (path-element-clean.1 #f p_0)))
       (begin
         (if clean-p_0
           (void)
           (if (path-element? p_0)
             (void)
             (raise-argument-error 'path-element->string "path-element?" p_0)))
         (1/bytes->string/locale (strip-//?/rel clean-p_0) '#\x3f))))))
(define 1/path-element->bytes
  (|#%name|
   path-element->bytes
   (lambda (p_0)
     (let ((clean-p_0 (path-element-clean.1 #f p_0)))
       (begin
         (if clean-p_0
           (void)
           (if (path-element? p_0)
             (void)
             (raise-argument-error 'path-element->bytes "path-element?" p_0)))
         (bytes-copy (strip-//?/rel clean-p_0)))))))
(define strip-//?/rel
  (lambda (elem-p_0)
    (let ((bstr_0 (path-bytes elem-p_0)))
      (if (eq? (path-convention elem-p_0) 'windows)
        (strip-backslash-backslash-rel bstr_0)
        bstr_0))))
(define 1/path<?
  (|#%name|
   path<?
   (case-lambda
    ((p_0)
     (begin
       (if (is-path? p_0) (void) (raise-argument-error 'path<? "path?" p_0))
       #t))
    ((p1_0 p2_0)
     (begin
       (if (is-path? p1_0) (void) (raise-argument-error 'path<? "path?" p1_0))
       (if (is-path? p2_0) (void) (raise-argument-error 'path<? "path?" p2_0))
       (let ((app_0 (path-bytes p1_0))) (bytes<? app_0 (path-bytes p2_0)))))
    ((p_0 . ps_0)
     (begin
       (if (is-path? p_0) (void) (raise-argument-error 'path<? "path?" p_0))
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda (bstr_0 ps_1)
             (if (null? ps_1)
               #t
               (let ((p_1 (car ps_1)))
                 (begin
                   (if (is-path? p_1)
                     (void)
                     (raise-argument-error 'path<? "path?" p_1))
                   (let ((bstr2_0 (path-bytes p_1)))
                     (if (bytes<? bstr_0 bstr2_0)
                       (loop_0 bstr2_0 (cdr ps_1))
                       #f)))))))))
        (loop_0 (path-bytes p_0) ps_0)))))))
(define 1/path-convention-type
  (|#%name|
   path-convention-type
   (lambda (p_0)
     (begin
       (if (1/path? p_0)
         (void)
         (raise-argument-error
          'path-convention-type
          "path-for-some-system?"
          p_0))
       (path-convention p_0)))))
(define utf-16-encode
  (lambda (s_0)
    (let ((surrogate-count_0
           (call-with-values
            (lambda () (values s_0 (unsafe-string-length s_0)))
            (lambda (vec_0 len_0)
              (letrec*
               ((for-loop_0
                 (|#%name|
                  for-loop
                  (lambda (n_0 pos_0)
                    (if (unsafe-fx< pos_0 len_0)
                      (let ((c_0 (string-ref vec_0 pos_0)))
                        (let ((n_1
                               (let ((n_1
                                      (if (fx>= (char->integer c_0) 65536)
                                        (fx+ n_0 1)
                                        n_0)))
                                 (values n_1))))
                          (for-loop_0 n_1 (unsafe-fx+ 1 pos_0))))
                      n_0)))))
               (for-loop_0 0 0))))))
      (let ((bstr_0
             (make-bytes (fx* 2 (fx+ (string-length s_0) surrogate-count_0)))))
        (begin
          (call-with-values
           (lambda () (values s_0 (unsafe-string-length s_0)))
           (lambda (vec_0 len_0)
             (letrec*
              ((for-loop_0
                (|#%name|
                 for-loop
                 (lambda (pos_0 pos_1)
                   (if (unsafe-fx< pos_1 len_0)
                     (let ((c_0 (string-ref vec_0 pos_1)))
                       (let ((pos_2
                              (let ((pos_2
                                     (let ((v_0 (char->integer c_0)))
                                       (if (fx>= v_0 65536)
                                         (let ((av_0 (fx- v_0 65536)))
                                           (let ((hi_0
                                                  (fxior
                                                   55296
                                                   (fxand
                                                    (unsafe-fxrshift av_0 10)
                                                    1023))))
                                             (let ((lo_0
                                                    (fxior
                                                     56320
                                                     (fxand av_0 1023))))
                                               (begin
                                                 (bytes-set-two!
                                                  bstr_0
                                                  pos_0
                                                  (unsafe-fxrshift hi_0 8)
                                                  (fxand hi_0 255))
                                                 (let ((app_0 (+ pos_0 2)))
                                                   (let ((app_1
                                                          (unsafe-fxrshift
                                                           lo_0
                                                           8)))
                                                     (bytes-set-two!
                                                      bstr_0
                                                      app_0
                                                      app_1
                                                      (fxand lo_0 255))))
                                                 (fx+ pos_0 4)))))
                                         (begin
                                           (bytes-set-two!
                                            bstr_0
                                            pos_0
                                            (unsafe-fxrshift v_0 8)
                                            (fxand v_0 255))
                                           (fx+ pos_0 2))))))
                                (values pos_2))))
                         (for-loop_0 pos_2 (unsafe-fx+ 1 pos_1))))
                     pos_0)))))
              (for-loop_0 0 0))))
          bstr_0)))))
(define big-endian? (system-big-endian?))
(define utf-16-decode
  (lambda (bstr_0)
    (let ((len_0 (unsafe-bytes-length bstr_0)))
      (let ((surrogate-count_0
             (if (fx= len_0 0)
               0
               (call-with-values
                (lambda ()
                  (unsafe-normalise-inputs
                   unsafe-bytes-length
                   bstr_0
                   (if big-endian? 0 1)
                   len_0
                   2))
                (lambda (v*_0 start*_0 stop*_0 step*_0)
                  (letrec*
                   ((for-loop_0
                     (|#%name|
                      for-loop
                      (lambda (n_0 idx_0)
                        (if (< idx_0 stop*_0)
                          (let ((b_0 (unsafe-bytes-ref v*_0 idx_0)))
                            (let ((n_1
                                   (let ((n_1
                                          (if (fx= (fxand b_0 220) 216)
                                            (fx+ n_0 1)
                                            n_0)))
                                     (values n_1))))
                              (for-loop_0 n_1 (+ idx_0 2))))
                          n_0)))))
                   (for-loop_0 0 start*_0)))))))
        (let ((str_0
               (make-string
                (fx- (unsafe-fxrshift len_0 1) surrogate-count_0))))
          (begin
            (letrec*
             ((loop_0
               (|#%name|
                loop
                (lambda (i_0 pos_0)
                  (if (fx= i_0 len_0)
                    (void)
                    (let ((a_0 (unsafe-bytes-ref bstr_0 i_0)))
                      (let ((b_0 (unsafe-bytes-ref bstr_0 (fx+ i_0 1))))
                        (let ((v_0
                               (if big-endian?
                                 (fxior (unsafe-fxlshift a_0 8) b_0)
                                 (fxior (unsafe-fxlshift b_0 8) a_0))))
                          (if (fx= (fxand v_0 56320) 55296)
                            (let ((a_1 (unsafe-bytes-ref bstr_0 (fx+ i_0 2))))
                              (let ((b_1
                                     (unsafe-bytes-ref bstr_0 (fx+ i_0 3))))
                                (let ((v2_0
                                       (if big-endian?
                                         (fxior (unsafe-fxlshift a_1 8) b_1)
                                         (fxior (unsafe-fxlshift b_1 8) a_1))))
                                  (let ((all-v_0
                                         (fx+
                                          65536
                                          (let ((app_0
                                                 (unsafe-fxlshift
                                                  (fxand v_0 1023)
                                                  10)))
                                            (fxior app_0 (fxand v2_0 1023))))))
                                    (begin
                                      (string-set!
                                       str_0
                                       pos_0
                                       (integer->char all-v_0))
                                      (let ((app_0 (fx+ i_0 4)))
                                        (loop_0 app_0 (fx+ pos_0 1))))))))
                            (begin
                              (string-set! str_0 pos_0 (integer->char v_0))
                              (let ((app_0 (fx+ i_0 2)))
                                (loop_0 app_0 (fx+ pos_0 1)))))))))))))
             (loop_0 0 0))
            str_0))))))
(define string-length-up-to-nul
  (lambda (s_0 i_0 l_0)
    (letrec*
     ((loop_0
       (|#%name|
        loop
        (lambda (j_0)
          (if (= j_0 l_0)
            (- j_0 i_0)
            (if (eqv? (string-ref s_0 j_0) '#\x0)
              (- j_0 i_0)
              (loop_0 (add1 j_0))))))))
     (loop_0 i_0))))
(define maybe-substring
  (lambda (s_0 i_0 l_0) (if (zero? i_0) s_0 (substring s_0 i_0 l_0))))
(define 1/string-locale-upcase
  (|#%name|
   string-locale-upcase
   (lambda (s_0)
     (begin
       (if (string? s_0)
         (void)
         (raise-argument-error 'string-locale-upcase "string?" s_0))
       (recase.1 #t s_0)))))
(define 1/string-locale-downcase
  (|#%name|
   string-locale-downcase
   (lambda (s_0)
     (begin
       (if (string? s_0)
         (void)
         (raise-argument-error 'string-locale-downcase "string?" s_0))
       (recase.1 #f s_0)))))
(define recase.1
  (|#%name|
   recase
   (lambda (up?1_0 s3_0)
     (let ((len_0 (string-length s3_0)))
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda (pos_0)
             (let ((i-len_0
                    (fx+ pos_0 (string-length-up-to-nul s3_0 pos_0 len_0))))
               (if (fx= i-len_0 len_0)
                 (let ((new-s_0
                        (recase/no-nul
                         (if (zero? pos_0) s3_0 (substring s3_0 pos_0 len_0))
                         up?1_0)))
                   (if (eqv? pos_0 0) new-s_0 (list new-s_0)))
                 (let ((new-s_0
                        (recase/no-nul (substring s3_0 pos_0 i-len_0) up?1_0)))
                   (let ((r_0 (loop_0 (fx+ i-len_0 1))))
                     (if (eqv? pos_0 0)
                       (apply string-append new-s_0 (string '#\x0) r_0)
                       (cons new-s_0 (cons (string '#\x0) r_0)))))))))))
        (loop_0 0))))))
(define recase/no-nul
  (lambda (s_0 up?_0)
    (let ((locale_0 (1/current-locale)))
      (if (not locale_0)
        (if up?_0 (string-upcase s_0) (string-downcase s_0))
        (if (if (equal? locale_0 "")
              (not
               (fx=
                0
                (fxand
                 (|#%app|
                  rktio_convert_properties
                  (unsafe-place-local-ref cell.1))
                 4)))
              #f)
          (let ((s-16_0 (utf-16-encode s_0)))
            (begin
              (unsafe-start-atomic)
              (let ((r_0
                     (|#%app|
                      rktio_recase_utf16
                      (unsafe-place-local-ref cell.1)
                      up?_0
                      s-16_0
                      (unsafe-fxrshift (unsafe-bytes-length s-16_0) 1)
                      #f)))
                (let ((sr_0 (|#%app| rktio_to_shorts r_0)))
                  (begin
                    (|#%app| rktio_free r_0)
                    (unsafe-end-atomic)
                    (utf-16-decode sr_0))))))
          (let ((c_0 #f))
            (let ((in-bstr_0 (string->bytes/ucs-4 s_0 0 (string-length s_0))))
              (let ((enc_0 (1/locale-string-encoding)))
                (dynamic-wind
                 (lambda () (set! c_0 (bytes-open-converter/cached-to enc_0)))
                 (lambda ()
                   (letrec*
                    ((loop_0
                      (|#%name|
                       loop
                       (lambda (pos_0)
                         (if (fx= pos_0 (unsafe-bytes-length in-bstr_0))
                           (if (eqv? pos_0 0) "" '(""))
                           (call-with-values
                            (lambda () (1/bytes-convert c_0 in-bstr_0 pos_0))
                            (lambda (bstr_0 in-used_0 status_0)
                              (begin
                                (unsafe-start-atomic)
                                (begin
                                  (sync-locale!)
                                  (let ((sr_0 (locale-recase.1 up?_0 bstr_0)))
                                    (begin
                                      (unsafe-end-atomic)
                                      (let ((ls_0
                                             (1/bytes->string/locale sr_0)))
                                        (if (eq? status_0 'complete)
                                          (if (eqv? pos_0 0) ls_0 (list ls_0))
                                          (let ((r_0
                                                 (loop_0
                                                  (fx+ pos_0 in-used_0 4))))
                                            (let ((err-s_0
                                                   (string
                                                    (string-ref
                                                     s_0
                                                     (unsafe-fxrshift
                                                      (+ pos_0 in-used_0)
                                                      2)))))
                                              (if (eqv? pos_0 0)
                                                (apply
                                                 string-append
                                                 ls_0
                                                 err-s_0
                                                 r_0)
                                                (list*
                                                 ls_0
                                                 err-s_0
                                                 r_0)))))))))))))))))
                    (loop_0 0)))
                 (lambda ()
                   (let ((c_1 c_0))
                     (cache-save! c_1 enc_0 cache-to set-cache-to!))))))))))))
(define locale-recase.1
  (|#%name|
   locale-recase
   (lambda (up?5_0 s7_0)
     (let ((p_0
            (|#%app|
             rktio_locale_recase
             (unsafe-place-local-ref cell.1)
             up?5_0
             s7_0)))
       (let ((r_0 (|#%app| rktio_to_bytes p_0)))
         (begin (|#%app| rktio_free p_0) r_0))))))
(define make-string-comparsion
  (lambda (who_0 cmp_0 portable-cmp_0 ci?_0)
    (lambda (arg_0 . args_0)
      (begin
        (if (string? arg_0)
          (void)
          (raise-argument-error who_0 "string?" arg_0))
        (begin
          (letrec*
           ((for-loop_0
             (|#%name|
              for-loop
              (lambda (lst_0)
                (if (pair? lst_0)
                  (let ((arg_1 (unsafe-car lst_0)))
                    (let ((rest_0 (unsafe-cdr lst_0)))
                      (begin
                        (if (string? arg_1)
                          (void)
                          (raise-argument-error who_0 "string?" arg_1))
                        (for-loop_0 rest_0))))
                  (values))))))
           (for-loop_0 args_0))
          (let ((locale-on?_0 (1/current-locale)))
            (letrec*
             ((loop_0
               (|#%name|
                loop
                (lambda (prev_0 args_1)
                  (if (null? args_1)
                    #t
                    (if (if locale-on?_0
                          (|#%app| cmp_0 (collate prev_0 (car args_1) ci?_0) 0)
                          (|#%app| portable-cmp_0 prev_0 (car args_1)))
                      (let ((app_0 (car args_1))) (loop_0 app_0 (cdr args_1)))
                      #f))))))
             (loop_0 arg_0 args_0))))))))
(define 1/string-locale<?
  (make-string-comparsion 'string-locale<? < string<? #f))
(define 1/string-locale=?
  (make-string-comparsion 'string-locale=? = string=? #f))
(define 1/string-locale>?
  (make-string-comparsion 'string-locale>? > string>? #f))
(define 1/string-locale-ci<?
  (make-string-comparsion 'string-locale-ci<? < string-ci<? #t))
(define 1/string-locale-ci=?
  (make-string-comparsion 'string-locale-ci=? = string-ci=? #t))
(define 1/string-locale-ci>?
  (make-string-comparsion 'string-locale-ci>? > string-ci>? #t))
(define collate
  (lambda (s1_0 s2_0 ci?_0)
    (let ((l1_0 (string-length s1_0)))
      (let ((l2_0 (string-length s2_0)))
        (letrec*
         ((loop_0
           (|#%name|
            loop
            (lambda (i1_0 i2_0)
              (let ((t-l1_0 (+ i1_0 (string-length-up-to-nul s1_0 i1_0 l1_0))))
                (let ((t-l2_0
                       (+ i2_0 (string-length-up-to-nul s2_0 i2_0 l2_0))))
                  (if (if (= l1_0 t-l1_0) (= l2_0 t-l2_0) #f)
                    (let ((app_0
                           (if (zero? i1_0) s1_0 (substring s1_0 i1_0 l1_0))))
                      (collate/no-nul
                       app_0
                       (if (zero? i2_0) s2_0 (substring s2_0 i2_0 l2_0))
                       ci?_0))
                    (let ((v_0
                           (let ((app_0 (substring s1_0 i1_0 t-l1_0)))
                             (collate/no-nul
                              app_0
                              (substring s2_0 i2_0 t-l2_0)
                              ci?_0))))
                      (if (not (zero? v_0))
                        v_0
                        (if (= l1_0 t-l1_0)
                          (if (= l2_0 t-l2_0) 0 -1)
                          (if (= l2_0 t-l2_0)
                            1
                            (let ((app_0 (+ t-l1_0 1)))
                              (loop_0 app_0 (+ t-l2_0 1))))))))))))))
         (loop_0 0 0))))))
(define collate/no-nul
  (lambda (s1_0 s2_0 ci?_0)
    (if (if (equal? (1/current-locale) "")
          (not
           (zero?
            (bitwise-and
             (|#%app| rktio_convert_properties (unsafe-place-local-ref cell.1))
             2)))
          #f)
      (let ((s1-16_0 (utf-16-encode s1_0)))
        (let ((s2-16_0 (utf-16-encode s2_0)))
          (let ((app_0 (arithmetic-shift (unsafe-bytes-length s1-16_0) -1)))
            (|#%app|
             rktio_strcoll_utf16
             (unsafe-place-local-ref cell.1)
             s1-16_0
             app_0
             s2-16_0
             (arithmetic-shift (unsafe-bytes-length s2-16_0) -1)
             ci?_0))))
      (let ((c1_0 #f))
        (let ((c2_0 #f))
          (let ((in-bstr1_0 (string->bytes/ucs-4 s1_0 0 (string-length s1_0))))
            (let ((in-bstr2_0
                   (string->bytes/ucs-4 s2_0 0 (string-length s2_0))))
              (let ((enc_0 (1/locale-string-encoding)))
                (dynamic-wind
                 (lambda ()
                   (begin
                     (set! c1_0 (bytes-open-converter/cached-to enc_0))
                     (set! c2_0 (bytes-open-converter/cached-to2 enc_0))))
                 (lambda ()
                   (letrec*
                    ((loop_0
                      (|#%name|
                       loop
                       (lambda (pos1_0 pos2_0 end1_0 end2_0)
                         (call-with-values
                          (lambda ()
                            (1/bytes-convert c1_0 in-bstr1_0 pos1_0 end1_0))
                          (lambda (bstr1_0 in-used1_0 status1_0)
                            (call-with-values
                             (lambda ()
                               (1/bytes-convert c2_0 in-bstr2_0 pos2_0 end2_0))
                             (lambda (bstr2_0 in-used2_0 status2_0)
                               (let ((new-pos1_0 (+ in-used1_0 pos1_0)))
                                 (let ((new-pos2_0 (+ in-used2_0 pos2_0)))
                                   (let ((done1?_0 (= new-pos1_0 end1_0)))
                                     (let ((done2?_0 (= new-pos2_0 end2_0)))
                                       (let ((check-one-byte_0
                                              (|#%name|
                                               check-one-byte
                                               (lambda ()
                                                 (let ((ch1_0
                                                        (string-ref
                                                         s1_0
                                                         (arithmetic-shift
                                                          new-pos1_0
                                                          -2))))
                                                   (let ((ch2_0
                                                          (string-ref
                                                           s2_0
                                                           (arithmetic-shift
                                                            new-pos2_0
                                                            -2))))
                                                     (if (char<? ch1_0 ch2_0)
                                                       -1
                                                       (if (char<? ch2_0 ch1_0)
                                                         1
                                                         (let ((app_0
                                                                (+
                                                                 new-pos1_0
                                                                 4)))
                                                           (let ((app_1
                                                                  (+
                                                                   new-pos2_0
                                                                   4)))
                                                             (let ((app_2
                                                                    (unsafe-bytes-length
                                                                     in-bstr1_0)))
                                                               (loop_0
                                                                app_0
                                                                app_1
                                                                app_2
                                                                (unsafe-bytes-length
                                                                 in-bstr2_0)))))))))))))
                                         (if (if done1?_0 done2?_0 #f)
                                           (let ((v_0
                                                  (begin
                                                    (unsafe-start-atomic)
                                                    (begin0
                                                      (begin
                                                        (sync-locale!)
                                                        (if ci?_0
                                                          (let ((app_0
                                                                 (locale-recase.1
                                                                  #f
                                                                  bstr1_0)))
                                                            (|#%app|
                                                             rktio_locale_strcoll
                                                             (unsafe-place-local-ref
                                                              cell.1)
                                                             app_0
                                                             (locale-recase.1
                                                              #f
                                                              bstr2_0)))
                                                          (|#%app|
                                                           rktio_locale_strcoll
                                                           (unsafe-place-local-ref
                                                            cell.1)
                                                           bstr1_0
                                                           bstr2_0)))
                                                      (unsafe-end-atomic)))))
                                             (if (zero? v_0)
                                               (let ((really-done1?_0
                                                      (=
                                                       new-pos1_0
                                                       (unsafe-bytes-length
                                                        in-bstr1_0))))
                                                 (let ((really-done2?_0
                                                        (=
                                                         new-pos2_0
                                                         (unsafe-bytes-length
                                                          in-bstr2_0))))
                                                   (if (if really-done1?_0
                                                         really-done2?_0
                                                         #f)
                                                     0
                                                     (if really-done1?_0
                                                       -1
                                                       (if really-done2?_0
                                                         1
                                                         (check-one-byte_0))))))
                                               v_0))
                                           (let ((len_0
                                                  (min in-used1_0 in-used2_0)))
                                             (if (zero? len_0)
                                               (if (if (zero? in-used1_0)
                                                     (zero? in-used2_0)
                                                     #f)
                                                 (check-one-byte_0)
                                                 (if (zero? in-used1_0) 1 -1))
                                               (let ((app_0 (+ pos1_0 len_0)))
                                                 (loop_0
                                                  pos1_0
                                                  pos2_0
                                                  app_0
                                                  (+
                                                   pos2_0
                                                   len_0)))))))))))))))))))
                    (loop_0
                     0
                     0
                     (unsafe-bytes-length in-bstr1_0)
                     (unsafe-bytes-length in-bstr2_0))))
                 (lambda ()
                   (begin
                     (let ((c_0 c1_0))
                       (cache-save! c_0 enc_0 cache-to set-cache-to!))
                     (let ((c_0 c2_0))
                       (cache-save!
                        c_0
                        enc_0
                        cache-to_3068
                        set-cache-to2!)))))))))))))
(define 1/error
  (|#%name|
   error
   (lambda (init_0 . args_0)
     (raise (format-error 'error exn:fail init_0 args_0)))))
(define 1/raise-user-error
  (|#%name|
   raise-user-error
   (lambda (init_0 . args_0)
     (raise (format-error 'raise-user-error exn:fail:user init_0 args_0)))))
(define format-error
  (lambda (who_0 exn:fail_0 init_0 args_0)
    (if (if (symbol? init_0) (null? args_0) #f)
      (let ((app_0 (string-append "error: " (symbol->string init_0))))
        (|#%app| exn:fail_0 app_0 (current-continuation-marks)))
      (if (symbol? init_0)
        (begin
          (if (string? (car args_0))
            (void)
            (raise-argument-error who_0 "string?" (car args_0)))
          (let ((o_0 (1/open-output-string)))
            (begin
              (let ((app_0 (car args_0)))
                (do-printf who_0 o_0 app_0 (cdr args_0)))
              (let ((app_0
                     (let ((app_0 (symbol->string init_0)))
                       (string-append app_0 ": " (1/get-output-string o_0)))))
                (|#%app| exn:fail_0 app_0 (current-continuation-marks))))))
        (if (string? init_0)
          (let ((app_0
                 (apply
                  string-append
                  init_0
                  (1/reverse
                   (letrec*
                    ((for-loop_0
                      (|#%name|
                       for-loop
                       (lambda (fold-var_0 lst_0)
                         (if (pair? lst_0)
                           (let ((arg_0 (unsafe-car lst_0)))
                             (let ((rest_0 (unsafe-cdr lst_0)))
                               (let ((fold-var_1
                                      (let ((fold-var_1
                                             (cons
                                              (string-append
                                               " "
                                               (let ((app_0
                                                      (error-value->string-handler)))
                                                 (|#%app|
                                                  app_0
                                                  arg_0
                                                  (error-print-width))))
                                              fold-var_0)))
                                        (values fold-var_1))))
                                 (for-loop_0 fold-var_1 rest_0))))
                           fold-var_0)))))
                    (for-loop_0 null args_0))))))
            (|#%app| exn:fail_0 app_0 (current-continuation-marks)))
          (raise-argument-error who_0 "(or/c symbol? string?)" init_0))))))
(define 1/error-print-source-location
  (make-parameter
   #t
   (lambda (v_0) (if v_0 #t #f))
   'error-print-source-location))
(define default-error-value->string-handler
  (lambda (v_0 len_0)
    (begin
      (if (exact-nonnegative-integer? len_0)
        (void)
        (raise-argument-error
         'default-error-value->string-handler
         "exact-nonnegative-integer?"
         len_0))
      (let ((o_0 (1/open-output-string)))
        (begin
          (|#%app|
           do-global-print
           'default-error-value->string-handler
           v_0
           o_0
           0
           len_0)
          (1/get-output-string o_0))))))
(define install-error-value->string-handler!
  (lambda ()
    (begin
      (error-value->string-handler default-error-value->string-handler)
      (register-error-value->string!
       (lambda (v_0)
         (let ((len_0 (error-print-width)))
           (let ((h_0 (error-value->string-handler)))
             (let ((result_0
                    (with-continuation-mark*
                     push-authentic
                     parameterization-key
                     (extend-parameterization
                      (continuation-mark-set-first #f parameterization-key)
                      error-value->string-handler
                      default-error-value->string-handler
                      1/print-unreadable
                      #t)
                     (|#%app| h_0 v_0 len_0))))
               (let ((str_0
                      (if (string? result_0)
                        result_0
                        (if (bytes? result_0)
                          (1/bytes->string/utf-8 result_0 '#\x3f)
                          "..."))))
                 (if (> (string-length str_0) len_0)
                   (substring str_0 0 len_0)
                   str_0))))))))))
(define effect_2767
  (begin (void (install-error-value->string-handler!)) (void)))
(define relative-to-user-directory
  (lambda (p_0)
    (let ((dir_0 (current-directory-for-user$1)))
      (let ((dir-bs_0 (path-bytes dir_0)))
        (let ((p-bs_0 (path-bytes p_0)))
          (let ((dir-len_0 (unsafe-bytes-length dir-bs_0)))
            (let ((p-len_0 (unsafe-bytes-length p-bs_0)))
              (if (if (< dir-len_0 p-len_0)
                    (letrec*
                     ((for-loop_0
                       (|#%name|
                        for-loop
                        (lambda (result_0 pos_0)
                          (if (< pos_0 dir-len_0)
                            (let ((result_1
                                   (let ((result_1
                                          (let ((app_0
                                                 (unsafe-bytes-ref
                                                  dir-bs_0
                                                  pos_0)))
                                            (eq?
                                             app_0
                                             (unsafe-bytes-ref
                                              p-bs_0
                                              pos_0)))))
                                     (values result_1))))
                              (if (if (not
                                       (let ((x_0 (list pos_0)))
                                         (not result_1)))
                                    #t
                                    #f)
                                (for-loop_0 result_1 (+ pos_0 1))
                                result_1))
                            result_0)))))
                     (for-loop_0 #t 0))
                    #f)
                (letrec*
                 ((loop_0
                   (|#%name|
                    loop
                    (lambda (i_0)
                      (if (if (< i_0 p-len_0)
                            (let ((app_0 (unsafe-bytes-ref p-bs_0 i_0)))
                              (is-sep? app_0 (path-convention p_0)))
                            #f)
                        (loop_0 (fx+ i_0 1))
                        (let ((app_0 (subbytes p-bs_0 i_0)))
                          (path1.1 app_0 (path-convention p_0))))))))
                 (loop_0 dir-len_0))
                p_0))))))))
(define 1/srcloc->string
  (|#%name|
   srcloc->string
   (lambda (s_0)
     (begin
       (if (srcloc? s_0)
         (void)
         (raise-argument-error 'srcloc->string "srcloc?" s_0))
       (if (srcloc-source s_0)
         (if (if (srcloc-line s_0) (srcloc-column s_0) #f)
           (let ((app_0 (adjust-path (srcloc-source s_0))))
             (let ((app_1 (srcloc-line s_0)))
               (1/format "~a:~s:~s" app_0 app_1 (srcloc-column s_0))))
           (if (srcloc-position s_0)
             (let ((app_0 (adjust-path (srcloc-source s_0))))
               (1/format "~a::~s" app_0 (srcloc-position s_0)))
             (1/format "~a" (adjust-path (srcloc-source s_0)))))
         #f)))))
(define adjust-path
  (lambda (p_0) (if (is-path? p_0) (relative-to-user-directory p_0) p_0)))
(define finish_1890
  (make-struct-type-install-properties
   '(logger)
   11
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1 2 7 9 10)
   #f
   'logger))
(define struct:logger
  (make-record-type-descriptor
   'logger
   #f
   (|#%nongenerative-uid| logger)
   #f
   #f
   '(11 . 376)))
(define effect_2687 (finish_1890 struct:logger))
(define logger1.1
  (|#%name|
   logger
   (record-constructor
    (make-record-constructor-descriptor struct:logger #f #f))))
(define 1/logger?_2836 (|#%name| logger? (record-predicate struct:logger)))
(define 1/logger?
  (|#%name|
   logger?
   (lambda (v)
     (if (1/logger?_2836 v)
       #t
       ($value
        (if (impersonator? v) (1/logger?_2836 (impersonator-val v)) #f))))))
(define logger-topic_2043
  (|#%name| logger-topic (record-accessor struct:logger 0)))
(define logger-topic
  (|#%name|
   logger-topic
   (lambda (s)
     (if (1/logger?_2836 s)
       (logger-topic_2043 s)
       ($value
        (impersonate-ref logger-topic_2043 struct:logger 0 s 'topic))))))
(define logger-parent_2124
  (|#%name| logger-parent (record-accessor struct:logger 1)))
(define logger-parent
  (|#%name|
   logger-parent
   (lambda (s)
     (if (1/logger?_2836 s)
       (logger-parent_2124 s)
       ($value
        (impersonate-ref logger-parent_2124 struct:logger 1 s 'parent))))))
(define logger-propagate-filters_2354
  (|#%name| logger-propagate-filters (record-accessor struct:logger 2)))
(define logger-propagate-filters
  (|#%name|
   logger-propagate-filters
   (lambda (s)
     (if (1/logger?_2836 s)
       (logger-propagate-filters_2354 s)
       ($value
        (impersonate-ref
         logger-propagate-filters_2354
         struct:logger
         2
         s
         'propagate-filters))))))
(define logger-receiver-box+backrefs_2574
  (|#%name| logger-receiver-box+backrefs (record-accessor struct:logger 3)))
(define logger-receiver-box+backrefs
  (|#%name|
   logger-receiver-box+backrefs
   (lambda (s)
     (if (1/logger?_2836 s)
       (logger-receiver-box+backrefs_2574 s)
       ($value
        (impersonate-ref
         logger-receiver-box+backrefs_2574
         struct:logger
         3
         s
         'receiver-box+backrefs))))))
(define logger-prune-counter_2638
  (|#%name| logger-prune-counter (record-accessor struct:logger 4)))
(define logger-prune-counter
  (|#%name|
   logger-prune-counter
   (lambda (s)
     (if (1/logger?_2836 s)
       (logger-prune-counter_2638 s)
       ($value
        (impersonate-ref
         logger-prune-counter_2638
         struct:logger
         4
         s
         'prune-counter))))))
(define logger-permanent-receivers_3109
  (|#%name| logger-permanent-receivers (record-accessor struct:logger 5)))
(define logger-permanent-receivers
  (|#%name|
   logger-permanent-receivers
   (lambda (s)
     (if (1/logger?_2836 s)
       (logger-permanent-receivers_3109 s)
       ($value
        (impersonate-ref
         logger-permanent-receivers_3109
         struct:logger
         5
         s
         'permanent-receivers))))))
(define logger-max-receiver-level_2792
  (|#%name| logger-max-receiver-level (record-accessor struct:logger 6)))
(define logger-max-receiver-level
  (|#%name|
   logger-max-receiver-level
   (lambda (s)
     (if (1/logger?_2836 s)
       (logger-max-receiver-level_2792 s)
       ($value
        (impersonate-ref
         logger-max-receiver-level_2792
         struct:logger
         6
         s
         'max-receiver-level))))))
(define logger-topic-level-cache_2239
  (|#%name| logger-topic-level-cache (record-accessor struct:logger 7)))
(define logger-topic-level-cache
  (|#%name|
   logger-topic-level-cache
   (lambda (s)
     (if (1/logger?_2836 s)
       (logger-topic-level-cache_2239 s)
       ($value
        (impersonate-ref
         logger-topic-level-cache_2239
         struct:logger
         7
         s
         'topic-level-cache))))))
(define logger-local-level-timestamp_2442
  (|#%name| logger-local-level-timestamp (record-accessor struct:logger 8)))
(define logger-local-level-timestamp
  (|#%name|
   logger-local-level-timestamp
   (lambda (s)
     (if (1/logger?_2836 s)
       (logger-local-level-timestamp_2442 s)
       ($value
        (impersonate-ref
         logger-local-level-timestamp_2442
         struct:logger
         8
         s
         'local-level-timestamp))))))
(define logger-root-level-timestamp-box_2700
  (|#%name| logger-root-level-timestamp-box (record-accessor struct:logger 9)))
(define logger-root-level-timestamp-box
  (|#%name|
   logger-root-level-timestamp-box
   (lambda (s)
     (if (1/logger?_2836 s)
       (logger-root-level-timestamp-box_2700 s)
       ($value
        (impersonate-ref
         logger-root-level-timestamp-box_2700
         struct:logger
         9
         s
         'root-level-timestamp-box))))))
(define logger-level-sema-box_2755
  (|#%name| logger-level-sema-box (record-accessor struct:logger 10)))
(define logger-level-sema-box
  (|#%name|
   logger-level-sema-box
   (lambda (s)
     (if (1/logger?_2836 s)
       (logger-level-sema-box_2755 s)
       ($value
        (impersonate-ref
         logger-level-sema-box_2755
         struct:logger
         10
         s
         'level-sema-box))))))
(define set-logger-receiver-box+backrefs!_2144
  (|#%name|
   set-logger-receiver-box+backrefs!
   (record-mutator struct:logger 3)))
(define set-logger-receiver-box+backrefs!
  (|#%name|
   set-logger-receiver-box+backrefs!
   (lambda (s v)
     (if (1/logger?_2836 s)
       (set-logger-receiver-box+backrefs!_2144 s v)
       ($value
        (impersonate-set!
         set-logger-receiver-box+backrefs!_2144
         struct:logger
         3
         3
         s
         v
         'receiver-box+backrefs))))))
(define set-logger-prune-counter!_2916
  (|#%name| set-logger-prune-counter! (record-mutator struct:logger 4)))
(define set-logger-prune-counter!
  (|#%name|
   set-logger-prune-counter!
   (lambda (s v)
     (if (1/logger?_2836 s)
       (set-logger-prune-counter!_2916 s v)
       ($value
        (impersonate-set!
         set-logger-prune-counter!_2916
         struct:logger
         4
         4
         s
         v
         'prune-counter))))))
(define set-logger-permanent-receivers!_2219
  (|#%name| set-logger-permanent-receivers! (record-mutator struct:logger 5)))
(define set-logger-permanent-receivers!
  (|#%name|
   set-logger-permanent-receivers!
   (lambda (s v)
     (if (1/logger?_2836 s)
       (set-logger-permanent-receivers!_2219 s v)
       ($value
        (impersonate-set!
         set-logger-permanent-receivers!_2219
         struct:logger
         5
         5
         s
         v
         'permanent-receivers))))))
(define set-logger-max-receiver-level!_2599
  (|#%name| set-logger-max-receiver-level! (record-mutator struct:logger 6)))
(define set-logger-max-receiver-level!
  (|#%name|
   set-logger-max-receiver-level!
   (lambda (s v)
     (if (1/logger?_2836 s)
       (set-logger-max-receiver-level!_2599 s v)
       ($value
        (impersonate-set!
         set-logger-max-receiver-level!_2599
         struct:logger
         6
         6
         s
         v
         'max-receiver-level))))))
(define set-logger-local-level-timestamp!_2922
  (|#%name|
   set-logger-local-level-timestamp!
   (record-mutator struct:logger 8)))
(define set-logger-local-level-timestamp!
  (|#%name|
   set-logger-local-level-timestamp!
   (lambda (s v)
     (if (1/logger?_2836 s)
       (set-logger-local-level-timestamp!_2922 s v)
       ($value
        (impersonate-set!
         set-logger-local-level-timestamp!_2922
         struct:logger
         8
         8
         s
         v
         'local-level-timestamp))))))
(define 1/logger-name
  (|#%name|
   logger-name
   (lambda (logger_0)
     (begin
       (if (1/logger? logger_0)
         (void)
         (raise-argument-error 'logger-name "logger?" logger_0))
       (logger-topic logger_0)))))
(define create-logger.1
  (|#%name|
   create-logger
   (lambda (parent3_0 propagate-filters4_0 topic2_0)
     (let ((app_0 (make-vector 16)))
       (let ((app_1
              (if parent3_0
                (logger-root-level-timestamp-box parent3_0)
                (box 0))))
         (logger1.1
          topic2_0
          parent3_0
          propagate-filters4_0
          null
          8
          null
          'none
          app_0
          -1
          app_1
          (if parent3_0 (logger-level-sema-box parent3_0) (box #f))))))))
(define logger-receivers
  (lambda (logger_0)
    (1/reverse
     (let ((lst_0 (logger-receiver-box+backrefs logger_0)))
       (letrec*
        ((for-loop_0
          (|#%name|
           for-loop
           (lambda (fold-var_0 lst_1)
             (if (pair? lst_1)
               (let ((b+r_0 (unsafe-car lst_1)))
                 (let ((rest_0 (unsafe-cdr lst_1)))
                   (let ((fold-var_1
                          (let ((id*_0 (weak-box-value (car b+r_0))))
                            (letrec*
                             ((for-loop_1
                               (|#%name|
                                for-loop
                                (lambda (fold-var_1)
                                  (let ((fold-var_2
                                         (if id*_0
                                           (let ((fold-var_2
                                                  (cons id*_0 fold-var_1)))
                                             (values fold-var_2))
                                           fold-var_1)))
                                    fold-var_2)))))
                             (for-loop_1 fold-var_0)))))
                     (for-loop_0 fold-var_1 rest_0))))
               fold-var_0)))))
        (for-loop_0 null lst_0))))))
(define level->value
  (lambda (lvl_0)
    (if (eq? lvl_0 'none)
      0
      (if (eq? lvl_0 'fatal)
        1
        (if (eq? lvl_0 'error)
          2
          (if (eq? lvl_0 'warning)
            3
            (if (eq? lvl_0 'info) 4 (if (eq? lvl_0 'debug) 5 #f))))))))
(define level>=?
  (lambda (a_0 b_0)
    (let ((app_0 (level->value a_0))) (>= app_0 (level->value b_0)))))
(define level-max
  (lambda (a_0 b_0)
    (if (let ((app_0 (level->value a_0))) (< app_0 (level->value b_0)))
      b_0
      a_0)))
(define level-min
  (lambda (a_0 b_0)
    (if (let ((app_0 (level->value a_0))) (< app_0 (level->value b_0)))
      a_0
      b_0)))
(define check-level
  (lambda (who_0 v_0)
    (if (level->value v_0)
      (void)
      (raise-argument-error
       who_0
       "(or/c 'none 'fatal 'error 'warning 'info 'debug)"
       v_0))))
(define parse-filters.1
  (|#%name|
   parse-filters
   (lambda (default-level1_0 who3_0 l4_0)
     (letrec*
      ((loop_0
        (|#%name|
         loop
         (lambda (l_0 accum_0 default-level_0)
           (if (null? l_0)
             (append accum_0 default-level_0)
             (let ((level_0 (car l_0)))
               (begin
                 (check-level who3_0 level_0)
                 (if (null? (cdr l_0))
                   (append accum_0 level_0)
                   (let ((topic_0 (cadr l_0)))
                     (begin
                       (if (let ((or-part_0 (not topic_0)))
                             (if or-part_0 or-part_0 (symbol? topic_0)))
                         (void)
                         (raise-argument-error
                          who3_0
                          "(or/c #f symbol?)"
                          topic_0))
                       (if (not topic_0)
                         (loop_0 (cddr l_0) accum_0 level_0)
                         (let ((app_0 (cddr l_0)))
                           (loop_0
                            app_0
                            (cons (cons topic_0 level_0) accum_0)
                            default-level_0)))))))))))))
      (loop_0 l4_0 null default-level1_0)))))
(define filters-level-for-topic
  (lambda (filters_0 topic_0)
    (letrec*
     ((loop_0
       (|#%name|
        loop
        (lambda (filters_1)
          (if (pair? filters_1)
            (if (eq? (caar filters_1) topic_0)
              (cdar filters_1)
              (loop_0 (cdr filters_1)))
            filters_1)))))
     (loop_0 filters_0))))
(define filters-max-level
  (lambda (filters_0)
    (letrec*
     ((loop_0
       (|#%name|
        loop
        (lambda (filters_1 best-level_0)
          (if (pair? filters_1)
            (let ((app_0 (cdr filters_1)))
              (loop_0 app_0 (level-max best-level_0 (cdar filters_1))))
            (level-max best-level_0 filters_1))))))
     (loop_0 filters_0 'none))))
(define level->user-representation
  (lambda (lvl_0) (if (eq? lvl_0 'none) #f lvl_0)))
(define finish_2164
  (make-struct-type-install-properties
   '(queue)
   2
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'queue))
(define struct:queue
  (make-record-type-descriptor
   'queue
   #f
   (|#%nongenerative-uid| queue)
   #f
   #f
   '(2 . 3)))
(define effect_2998 (finish_2164 struct:queue))
(define queue1.1
  (|#%name|
   queue
   (record-constructor
    (make-record-constructor-descriptor struct:queue #f #f))))
(define queue? (|#%name| queue? (record-predicate struct:queue)))
(define queue-start (|#%name| queue-start (record-accessor struct:queue 0)))
(define queue-end (|#%name| queue-end (record-accessor struct:queue 1)))
(define set-queue-start!
  (|#%name| set-queue-start! (record-mutator struct:queue 0)))
(define set-queue-end!
  (|#%name| set-queue-end! (record-mutator struct:queue 1)))
(define finish_2845
  (make-struct-type-install-properties
   '(node)
   3
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '(0)
   #f
   'node))
(define struct:node
  (make-record-type-descriptor
   'node
   #f
   (|#%nongenerative-uid| node)
   #f
   #f
   '(3 . 6)))
(define effect_2547 (finish_2845 struct:node))
(define node2.1
  (|#%name|
   node
   (record-constructor
    (make-record-constructor-descriptor struct:node #f #f))))
(define node? (|#%name| node? (record-predicate struct:node)))
(define node-elem (|#%name| node-elem (record-accessor struct:node 0)))
(define node-prev (|#%name| node-prev (record-accessor struct:node 1)))
(define node-next (|#%name| node-next (record-accessor struct:node 2)))
(define set-node-prev!
  (|#%name| set-node-prev! (record-mutator struct:node 1)))
(define set-node-next!
  (|#%name| set-node-next! (record-mutator struct:node 2)))
(define make-queue (lambda () (queue1.1 #f #f)))
(define queue-empty? (lambda (q_0) (not (queue-start q_0))))
(define queue-remove!
  (lambda (q_0)
    (let ((qs_0 (queue-start q_0)))
      (if (not qs_0)
        #f
        (let ((n_0 (node-next qs_0)))
          (begin
            (set-queue-start! q_0 n_0)
            (if n_0 (set-node-prev! n_0 #f) (set-queue-end! q_0 #f))
            (node-elem qs_0)))))))
(define queue-add!
  (lambda (q_0 w_0)
    (let ((e_0 (queue-end q_0)))
      (let ((n_0 (node2.1 w_0 e_0 #f)))
        (begin
          (if (not e_0) (set-queue-start! q_0 n_0) (set-node-next! e_0 n_0))
          (set-queue-end! q_0 n_0)
          n_0)))))
(define queue-remove-node!
  (lambda (q_0 n_0)
    (begin
      (if (node-prev n_0)
        (let ((app_0 (node-prev n_0))) (set-node-next! app_0 (node-next n_0)))
        (set-queue-start! q_0 (node-next n_0)))
      (if (node-next n_0)
        (let ((app_0 (node-next n_0))) (set-node-prev! app_0 (node-prev n_0)))
        (set-queue-end! q_0 (node-prev n_0))))))
(define finish_2335
  (make-struct-type-install-properties
   '(log-receiver)
   1
   0
   #f
   null
   (current-inspector)
   #f
   '(0)
   #f
   'log-receiver))
(define struct:log-receiver
  (make-record-type-descriptor
   'log-receiver
   #f
   (|#%nongenerative-uid| log-receiver)
   #f
   #f
   '(1 . 0)))
(define effect_2969 (finish_2335 struct:log-receiver))
(define log-receiver1.1
  (|#%name|
   log-receiver
   (record-constructor
    (make-record-constructor-descriptor struct:log-receiver #f #f))))
(define 1/log-receiver?_1856
  (|#%name| log-receiver? (record-predicate struct:log-receiver)))
(define 1/log-receiver?
  (|#%name|
   log-receiver?
   (lambda (v)
     (if (1/log-receiver?_1856 v)
       #t
       ($value
        (if (impersonator? v)
          (1/log-receiver?_1856 (impersonator-val v))
          #f))))))
(define log-receiver-filters_2874
  (|#%name| log-receiver-filters (record-accessor struct:log-receiver 0)))
(define log-receiver-filters
  (|#%name|
   log-receiver-filters
   (lambda (s)
     (if (1/log-receiver?_1856 s)
       (log-receiver-filters_2874 s)
       ($value
        (impersonate-ref
         log-receiver-filters_2874
         struct:log-receiver
         0
         s
         'filters))))))
(define-values
 (prop:receiver-send receiver-send? receiver-send-ref)
 (make-struct-type-property 'receiver-send))
(define finish_2386
  (make-struct-type-install-properties
   '(log-receiver)
   3
   0
   struct:log-receiver
   (let ((app_0
          (cons
           prop:evt
           (|#%app|
            poller
            (lambda (lr_0 ctx_0)
              (let ((msg_0 (queue-remove! (queue-log-receiver-msgs lr_0))))
                (if msg_0
                  (values (list msg_0) #f)
                  (let ((b_0 (box (|#%app| poll-ctx-select-proc ctx_0))))
                    (let ((n_0
                           (begin
                             (increment-receiever-waiters! lr_0)
                             (queue-add!
                              (queue-log-receiver-waiters lr_0)
                              b_0))))
                      (values
                       #f
                       (|#%app|
                        control-state-evt
                        async-evt
                        (lambda (e_0) (unbox b_0))
                        (lambda ()
                          (begin
                            (let ((app_0 (queue-log-receiver-waiters lr_0)))
                              (queue-remove-node! app_0 n_0))
                            (decrement-receiever-waiters! lr_0)))
                        void
                        (lambda ()
                          (let ((msg_1
                                 (queue-remove!
                                  (queue-log-receiver-msgs lr_0))))
                            (if msg_1
                              (begin (set-box! b_0 msg_1) (values msg_1 #t))
                              (begin
                                (increment-receiever-waiters! lr_0)
                                (set! n_0
                                  (queue-add!
                                   (queue-log-receiver-waiters lr_0)
                                   b_0))
                                (values #f #f))))))))))))))))
     (list
      app_0
      (cons
       prop:receiver-send
       (lambda (lr_0 msg_0)
         (let ((b_0 (queue-remove! (queue-log-receiver-waiters lr_0))))
           (if b_0
             (begin
               (decrement-receiever-waiters! lr_0)
               (let ((select!_0 (unbox b_0)))
                 (begin (set-box! b_0 msg_0) (|#%app| select!_0))))
             (queue-add! (queue-log-receiver-msgs lr_0) msg_0)))))))
   (current-inspector)
   #f
   '(0 1 2)
   #f
   'queue-log-receiver))
(define struct:queue-log-receiver
  (make-record-type-descriptor
   'log-receiver
   struct:log-receiver
   (|#%nongenerative-uid| log-receiver)
   #f
   #f
   '(3 . 0)))
(define effect_2324 (finish_2386 struct:queue-log-receiver))
(define queue-log-receiver2.1
  (|#%name|
   queue-log-receiver
   (record-constructor
    (make-record-constructor-descriptor struct:queue-log-receiver #f #f))))
(define queue-log-receiver?_2521
  (|#%name| log-receiver? (record-predicate struct:queue-log-receiver)))
(define queue-log-receiver?
  (|#%name|
   log-receiver?
   (lambda (v)
     (if (queue-log-receiver?_2521 v)
       #t
       ($value
        (if (impersonator? v)
          (queue-log-receiver?_2521 (impersonator-val v))
          #f))))))
(define queue-log-receiver-msgs_2408
  (|#%name| log-receiver-msgs (record-accessor struct:queue-log-receiver 0)))
(define queue-log-receiver-msgs
  (|#%name|
   log-receiver-msgs
   (lambda (s)
     (if (queue-log-receiver?_2521 s)
       (queue-log-receiver-msgs_2408 s)
       ($value
        (impersonate-ref
         queue-log-receiver-msgs_2408
         struct:queue-log-receiver
         0
         s
         'msgs))))))
(define queue-log-receiver-waiters_2361
  (|#%name|
   log-receiver-waiters
   (record-accessor struct:queue-log-receiver 1)))
(define queue-log-receiver-waiters
  (|#%name|
   log-receiver-waiters
   (lambda (s)
     (if (queue-log-receiver?_2521 s)
       (queue-log-receiver-waiters_2361 s)
       ($value
        (impersonate-ref
         queue-log-receiver-waiters_2361
         struct:queue-log-receiver
         1
         s
         'waiters))))))
(define queue-log-receiver-backref_2724
  (|#%name|
   log-receiver-backref
   (record-accessor struct:queue-log-receiver 2)))
(define queue-log-receiver-backref
  (|#%name|
   log-receiver-backref
   (lambda (s)
     (if (queue-log-receiver?_2521 s)
       (queue-log-receiver-backref_2724 s)
       ($value
        (impersonate-ref
         queue-log-receiver-backref_2724
         struct:queue-log-receiver
         2
         s
         'backref))))))
(define 1/make-log-receiver
  (|#%name|
   make-log-receiver
   (lambda (logger_0 level_0 . args_0)
     (begin
       (if (1/logger? logger_0)
         (void)
         (raise-argument-error 'make-log-receiver "logger?" logger_0))
       (let ((backref_0 (box #f)))
         (let ((lr_0
                (let ((app_0
                       (let ((temp9_0 (cons level_0 args_0)))
                         (parse-filters.1 'none 'make-log-receiver temp9_0))))
                  (let ((app_1 (make-queue)))
                    (queue-log-receiver2.1
                     app_0
                     app_1
                     (make-queue)
                     backref_0)))))
           (begin (add-log-receiver! logger_0 lr_0 backref_0) lr_0)))))))
(define decrement-receiever-waiters!
  (lambda (lr_0)
    (if (let ((q_0 (queue-log-receiver-waiters lr_0))) (not (queue-start q_0)))
      (set-box! (queue-log-receiver-backref lr_0) #f)
      (void))))
(define increment-receiever-waiters!
  (lambda (lr_0)
    (if (let ((q_0 (queue-log-receiver-waiters lr_0))) (not (queue-start q_0)))
      (set-box! (queue-log-receiver-backref lr_0) lr_0)
      (void))))
(define finish_2315
  (make-struct-type-install-properties
   '(stdio-log-receiver)
   2
   0
   struct:log-receiver
   (list
    (cons
     prop:receiver-send
     (lambda (lr_0 msg_0)
       (let ((rktio_0 (stdio-log-receiver-rktio lr_0)))
         (let ((fd_0
                (|#%app|
                 rktio_std_fd
                 rktio_0
                 (stdio-log-receiver-which lr_0))))
           (let ((bstr_0
                  (bytes-append
                   (1/string->bytes/utf-8 (vector-ref msg_0 1))
                   #vu8(10))))
             (let ((len_0 (unsafe-bytes-length bstr_0)))
               (begin
                 (letrec*
                  ((loop_0
                    (|#%name|
                     loop
                     (lambda (i_0)
                       (let ((v_0
                              (|#%app|
                               rktio_write_in
                               rktio_0
                               fd_0
                               bstr_0
                               i_0
                               len_0)))
                         (if (vector? v_0)
                           (void)
                           (let ((i_1 (+ i_0 v_0)))
                             (if (= i_1 len_0) (void) (loop_0 i_1)))))))))
                  (loop_0 0))
                 (|#%app| rktio_forget rktio_0 fd_0)))))))))
   (current-inspector)
   #f
   '(0 1)
   #f
   'stdio-log-receiver))
(define struct:stdio-log-receiver
  (make-record-type-descriptor
   'stdio-log-receiver
   struct:log-receiver
   (|#%nongenerative-uid| stdio-log-receiver)
   #f
   #f
   '(2 . 0)))
(define effect_2591 (finish_2315 struct:stdio-log-receiver))
(define stdio-log-receiver3.1
  (|#%name|
   stdio-log-receiver
   (record-constructor
    (make-record-constructor-descriptor struct:stdio-log-receiver #f #f))))
(define stdio-log-receiver?_2188
  (|#%name| stdio-log-receiver? (record-predicate struct:stdio-log-receiver)))
(define stdio-log-receiver?
  (|#%name|
   stdio-log-receiver?
   (lambda (v)
     (if (stdio-log-receiver?_2188 v)
       #t
       ($value
        (if (impersonator? v)
          (stdio-log-receiver?_2188 (impersonator-val v))
          #f))))))
(define stdio-log-receiver-rktio_1849
  (|#%name|
   stdio-log-receiver-rktio
   (record-accessor struct:stdio-log-receiver 0)))
(define stdio-log-receiver-rktio
  (|#%name|
   stdio-log-receiver-rktio
   (lambda (s)
     (if (stdio-log-receiver?_2188 s)
       (stdio-log-receiver-rktio_1849 s)
       ($value
        (impersonate-ref
         stdio-log-receiver-rktio_1849
         struct:stdio-log-receiver
         0
         s
         'rktio))))))
(define stdio-log-receiver-which_2480
  (|#%name|
   stdio-log-receiver-which
   (record-accessor struct:stdio-log-receiver 1)))
(define stdio-log-receiver-which
  (|#%name|
   stdio-log-receiver-which
   (lambda (s)
     (if (stdio-log-receiver?_2188 s)
       (stdio-log-receiver-which_2480 s)
       ($value
        (impersonate-ref
         stdio-log-receiver-which_2480
         struct:stdio-log-receiver
         1
         s
         'which))))))
(define add-stdio-log-receiver!
  (lambda (who_0 logger_0 args_0 parse-who_0 which_0)
    (begin
      (if (1/logger? logger_0)
        (void)
        (raise-argument-error who_0 "logger?" logger_0))
      (let ((lr_0
             (let ((app_0 (parse-filters.1 'none parse-who_0 args_0)))
               (stdio-log-receiver3.1
                app_0
                (unsafe-place-local-ref cell.1)
                which_0))))
        (begin
          (unsafe-start-atomic)
          (begin0
            (begin
              (add-log-receiver! logger_0 lr_0 #f)
              (set-logger-permanent-receivers!
               logger_0
               (cons lr_0 (logger-permanent-receivers logger_0))))
            (unsafe-end-atomic)))))))
(define add-stderr-log-receiver!
  (lambda (logger_0 . args_0)
    (add-stdio-log-receiver!
     'add-stderr-log-receiver!
     logger_0
     args_0
     'make-stderr-log-receiver
     2)))
(define add-stdout-log-receiver!
  (lambda (logger_0 . args_0)
    (add-stdio-log-receiver!
     'add-stdout-log-receiver!
     logger_0
     args_0
     'make-stdio-log-receiver
     1)))
(define finish_2533
  (make-struct-type-install-properties
   '(syslog-log-receiver)
   2
   0
   struct:log-receiver
   (list
    (cons
     prop:receiver-send
     (lambda (lr_0 msg_0)
       (let ((rktio_0 (syslog-log-receiver-rktio lr_0)))
         (let ((bstr_0
                (bytes-append
                 (1/string->bytes/utf-8 (vector-ref msg_0 1))
                 #vu8(10))))
           (let ((pri_0
                  (let ((tmp_0 (vector-ref msg_0 0)))
                    (if (eq? tmp_0 'fatal)
                      1
                      (if (eq? tmp_0 'error)
                        2
                        (if (eq? tmp_0 'warning)
                          3
                          (if (eq? tmp_0 'info) 4 5)))))))
             (|#%app|
              rktio_syslog
              rktio_0
              pri_0
              #f
              bstr_0
              (syslog-log-receiver-cmd lr_0))))))))
   (current-inspector)
   #f
   '(0 1)
   #f
   'syslog-log-receiver))
(define struct:syslog-log-receiver
  (make-record-type-descriptor
   'syslog-log-receiver
   struct:log-receiver
   (|#%nongenerative-uid| syslog-log-receiver)
   #f
   #f
   '(2 . 0)))
(define effect_2288 (finish_2533 struct:syslog-log-receiver))
(define syslog-log-receiver4.1
  (|#%name|
   syslog-log-receiver
   (record-constructor
    (make-record-constructor-descriptor struct:syslog-log-receiver #f #f))))
(define syslog-log-receiver?_2295
  (|#%name|
   syslog-log-receiver?
   (record-predicate struct:syslog-log-receiver)))
(define syslog-log-receiver?
  (|#%name|
   syslog-log-receiver?
   (lambda (v)
     (if (syslog-log-receiver?_2295 v)
       #t
       ($value
        (if (impersonator? v)
          (syslog-log-receiver?_2295 (impersonator-val v))
          #f))))))
(define syslog-log-receiver-rktio_2512
  (|#%name|
   syslog-log-receiver-rktio
   (record-accessor struct:syslog-log-receiver 0)))
(define syslog-log-receiver-rktio
  (|#%name|
   syslog-log-receiver-rktio
   (lambda (s)
     (if (syslog-log-receiver?_2295 s)
       (syslog-log-receiver-rktio_2512 s)
       ($value
        (impersonate-ref
         syslog-log-receiver-rktio_2512
         struct:syslog-log-receiver
         0
         s
         'rktio))))))
(define syslog-log-receiver-cmd_2652
  (|#%name|
   syslog-log-receiver-cmd
   (record-accessor struct:syslog-log-receiver 1)))
(define syslog-log-receiver-cmd
  (|#%name|
   syslog-log-receiver-cmd
   (lambda (s)
     (if (syslog-log-receiver?_2295 s)
       (syslog-log-receiver-cmd_2652 s)
       ($value
        (impersonate-ref
         syslog-log-receiver-cmd_2652
         struct:syslog-log-receiver
         1
         s
         'cmd))))))
(define add-syslog-log-receiver!
  (lambda (logger_0 . args_0)
    (let ((lr_0
           (let ((app_0
                  (parse-filters.1 'none 'make-syslog-log-receiver args_0)))
             (let ((app_1 (unsafe-place-local-ref cell.1)))
               (syslog-log-receiver4.1
                app_0
                app_1
                (path-bytes (1/find-system-path 'run-file)))))))
      (begin
        (unsafe-start-atomic)
        (begin0
          (begin
            (add-log-receiver! logger_0 lr_0 #f)
            (set-logger-permanent-receivers!
             logger_0
             (cons lr_0 (logger-permanent-receivers logger_0))))
          (unsafe-end-atomic))))))
(define add-log-receiver!
  (lambda (logger_0 lr_0 backref_0)
    (begin
      (|#%app| start-atomic/no-interrupts)
      (begin0
        (begin
          (if (zero? (logger-prune-counter logger_0))
            (begin
              (set-logger-receiver-box+backrefs!
               logger_0
               (let ((app_0 (cons (make-weak-box lr_0) backref_0)))
                 (cons
                  app_0
                  (1/reverse
                   (let ((lst_0 (logger-receiver-box+backrefs logger_0)))
                     (letrec*
                      ((for-loop_0
                        (|#%name|
                         for-loop
                         (lambda (fold-var_0 lst_1)
                           (if (pair? lst_1)
                             (let ((b+r_0 (unsafe-car lst_1)))
                               (let ((rest_0 (unsafe-cdr lst_1)))
                                 (let ((fold-var_1
                                        (if (weak-box-value (car b+r_0))
                                          (let ((fold-var_1
                                                 (cons b+r_0 fold-var_0)))
                                            (values fold-var_1))
                                          fold-var_0)))
                                   (for-loop_0 fold-var_1 rest_0))))
                             fold-var_0)))))
                      (for-loop_0 null lst_0)))))))
              (set-logger-prune-counter!
               logger_0
               (max 8 (length (logger-receiver-box+backrefs logger_0)))))
            (begin
              (set-logger-receiver-box+backrefs!
               logger_0
               (let ((app_0 (cons (make-weak-box lr_0) backref_0)))
                 (cons app_0 (logger-receiver-box+backrefs logger_0))))
              (set-logger-prune-counter!
               logger_0
               (sub1 (logger-prune-counter logger_0)))))
          (let ((ts-box_0 (logger-root-level-timestamp-box logger_0)))
            (begin
              (set-box! ts-box_0 (add1 (unbox ts-box_0)))
              (let ((sema-box_0 (logger-level-sema-box logger_0)))
                (if (unbox sema-box_0)
                  (begin
                    (semaphore-post (unbox sema-box_0))
                    (set-box! sema-box_0 #f))
                  (void))))))
        (|#%app| end-atomic/no-interrupts)))))
(define log-receiver-send!
  (lambda (r_0 msg_0 in-interrupt?_0)
    (if (let ((or-part_0 (not in-interrupt?_0)))
          (if or-part_0 or-part_0 (stdio-log-receiver? r_0)))
      (|#%app| (receiver-send-ref r_0) r_0 msg_0)
      (|#%app|
       unsafe-add-pre-poll-callback!
       (lambda () (|#%app| (receiver-send-ref r_0) r_0 msg_0))))))
(define receiver-add-topics
  (lambda (r_0 topics_0 default-level_0)
    (letrec*
     ((loop_0
       (|#%name|
        loop
        (lambda (filters_0 topics_1)
          (if (pair? filters_0)
            (let ((app_0 (cdr filters_0)))
              (loop_0 app_0 (hash-set topics_1 (caar filters_0) #t)))
            (values topics_1 (level-max default-level_0 filters_0)))))))
     (loop_0 (log-receiver-filters r_0) topics_0))))
(define logger-wanted-level
  (lambda (logger_0 topic_0)
    (if (not topic_0)
      (logger-max-wanted-level logger_0)
      (if (let ((app_0 (logger-local-level-timestamp logger_0)))
            (>= app_0 (unbox (logger-root-level-timestamp-box logger_0))))
        (let ((cache_0 (logger-topic-level-cache logger_0)))
          (let ((or-part_0
                 (let ((end_0 (vector-length cache_0)))
                   (letrec*
                    ((for-loop_0
                      (|#%name|
                       for-loop
                       (lambda (result_0 pos_0)
                         (if (< pos_0 end_0)
                           (let ((result_1
                                  (let ((result_1
                                         (if (eq?
                                              (vector-ref cache_0 pos_0)
                                              topic_0)
                                           (vector-ref cache_0 (add1 pos_0))
                                           #f)))
                                    (values result_1))))
                             (if (if (not (let ((x_0 (list pos_0))) result_1))
                                   #t
                                   #f)
                               (for-loop_0 result_1 (+ pos_0 2))
                               result_1))
                           result_0)))))
                    (for-loop_0 #f 0)))))
            (if or-part_0
              or-part_0
              (begin
                (update-logger-wanted-level! logger_0 topic_0)
                (logger-wanted-level logger_0 topic_0)))))
        (begin
          (update-logger-wanted-level! logger_0 topic_0)
          (logger-wanted-level logger_0 topic_0))))))
(define logger-max-wanted-level
  (lambda (logger_0)
    (begin
      (|#%app| start-atomic/no-interrupts)
      (begin0
        (logger-max-wanted-level* logger_0)
        (|#%app| end-atomic/no-interrupts)))))
(define logger-max-wanted-level*
  (lambda (logger_0)
    (if (let ((app_0 (logger-local-level-timestamp logger_0)))
          (>= app_0 (unbox (logger-root-level-timestamp-box logger_0))))
      (logger-max-receiver-level logger_0)
      (begin
        (update-logger-wanted-level! logger_0 #f)
        (logger-max-receiver-level logger_0)))))
(define update-logger-wanted-level!
  (lambda (logger_0 topic_0)
    (begin
      (if (let ((app_0 (logger-local-level-timestamp logger_0)))
            (>= app_0 (unbox (logger-root-level-timestamp-box logger_0))))
        (void)
        (let ((cache_0 (logger-topic-level-cache logger_0)))
          (begin
            (let ((end_0 (vector-length cache_0)))
              (letrec*
               ((for-loop_0
                 (|#%name|
                  for-loop
                  (lambda (pos_0)
                    (if (< pos_0 end_0)
                      (begin
                        (vector-set! cache_0 pos_0 #f)
                        (for-loop_0 (+ pos_0 2)))
                      (values))))))
               (for-loop_0 0)))
            (void)
            (set-logger-local-level-timestamp!
             logger_0
             (unbox (logger-root-level-timestamp-box logger_0))))))
      (letrec*
       ((loop_0
         (|#%name|
          loop
          (lambda (parent_0
                   ceiling-level_0
                   old-max-level_0
                   topic-ceiling-level_0
                   old-topic-max-level_0)
            (call-with-values
             (lambda ()
               (let ((lst_0 (logger-receivers parent_0)))
                 (letrec*
                  ((for-loop_0
                    (|#%name|
                     for-loop
                     (lambda (max-level_0 topic-max-level_0 lst_1)
                       (if (pair? lst_1)
                         (let ((r_0 (unsafe-car lst_1)))
                           (let ((rest_0 (unsafe-cdr lst_1)))
                             (let ((next-k-proc_0
                                    (|#%name|
                                     next-k-proc
                                     (lambda (max-level_1 topic-max-level_1)
                                       (for-loop_0
                                        max-level_1
                                        topic-max-level_1
                                        rest_0)))))
                               (if (if (let ((app_0
                                              (level->value max-level_0)))
                                         (>=
                                          app_0
                                          (level->value ceiling-level_0)))
                                     (let ((or-part_0 (not topic_0)))
                                       (if or-part_0
                                         or-part_0
                                         (let ((app_0
                                                (level->value
                                                 topic-max-level_0)))
                                           (>=
                                            app_0
                                            (level->value ceiling-level_0)))))
                                     #f)
                                 (values max-level_0 topic-max-level_0)
                                 (call-with-values
                                  (lambda ()
                                    (let ((app_0
                                           (level-max
                                            max-level_0
                                            (level-min
                                             (filters-max-level
                                              (log-receiver-filters r_0))
                                             ceiling-level_0))))
                                      (values
                                       app_0
                                       (if topic_0
                                         (level-max
                                          topic-max-level_0
                                          (level-min
                                           (filters-level-for-topic
                                            (log-receiver-filters r_0)
                                            topic_0)
                                           topic-ceiling-level_0))
                                         #f))))
                                  (lambda (max-level_1 topic-max-level_1)
                                    (for-loop_0
                                     max-level_1
                                     topic-max-level_1
                                     rest_0)))))))
                         (values max-level_0 topic-max-level_0))))))
                  (for-loop_0 old-max-level_0 old-topic-max-level_0 lst_0))))
             (lambda (max-level_0 topic-max-level_0)
               (let ((c1_0
                      (if (let ((or-part_0
                                 (let ((app_0 (level->value ceiling-level_0)))
                                   (>= app_0 (level->value max-level_0)))))
                            (if or-part_0
                              or-part_0
                              (if topic_0
                                (let ((app_0 (level->value ceiling-level_0)))
                                  (>= app_0 (level->value topic-max-level_0)))
                                #f)))
                        (logger-parent parent_0)
                        #f)))
                 (if c1_0
                   (let ((filters_0 (logger-propagate-filters parent_0)))
                     (let ((ceiling-level_1
                            (level-min
                             ceiling-level_0
                             (filters-max-level filters_0))))
                       (let ((topic-ceiling-level_1
                              (if topic_0
                                (level-min
                                 topic-ceiling-level_0
                                 (filters-level-for-topic filters_0 topic_0))
                                topic-ceiling-level_0)))
                         (let ((ceiling-level_2 ceiling-level_1))
                           (loop_0
                            c1_0
                            ceiling-level_2
                            max-level_0
                            topic-ceiling-level_1
                            topic-max-level_0)))))
                   (begin
                     (set-logger-max-receiver-level! logger_0 max-level_0)
                     (if topic_0
                       (let ((cache_0 (logger-topic-level-cache logger_0)))
                         (let ((or-part_0
                                (let ((end_0 (vector-length cache_0)))
                                  (letrec*
                                   ((for-loop_0
                                     (|#%name|
                                      for-loop
                                      (lambda (result_0 pos_0)
                                        (if (< pos_0 end_0)
                                          (let ((result_1
                                                 (let ((result_1
                                                        (if (not
                                                             (vector-ref
                                                              cache_0
                                                              pos_0))
                                                          (if (begin
                                                                (vector-set!
                                                                 cache_0
                                                                 pos_0
                                                                 topic_0)
                                                                (vector-set!
                                                                 cache_0
                                                                 (add1 pos_0)
                                                                 topic-max-level_0))
                                                            #t
                                                            #f)
                                                          #f)))
                                                   (values result_1))))
                                            (if (if (not
                                                     (let ((x_0 (list pos_0)))
                                                       result_1))
                                                  #t
                                                  #f)
                                              (for-loop_0 result_1 (+ pos_0 2))
                                              result_1))
                                          result_0)))))
                                   (for-loop_0 #f 0)))))
                           (if or-part_0
                             or-part_0
                             (begin
                               (begin
                                 (let ((end_0 (- (vector-length cache_0) 2)))
                                   (letrec*
                                    ((for-loop_0
                                      (|#%name|
                                       for-loop
                                       (lambda (pos_0)
                                         (if (< pos_0 end_0)
                                           (begin
                                             (begin
                                               (let ((app_0 (+ pos_0 2)))
                                                 (vector-set!
                                                  cache_0
                                                  app_0
                                                  (vector-ref cache_0 pos_0)))
                                               (let ((app_0 (+ pos_0 3)))
                                                 (vector-set!
                                                  cache_0
                                                  app_0
                                                  (vector-ref
                                                   cache_0
                                                   (+ pos_0 1)))))
                                             (for-loop_0 (+ pos_0 2)))
                                           (values))))))
                                    (for-loop_0 0)))
                                 (void))
                               (vector-set! cache_0 0 topic_0)
                               (vector-set! cache_0 1 topic-max-level_0)))))
                       (void)))))))))))
       (loop_0 logger_0 'debug 'none 'debug 'none)))))
(define logger-all-levels
  (lambda (logger_0)
    (call-with-values
     (lambda ()
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda (topics_0 default-level_0 max-default-level_0 logger_1)
             (call-with-values
              (lambda ()
                (let ((lst_0 (logger-receivers logger_1)))
                  (letrec*
                   ((for-loop_0
                     (|#%name|
                      for-loop
                      (lambda (topics_1 default-level_1 lst_1)
                        (if (pair? lst_1)
                          (let ((r_0 (unsafe-car lst_1)))
                            (let ((rest_0 (unsafe-cdr lst_1)))
                              (call-with-values
                               (lambda ()
                                 (call-with-values
                                  (lambda ()
                                    (receiver-add-topics
                                     r_0
                                     topics_1
                                     default-level_1))
                                  (lambda (topics_2 default-level_2)
                                    (values topics_2 default-level_2))))
                               (lambda (topics_2 default-level_2)
                                 (for-loop_0
                                  topics_2
                                  default-level_2
                                  rest_0)))))
                          (values topics_1 default-level_1))))))
                   (for-loop_0 topics_0 'none lst_0))))
              (lambda (new-topics_0 new-default-level_0)
                (let ((next-default-level_0
                       (level-max
                        (level-min new-default-level_0 max-default-level_0)
                        default-level_0)))
                  (let ((parent-logger_0 (logger-parent logger_1)))
                    (if parent-logger_0
                      (let ((max-default-level_1
                             (level-min
                              max-default-level_0
                              (filters-level-for-topic
                               (logger-propagate-filters logger_1)
                               #f))))
                        (loop_0
                         new-topics_0
                         next-default-level_0
                         max-default-level_1
                         parent-logger_0))
                      (values new-topics_0 next-default-level_0))))))))))
        (loop_0 hash2610 'none 'debug logger_0)))
     (lambda (topics_0 default-level_0)
       (let ((app_0 (level->user-representation default-level_0)))
         (list*
          app_0
          #f
          (apply
           append
           (1/reverse
            (letrec*
             ((for-loop_0
               (|#%name|
                for-loop
                (lambda (fold-var_0 i_0)
                  (if i_0
                    (let ((topic_0 (hash-iterate-key topics_0 i_0)))
                      (let ((fold-var_1
                             (let ((fold-var_1
                                    (cons
                                     (list
                                      (level->user-representation
                                       (begin
                                         (|#%app| start-atomic/no-interrupts)
                                         (begin0
                                           (logger-wanted-level
                                            logger_0
                                            topic_0)
                                           (|#%app|
                                            end-atomic/no-interrupts))))
                                      topic_0)
                                     fold-var_0)))
                               (values fold-var_1))))
                        (for-loop_0
                         fold-var_1
                         (hash-iterate-next topics_0 i_0))))
                    fold-var_0)))))
             (for-loop_0 null (hash-iterate-first topics_0)))))))))))
(define make-root-logger (lambda () (create-logger.1 #f 'none #f)))
(define cell.1$6 (unsafe-make-place-local (make-root-logger)))
(define unsafe-root-logger (lambda () (unsafe-place-local-ref cell.1$6)))
(define 1/current-logger
  (make-parameter
   (unsafe-place-local-ref cell.1$6)
   (lambda (l_0)
     (begin
       (if (1/logger? l_0)
         (void)
         (raise-argument-error 'current-logger "logger?" l_0))
       l_0))
   'current-logger))
(define logger-init!
  (lambda ()
    (begin
      (unsafe-place-local-set! cell.1$6 (make-root-logger))
      (1/current-logger (unsafe-place-local-ref cell.1$6)))))
(define 1/make-logger
  (let ((make-logger_0
         (|#%name|
          make-logger
          (lambda (topic1_0 parent2_0 new-rest_0)
            (begin
              (if (let ((or-part_0 (not topic1_0)))
                    (if or-part_0 or-part_0 (symbol? topic1_0)))
                (void)
                (raise-argument-error
                 'make-logger
                 "(or/c symbol? #f)"
                 topic1_0))
              (if (let ((or-part_0 (not parent2_0)))
                    (if or-part_0 or-part_0 (1/logger? parent2_0)))
                (void)
                (raise-argument-error
                 'make-logger
                 "(or/c logger? #f)"
                 parent2_0))
              (let ((temp13_0
                     (parse-filters.1 'debug 'make-logger new-rest_0)))
                (create-logger.1 parent2_0 temp13_0 topic1_0)))))))
    (|#%name|
     make-logger
     (case-lambda
      (() (make-logger_0 #f #f null))
      ((topic_0 parent2_0 . filters_0)
       (make-logger_0 topic_0 parent2_0 filters_0))
      ((topic1_0) (make-logger_0 topic1_0 #f null))))))
(define 1/log-level?
  (let ((log-level?_0
         (|#%name|
          log-level?
          (lambda (logger4_0 level5_0 topic3_0)
            (begin
              (if (1/logger? logger4_0)
                (void)
                (raise-argument-error 'log-level? "logger?" logger4_0))
              (check-level 'log-level? level5_0)
              (if (let ((or-part_0 (not topic3_0)))
                    (if or-part_0 or-part_0 (symbol? topic3_0)))
                (void)
                (raise-argument-error
                 'log-level?
                 "(or/c #f symbol?)"
                 topic3_0))
              (if (not (eq? level5_0 'none))
                (begin
                  (|#%app| start-atomic/no-interrupts)
                  (begin0
                    (log-level?* logger4_0 level5_0 topic3_0)
                    (|#%app| end-atomic/no-interrupts)))
                #f))))))
    (|#%name|
     log-level?
     (case-lambda
      ((logger_0 level_0) (log-level?_0 logger_0 level_0 #f))
      ((logger_0 level_0 topic3_0)
       (log-level?_0 logger_0 level_0 topic3_0))))))
(define logging-future-events?
  (lambda ()
    (begin
      (|#%app| start-atomic/no-interrupts)
      (begin0
        (log-level?* (unsafe-place-local-ref cell.1$6) 'debug 'future)
        (|#%app| end-atomic/no-interrupts)))))
(define logging-place-events?
  (lambda ()
    (begin
      (|#%app| start-atomic/no-interrupts)
      (begin0
        (log-level?* (unsafe-place-local-ref cell.1$6) 'debug 'place)
        (|#%app| end-atomic/no-interrupts)))))
(define log-level?*
  (lambda (logger_0 level_0 topic_0)
    (let ((a_0 (logger-wanted-level logger_0 topic_0)))
      (let ((app_0 (level->value a_0))) (>= app_0 (level->value level_0))))))
(define 1/log-max-level
  (let ((log-max-level_0
         (|#%name|
          log-max-level
          (lambda (logger7_0 topic6_0)
            (begin
              (if (1/logger? logger7_0)
                (void)
                (raise-argument-error 'log-max-level "logger?" logger7_0))
              (if (let ((or-part_0 (not topic6_0)))
                    (if or-part_0 or-part_0 (symbol? topic6_0)))
                (void)
                (raise-argument-error
                 'log-max-level
                 "(or/c #f symbol?)"
                 topic6_0))
              (level->user-representation
               (begin
                 (|#%app| start-atomic/no-interrupts)
                 (begin0
                   (logger-wanted-level logger7_0 topic6_0)
                   (|#%app| end-atomic/no-interrupts)))))))))
    (|#%name|
     log-max-level
     (case-lambda
      ((logger_0) (log-max-level_0 logger_0 #f))
      ((logger_0 topic6_0) (log-max-level_0 logger_0 topic6_0))))))
(define 1/log-all-levels
  (|#%name|
   log-all-levels
   (lambda (logger_0)
     (begin
       (if (1/logger? logger_0)
         (void)
         (raise-argument-error 'log-all-levels "logger?" logger_0))
       (logger-all-levels logger_0)))))
(define 1/log-level-evt
  (|#%name|
   log-level-evt
   (lambda (logger_0)
     (begin
       (if (1/logger? logger_0)
         (void)
         (raise-argument-error 'log-level-evt "logger?" logger_0))
       (let ((s_0
              (begin
                (unsafe-start-atomic)
                (begin0
                  (let ((c1_0 (unbox (logger-level-sema-box logger_0))))
                    (if c1_0
                      c1_0
                      (let ((s_0 (make-semaphore)))
                        (begin
                          (set-box! (logger-level-sema-box logger_0) s_0)
                          s_0))))
                  (unsafe-end-atomic)))))
         (semaphore-peek-evt s_0))))))
(define 1/log-message
  (|#%name|
   log-message
   (case-lambda
    ((logger_0 level_0 message_0)
     (let ((topic_0 (if (1/logger? logger_0) (1/logger-name logger_0) #f)))
       (do-log-message 'log-message logger_0 level_0 topic_0 message_0 #f #t)))
    ((logger_0 level_0 topic/message_0 message/data_0)
     (if (string? topic/message_0)
       (let ((topic_0 (if (1/logger? logger_0) (1/logger-name logger_0) #f)))
         (do-log-message
          'log-message
          logger_0
          level_0
          topic_0
          topic/message_0
          message/data_0
          #t))
       (if (let ((or-part_0 (not topic/message_0)))
             (if or-part_0 or-part_0 (symbol? topic/message_0)))
         (do-log-message
          'log-message
          logger_0
          level_0
          topic/message_0
          message/data_0
          #f
          #t)
         (begin
           (if (1/logger? logger_0)
             (void)
             (raise-argument-error 'log-message "logger?" logger_0))
           (check-level 'log-message level_0)
           (raise-argument-error
            'log-message
            "(or/c string? symbol?)"
            topic/message_0)))))
    ((logger_0 level_0 topic/message_0 message/data_0 data/prefix?_0)
     (if (string? topic/message_0)
       (let ((topic_0 (if (1/logger? logger_0) (1/logger-name logger_0) #f)))
         (do-log-message
          'log-message
          logger_0
          level_0
          topic_0
          topic/message_0
          message/data_0
          data/prefix?_0))
       (if (let ((or-part_0 (not topic/message_0)))
             (if or-part_0 or-part_0 (symbol? topic/message_0)))
         (do-log-message
          'log-message
          logger_0
          level_0
          topic/message_0
          message/data_0
          data/prefix?_0
          #t)
         (begin
           (if (1/logger? logger_0)
             (void)
             (raise-argument-error 'log-message "logger?" logger_0))
           (check-level 'log-message level_0)
           (raise-argument-error
            'log-message
            "(or/c string? symbol?)"
            topic/message_0)))))
    ((logger_0 level_0 topic_0 message_0 data_0 prefix?_0)
     (do-log-message
      'log-message
      logger_0
      level_0
      topic_0
      message_0
      data_0
      prefix?_0)))))
(define do-log-message
  (lambda (who_0 logger_0 level_0 topic_0 message_0 data_0 prefix?_0)
    (begin
      (if (1/logger? logger_0)
        (void)
        (raise-argument-error who_0 "logger?" logger_0))
      (check-level who_0 level_0)
      (if (let ((or-part_0 (not topic_0)))
            (if or-part_0 or-part_0 (symbol? topic_0)))
        (void)
        (raise-argument-error who_0 "(or/c #f symbol?)" topic_0))
      (if (string? message_0)
        (void)
        (raise-argument-error who_0 "string?" message_0))
      (if (eq? level_0 'none)
        (void)
        (begin
          (|#%app| start-atomic/no-interrupts)
          (begin0
            (log-message*
             logger_0
             level_0
             topic_0
             message_0
             data_0
             prefix?_0
             #f)
            (|#%app| end-atomic/no-interrupts)))))))
(define log-future-event
  (lambda (message_0 data_0)
    (begin
      (|#%app| start-atomic/no-interrupts)
      (begin0
        (log-message*
         (unsafe-place-local-ref cell.1$6)
         'debug
         'future
         message_0
         data_0
         #t
         #f)
        (|#%app| end-atomic/no-interrupts)))))
(define log-place-event
  (lambda (message_0 data_0)
    (begin
      (|#%app| start-atomic/no-interrupts)
      (begin0
        (log-message*
         (unsafe-place-local-ref cell.1$6)
         'debug
         'place
         message_0
         data_0
         #t
         #f)
        (|#%app| end-atomic/no-interrupts)))))
(define log-message*
  (lambda (logger_0 level_0 topic_0 message_0 data_0 prefix?_0 in-interrupt?_0)
    (let ((msg_0 #f))
      (if (let ((a_0 (logger-max-wanted-level* logger_0)))
            (let ((app_0 (level->value a_0)))
              (>= app_0 (level->value level_0))))
        (letrec*
         ((loop_0
           (|#%name|
            loop
            (lambda (logger_1)
              (begin
                (let ((lst_0 (logger-receivers logger_1)))
                  (letrec*
                   ((for-loop_0
                     (|#%name|
                      for-loop
                      (lambda (lst_1)
                        (if (pair? lst_1)
                          (let ((r_0 (unsafe-car lst_1)))
                            (let ((rest_0 (unsafe-cdr lst_1)))
                              (begin
                                (if (let ((a_0
                                           (filters-level-for-topic
                                            (log-receiver-filters r_0)
                                            topic_0)))
                                      (let ((app_0 (level->value a_0)))
                                        (>= app_0 (level->value level_0))))
                                  (begin
                                    (if msg_0
                                      (void)
                                      (set! msg_0
                                        (vector-immutable
                                         level_0
                                         (string->immutable-string
                                          (if (if prefix?_0 topic_0 #f)
                                            (string-append
                                             (symbol->string topic_0)
                                             ": "
                                             message_0)
                                            message_0))
                                         data_0
                                         topic_0)))
                                    (log-receiver-send!
                                     r_0
                                     msg_0
                                     in-interrupt?_0))
                                  (void))
                                (for-loop_0 rest_0))))
                          (values))))))
                   (for-loop_0 lst_0)))
                (void)
                (let ((parent_0 (logger-parent logger_1)))
                  (if (if parent_0
                        (let ((a_0
                               (filters-level-for-topic
                                (logger-propagate-filters logger_1)
                                topic_0)))
                          (let ((app_0 (level->value a_0)))
                            (>= app_0 (level->value level_0))))
                        #f)
                    (loop_0 parent_0)
                    (void))))))))
         (loop_0 logger_0))
        (void)))))
(define finish_2799
  (make-struct-type-install-properties
   '(filesystem-change-evt)
   2
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (fc_0 ctx_0)
        (let ((rfc_0 (fs-change-evt-rfc fc_0)))
          (if (not rfc_0)
            (values (list fc_0) #f)
            (if (eqv?
                 (|#%app|
                  rktio_poll_fs_change_ready
                  (unsafe-place-local-ref cell.1)
                  rfc_0)
                 1)
              (values (list fc_0) #f)
              (begin
                (sandman-poll-ctx-add-poll-set-adder!
                 ctx_0
                 (lambda (ps_0)
                   (|#%app|
                    rktio_poll_add_fs_change
                    (unsafe-place-local-ref cell.1)
                    rfc_0
                    ps_0)))
                (values #f fc_0)))))))))
   (current-inspector)
   #f
   '()
   #f
   'fs-change-evt))
(define struct:fs-change-evt
  (make-record-type-descriptor
   'filesystem-change-evt
   #f
   (|#%nongenerative-uid| filesystem-change-evt)
   #f
   #f
   '(2 . 3)))
(define effect_3368 (finish_2799 struct:fs-change-evt))
(define fs-change-evt1.1
  (|#%name|
   fs-change-evt
   (record-constructor
    (make-record-constructor-descriptor struct:fs-change-evt #f #f))))
(define fs-change-evt?_2560
  (|#%name| filesystem-change-evt? (record-predicate struct:fs-change-evt)))
(define fs-change-evt?
  (|#%name|
   filesystem-change-evt?
   (lambda (v)
     (if (fs-change-evt?_2560 v)
       #t
       ($value
        (if (impersonator? v)
          (fs-change-evt?_2560 (impersonator-val v))
          #f))))))
(define fs-change-evt-rfc_2934
  (|#%name|
   filesystem-change-evt-rfc
   (record-accessor struct:fs-change-evt 0)))
(define fs-change-evt-rfc
  (|#%name|
   filesystem-change-evt-rfc
   (lambda (s)
     (if (fs-change-evt?_2560 s)
       (fs-change-evt-rfc_2934 s)
       ($value
        (impersonate-ref
         fs-change-evt-rfc_2934
         struct:fs-change-evt
         0
         s
         'rfc))))))
(define fs-change-evt-cust-ref_2823
  (|#%name|
   filesystem-change-evt-cust-ref
   (record-accessor struct:fs-change-evt 1)))
(define fs-change-evt-cust-ref
  (|#%name|
   filesystem-change-evt-cust-ref
   (lambda (s)
     (if (fs-change-evt?_2560 s)
       (fs-change-evt-cust-ref_2823 s)
       ($value
        (impersonate-ref
         fs-change-evt-cust-ref_2823
         struct:fs-change-evt
         1
         s
         'cust-ref))))))
(define set-fs-change-evt-rfc!_3343
  (|#%name|
   set-filesystem-change-evt-rfc!
   (record-mutator struct:fs-change-evt 0)))
(define set-fs-change-evt-rfc!
  (|#%name|
   set-filesystem-change-evt-rfc!
   (lambda (s v)
     (if (fs-change-evt?_2560 s)
       (set-fs-change-evt-rfc!_3343 s v)
       ($value
        (impersonate-set!
         set-fs-change-evt-rfc!_3343
         struct:fs-change-evt
         0
         0
         s
         v
         'rfc))))))
(define set-fs-change-evt-cust-ref!_2399
  (|#%name|
   set-filesystem-change-evt-cust-ref!
   (record-mutator struct:fs-change-evt 1)))
(define set-fs-change-evt-cust-ref!
  (|#%name|
   set-filesystem-change-evt-cust-ref!
   (lambda (s v)
     (if (fs-change-evt?_2560 s)
       (set-fs-change-evt-cust-ref!_2399 s v)
       ($value
        (impersonate-set!
         set-fs-change-evt-cust-ref!_2399
         struct:fs-change-evt
         1
         1
         s
         v
         'cust-ref))))))
(define 1/filesystem-change-evt?
  (|#%name| filesystem-change-evt? (lambda (v_0) (fs-change-evt? v_0))))
(define 1/filesystem-change-evt
  (let ((filesystem-change-evt_0
         (|#%name|
          filesystem-change-evt
          (lambda (p3_0 fail2_0)
            (begin
              (if (path-string? p3_0)
                (void)
                (raise-argument-error
                 'filesystem-change-evt
                 "path-string?"
                 p3_0))
              (begin
                (if (let ((or-part_0 (not fail2_0)))
                      (if or-part_0
                        or-part_0
                        (if (procedure? fail2_0)
                          (procedure-arity-includes? fail2_0 0)
                          #f)))
                  (void)
                  (raise-argument-error
                   'filesystem-change-evt
                   "(or/c (procedure-arity-includes/c 0) #f)"
                   fail2_0))
                (let ((fn_0 (->host p3_0 'filesystem-change-evt '(exists))))
                  (begin
                    (unsafe-start-atomic)
                    (let ((file-rfc_0
                           (|#%app|
                            rktio_fs_change
                            (unsafe-place-local-ref cell.1)
                            fn_0
                            (unsafe-place-local-ref cell.1$5))))
                      (let ((rfc_0
                             (if (vector? file-rfc_0)
                               (begin
                                 (unsafe-end-atomic)
                                 (if (if (zero?
                                          (bitwise-and
                                           (|#%app|
                                            rktio_fs_change_properties
                                            (unsafe-place-local-ref cell.1))
                                           8))
                                       (|#%app|
                                        rktio_file_exists
                                        (unsafe-place-local-ref cell.1)
                                        fn_0)
                                       #f)
                                   (call-with-values
                                    (lambda () (1/split-path (host-> fn_0)))
                                    (lambda (base_0 name_0 dir_0)
                                      (let ((base-fn_0
                                             (->host
                                              base_0
                                              'filesystem-change-evt
                                              '(exists))))
                                        (begin
                                          (unsafe-start-atomic)
                                          (|#%app|
                                           rktio_fs_change
                                           (unsafe-place-local-ref cell.1)
                                           base-fn_0
                                           (unsafe-place-local-ref
                                            cell.1$5))))))
                                   (begin (unsafe-start-atomic) file-rfc_0)))
                               file-rfc_0)))
                        (if (vector? rfc_0)
                          (begin
                            (unsafe-end-atomic)
                            (if fail2_0
                              (|#%app| fail2_0)
                              (if (racket-error? rfc_0 1)
                                (raise
                                 (let ((app_0
                                        (let ((msg_0 "unsupported"))
                                          (error-message->adjusted-string
                                           'filesystem-change-evt
                                           'racket/primitive
                                           msg_0
                                           'racket/primitive))))
                                   (|#%app|
                                    exn:fail:unsupported
                                    app_0
                                    (current-continuation-marks))))
                                (raise-filesystem-error
                                 'filesystem-change-evt
                                 rfc_0
                                 (1/format
                                  "error generating event\n  path: ~a"
                                  (host-> fn_0))))))
                          (let ((fc_0 (fs-change-evt1.1 rfc_0 #f)))
                            (let ((cust-ref_0
                                   (|#%app|
                                    1/unsafe-custodian-register
                                    (current-custodian)
                                    fc_0
                                    (lambda (fc_1) (close-fc fc_1))
                                    #f
                                    #t)))
                              (begin
                                (set-fs-change-evt-cust-ref! fc_0 cust-ref_0)
                                (unsafe-add-global-finalizer
                                 fc_0
                                 (lambda () (close-fc fc_0)))
                                (unsafe-end-atomic)
                                fc_0))))))))))))))
    (|#%name|
     filesystem-change-evt
     (case-lambda
      ((p_0) (filesystem-change-evt_0 p_0 #f))
      ((p_0 fail2_0) (filesystem-change-evt_0 p_0 fail2_0))))))
(define 1/filesystem-change-evt-cancel
  (|#%name|
   filesystem-change-evt-cancel
   (lambda (fc_0)
     (begin
       (if (fs-change-evt? fc_0)
         (void)
         (raise-argument-error
          'filesystem-change-evt-cancel
          "filesystem-change-evt?"
          fc_0))
       (unsafe-start-atomic)
       (close-fc fc_0)
       (unsafe-end-atomic)))))
(define close-fc
  (lambda (fc_0)
    (let ((rfc_0 (fs-change-evt-rfc fc_0)))
      (if rfc_0
        (begin
          (|#%app|
           1/unsafe-custodian-unregister
           fc_0
           (fs-change-evt-cust-ref fc_0))
          (set-fs-change-evt-cust-ref! fc_0 #f)
          (set-fs-change-evt-rfc! fc_0 #f)
          (|#%app|
           rktio_fs_change_forget
           (unsafe-place-local-ref cell.1)
           rfc_0))
        (void)))))
(define effect_1844
  (begin
    (void
     (|#%app|
      set-fs-change-properties!
      (let ((props_0
             (|#%app|
              rktio_fs_change_properties
              (unsafe-place-local-ref cell.1))))
        (let ((set?_0
               (|#%name|
                set?
                (lambda (a_0 b_0) (not (eqv? 0 (bitwise-and a_0 b_0)))))))
          (if (if (set?_0 props_0 16)
                (eq? (unsafe-place-local-ref cell.1$5) rktio_NULL)
                #f)
            '#(#f #f #f #f)
            (let ((app_0 (if (set?_0 props_0 1) 'supported #f)))
              (let ((app_1 (if (set?_0 props_0 2) 'scalable #f)))
                (let ((app_2 (if (set?_0 props_0 4) 'low-latency #f)))
                  (vector
                   app_0
                   app_1
                   app_2
                   (if (set?_0 props_0 8) 'file-level #f))))))))))
    (void)))
(define 1/sha1-bytes
  (let ((sha1-bytes_0
         (|#%name|
          sha1-bytes
          (lambda (in3_0 start1_0 end2_0)
            (sha
             'sha1-bytes
             in3_0
             start1_0
             end2_0
             (|#%app| rktio_make_sha1_ctx)
             20
             rktio_sha1_init
             rktio_sha1_update
             rktio_sha1_final)))))
    (|#%name|
     sha1-bytes
     (case-lambda
      ((in_0) (sha1-bytes_0 in_0 0 #f))
      ((in_0 start_0 end2_0) (sha1-bytes_0 in_0 start_0 end2_0))
      ((in_0 start1_0) (sha1-bytes_0 in_0 start1_0 #f))))))
(define 1/sha224-bytes
  (let ((sha224-bytes_0
         (|#%name|
          sha224-bytes
          (lambda (in6_0 start4_0 end5_0)
            (sha
             'sha224-bytes
             in6_0
             start4_0
             end5_0
             (|#%app| rktio_make_sha2_ctx)
             28
             (lambda (p_0) (|#%app| rktio_sha2_init p_0 #t))
             rktio_sha2_update
             rktio_sha2_final)))))
    (|#%name|
     sha224-bytes
     (case-lambda
      ((in_0) (sha224-bytes_0 in_0 0 #f))
      ((in_0 start_0 end5_0) (sha224-bytes_0 in_0 start_0 end5_0))
      ((in_0 start4_0) (sha224-bytes_0 in_0 start4_0 #f))))))
(define 1/sha256-bytes
  (let ((sha256-bytes_0
         (|#%name|
          sha256-bytes
          (lambda (in9_0 start7_0 end8_0)
            (sha
             'sha256-bytes
             in9_0
             start7_0
             end8_0
             (|#%app| rktio_make_sha2_ctx)
             32
             (lambda (p_0) (|#%app| rktio_sha2_init p_0 #f))
             rktio_sha2_update
             rktio_sha2_final)))))
    (|#%name|
     sha256-bytes
     (case-lambda
      ((in_0) (sha256-bytes_0 in_0 0 #f))
      ((in_0 start_0 end8_0) (sha256-bytes_0 in_0 start_0 end8_0))
      ((in_0 start7_0) (sha256-bytes_0 in_0 start7_0 #f))))))
(define sha
  (lambda (who_0 in_0 start_0 end_0 p_0 sz_0 init_0 update_0 final_0)
    (begin
      (if (let ((or-part_0 (bytes? in_0)))
            (if or-part_0 or-part_0 (1/input-port? in_0)))
        (void)
        (raise-argument-error
         who_0
         "(lambda (p) (or (bytes? p) (input-port? p)))"
         in_0))
      (begin
        (if (exact-nonnegative-integer? start_0)
          (void)
          (raise-argument-error who_0 "exact-nonnegative-integer?" start_0))
        (begin
          (if (bytes? in_0)
            (if (<= 0 start_0 (unsafe-bytes-length in_0))
              (void)
              (raise-range-error
               who_0
               "byte string"
               "starting "
               start_0
               in_0
               0
               (unsafe-bytes-length in_0)
               #f))
            (void))
          (begin
            (if end_0
              (begin
                (if (let ((or-part_0 (not end_0)))
                      (if or-part_0
                        or-part_0
                        (exact-nonnegative-integer? end_0)))
                  (void)
                  (raise-argument-error
                   who_0
                   "(or/c #f exact-nonnegative-integer?)"
                   end_0))
                (if (bytes? in_0)
                  (if (<= start_0 end_0 (unsafe-bytes-length in_0))
                    (void)
                    (raise-range-error
                     who_0
                     "byte string"
                     "ending "
                     end_0
                     in_0
                     0
                     (unsafe-bytes-length in_0)
                     start_0))
                  (if (<= start_0 end_0)
                    (void)
                    (raise-arguments-error
                     who_0
                     "ending index is smaller than starting index"
                     "starting index"
                     start_0
                     "ending index"
                     end_0))))
              (void))
            (begin
              (|#%app| init_0 p_0)
              (begin
                (if (bytes? in_0)
                  (|#%app|
                   update_0
                   p_0
                   in_0
                   start_0
                   (if end_0 end_0 (unsafe-bytes-length in_0)))
                  (let ((buffer-size_0
                         (min 256 (if end_0 (- end_0 start_0) 256))))
                    (let ((buffer_0 (make-bytes buffer-size_0)))
                      (letrec*
                       ((loop_0
                         (|#%name|
                          loop
                          (lambda (skip_0)
                            (if (zero? skip_0)
                              (letrec*
                               ((loop_1
                                 (|#%name|
                                  loop
                                  (lambda (len_0)
                                    (if (if len_0 (zero? len_0) #f)
                                      (void)
                                      (let ((got_0
                                             (1/read-bytes!
                                              buffer_0
                                              in_0
                                              0
                                              (if len_0
                                                (min len_0 buffer-size_0)
                                                buffer-size_0))))
                                        (if (eof-object? got_0)
                                          (void)
                                          (begin
                                            (|#%app|
                                             update_0
                                             p_0
                                             buffer_0
                                             0
                                             got_0)
                                            (loop_1
                                             (if len_0
                                               (- len_0 got_0)
                                               #f))))))))))
                               (loop_1 (if end_0 (- end_0 start_0) #f)))
                              (let ((got_0
                                     (1/read-bytes!
                                      buffer_0
                                      in_0
                                      0
                                      (min skip_0 buffer-size_0))))
                                (if (eof-object? got_0)
                                  (void)
                                  (loop_0 (- skip_0 got_0)))))))))
                       (loop_0 start_0)))))
                (let ((bstr_0 (make-bytes sz_0)))
                  (begin (|#%app| final_0 p_0 bstr_0) bstr_0))))))))))
(define finish_2858
  (make-struct-type-install-properties
   '(subprocess)
   3
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (sp_0 ctx_0)
        (let ((v_0
               (|#%app|
                rktio_poll_process_done
                (unsafe-place-local-ref cell.1)
                (subprocess-process sp_0))))
          (if (eqv? v_0 0)
            (begin
              (sandman-poll-ctx-add-poll-set-adder!
               ctx_0
               (lambda (ps_0)
                 (|#%app|
                  rktio_poll_add_process
                  (unsafe-place-local-ref cell.1)
                  (subprocess-process sp_0)
                  ps_0)))
              (values #f sp_0))
            (begin (no-custodian! sp_0) (values (list sp_0) #f))))))))
   (current-inspector)
   #f
   '(2)
   #f
   'make-subprocess))
(define struct:subprocess
  (make-record-type-descriptor
   'subprocess
   #f
   (|#%nongenerative-uid| subprocess)
   #f
   #f
   '(3 . 3)))
(define effect_2289 (finish_2858 struct:subprocess))
(define make-subprocess
  (|#%name|
   make-subprocess
   (record-constructor
    (make-record-constructor-descriptor struct:subprocess #f #f))))
(define 1/subprocess?_2383
  (|#%name| subprocess? (record-predicate struct:subprocess)))
(define 1/subprocess?
  (|#%name|
   subprocess?
   (lambda (v)
     (if (1/subprocess?_2383 v)
       #t
       ($value
        (if (impersonator? v)
          (1/subprocess?_2383 (impersonator-val v))
          #f))))))
(define subprocess-process_2270
  (|#%name| subprocess-process (record-accessor struct:subprocess 0)))
(define subprocess-process
  (|#%name|
   subprocess-process
   (lambda (s)
     (if (1/subprocess?_2383 s)
       (subprocess-process_2270 s)
       ($value
        (impersonate-ref
         subprocess-process_2270
         struct:subprocess
         0
         s
         'process))))))
(define subprocess-cust-ref_2827
  (|#%name| subprocess-cust-ref (record-accessor struct:subprocess 1)))
(define subprocess-cust-ref
  (|#%name|
   subprocess-cust-ref
   (lambda (s)
     (if (1/subprocess?_2383 s)
       (subprocess-cust-ref_2827 s)
       ($value
        (impersonate-ref
         subprocess-cust-ref_2827
         struct:subprocess
         1
         s
         'cust-ref))))))
(define subprocess-is-group?_2132
  (|#%name| subprocess-is-group? (record-accessor struct:subprocess 2)))
(define subprocess-is-group?
  (|#%name|
   subprocess-is-group?
   (lambda (s)
     (if (1/subprocess?_2383 s)
       (subprocess-is-group?_2132 s)
       ($value
        (impersonate-ref
         subprocess-is-group?_2132
         struct:subprocess
         2
         s
         'is-group?))))))
(define set-subprocess-process!_1881
  (|#%name| set-subprocess-process! (record-mutator struct:subprocess 0)))
(define set-subprocess-process!
  (|#%name|
   set-subprocess-process!
   (lambda (s v)
     (if (1/subprocess?_2383 s)
       (set-subprocess-process!_1881 s v)
       ($value
        (impersonate-set!
         set-subprocess-process!_1881
         struct:subprocess
         0
         0
         s
         v
         'process))))))
(define set-subprocess-cust-ref!_2630
  (|#%name| set-subprocess-cust-ref! (record-mutator struct:subprocess 1)))
(define set-subprocess-cust-ref!
  (|#%name|
   set-subprocess-cust-ref!
   (lambda (s v)
     (if (1/subprocess?_2383 s)
       (set-subprocess-cust-ref!_2630 s v)
       ($value
        (impersonate-set!
         set-subprocess-cust-ref!_2630
         struct:subprocess
         1
         1
         s
         v
         'cust-ref))))))
(define do-subprocess
  (|#%name|
   subprocess
   (lambda (stdout_0 stdin_0 stderr_0 group/command_0 . command/args_0)
     (begin
       (if (let ((or-part_0 (not stdout_0)))
             (if or-part_0
               or-part_0
               (if (1/output-port? stdout_0)
                 (1/file-stream-port? stdout_0)
                 #f)))
         (void)
         (raise-argument-error
          'subprocess
          "(or/c (and/c output-port? file-stream-port?) #f)"
          stdout_0))
       (begin
         (if (let ((or-part_0 (not stdin_0)))
               (if or-part_0
                 or-part_0
                 (if (1/input-port? stdin_0)
                   (1/file-stream-port? stdin_0)
                   #f)))
           (void)
           (raise-argument-error
            'subprocess
            "(or/c (and/c input-port? file-stream-port?) #f)"
            stdin_0))
         (begin
           (if (let ((or-part_0 (not stderr_0)))
                 (if or-part_0
                   or-part_0
                   (let ((or-part_1 (eq? stderr_0 'stdout)))
                     (if or-part_1
                       or-part_1
                       (if (1/output-port? stderr_0)
                         (1/file-stream-port? stderr_0)
                         #f)))))
             (void)
             (raise-argument-error
              'subprocess
              "(or/c (and/c output-port? file-stream-port?) #f 'stdout)"
              stderr_0))
           (call-with-values
            (lambda ()
              (if (path-string? group/command_0)
                (values
                 (if (1/subprocess-group-enabled) 'new #f)
                 group/command_0
                 command/args_0)
                (if (null? command/args_0)
                  (raise-argument-error
                   'subprocess
                   "path-string?"
                   group/command_0)
                  (if (let ((or-part_0 (not group/command_0)))
                        (if or-part_0
                          or-part_0
                          (let ((or-part_1 (eq? group/command_0 'new)))
                            (if or-part_1
                              or-part_1
                              (1/subprocess? group/command_0)))))
                    (begin
                      (if (pair? command/args_0)
                        (void)
                        (raise-arguments-error
                         'subprocess
                         "missing command argument after group argument"))
                      (let ((command_0 (car command/args_0)))
                        (begin
                          (if (path-string? command_0)
                            (void)
                            (raise-argument-error
                             'subprocess
                             "path-string?"
                             command_0))
                          (if (1/subprocess? group/command_0)
                            (if (subprocess-is-group? group/command_0)
                              (void)
                              (raise-arguments-error
                               'subprocess
                               "subprocess does not represent a new group"
                               "subprocess"
                               group/command_0))
                            (void))
                          (values
                           group/command_0
                           command_0
                           (cdr command/args_0)))))
                    (raise-argument-error
                     'subprocess
                     "(or/c path-string? #f 'new subprocess?)"
                     group/command_0)))))
            (lambda (group_0 command_0 exact/args_0)
              (call-with-values
               (lambda ()
                 (if (if (pair? exact/args_0)
                       (if (eq? 'exact (car exact/args_0))
                         (if (pair? (cdr exact/args_0))
                           (null? (cddr exact/args_0))
                           #f)
                         #f)
                       #f)
                   (values #t (cdr exact/args_0))
                   (values #f exact/args_0)))
               (lambda (exact?_0 args_0)
                 (begin
                   (letrec*
                    ((for-loop_0
                      (|#%name|
                       for-loop
                       (lambda (lst_0 pos_0)
                         (if (if (pair? lst_0) #t #f)
                           (let ((arg_0 (unsafe-car lst_0)))
                             (let ((rest_0 (unsafe-cdr lst_0)))
                               (begin
                                 (if (let ((or-part_0 (1/path? arg_0)))
                                       (if or-part_0
                                         or-part_0
                                         (let ((or-part_1
                                                (string-no-nuls? arg_0)))
                                           (if or-part_1
                                             or-part_1
                                             (bytes-no-nuls? arg_0)))))
                                   (void)
                                   (raise-argument-error
                                    'subprocess
                                    (if (if (not exact?_0)
                                          (if (= pos_0 0)
                                            (= (length args_0) 2)
                                            #f)
                                          #f)
                                      "(or/c path? string-no-nuls? bytes-no-nuls? 'exact)"
                                      "(or/c path? string-no-nuls? bytes-no-nuls?)")
                                    arg_0))
                                 (for-loop_0 rest_0 (+ pos_0 1)))))
                           (values))))))
                    (for-loop_0 args_0 0))
                   (begin
                     (if (if exact?_0 (not (eq? 'windows (system-type))) #f)
                       (raise-arguments-error
                        'subprocess
                        "exact command line not supported on this platform"
                        "exact command"
                        (car args_0))
                       (void))
                     (let ((cust-mode_0 (1/current-subprocess-custodian-mode)))
                       (let ((env-vars_0 (1/current-environment-variables)))
                         (let ((flags_0 (if (eq? stderr_0 'stdout) 2 0)))
                           (let ((flags_1
                                  (if exact?_0
                                    (bitwise-ior flags_0 4)
                                    flags_0)))
                             (let ((flags_2
                                    (if (eq? group_0 'new)
                                      (bitwise-ior flags_1 1)
                                      flags_1)))
                               (let ((flags_3
                                      (if (if (eq? cust-mode_0 'kill)
                                            (positive?
                                             (bitwise-and
                                              (|#%app|
                                               rktio_process_allowed_flags
                                               (unsafe-place-local-ref cell.1))
                                              8))
                                            #f)
                                        (bitwise-ior flags_2 8)
                                        flags_2)))
                                 (let ((flags_4
                                        (let ((tmp_0
                                               (1/current-subprocess-keep-file-descriptors)))
                                          (if (eq? tmp_0 'all)
                                            (bitwise-ior flags_3 16)
                                            (if (eq? tmp_0 'inherited)
                                              flags_3
                                              (bitwise-ior flags_3 32))))))
                                   (let ((command-bstr_0
                                          (->host
                                           (->path command_0)
                                           'subprocess
                                           '(execute))))
                                     (let ((maybe-wait_0
                                            (|#%name|
                                             maybe-wait
                                             (lambda (fd_0)
                                               (if (if fd_0
                                                     (|#%app|
                                                      rktio_fd_is_pending_open
                                                      (unsafe-place-local-ref
                                                       cell.1)
                                                      (fd-port-fd fd_0))
                                                     #f)
                                                 (sync fd_0)
                                                 (void))))))
                                       (begin
                                         (maybe-wait_0 stdout_0)
                                         (begin
                                           (if (eq? stderr_0 'stdout)
                                             (void)
                                             (maybe-wait_0 stderr_0))
                                           (begin
                                             (unsafe-start-atomic)
                                             (begin
                                               (if stdout_0
                                                 (check-not-closed
                                                  'subprocess
                                                  stdout_0)
                                                 (void))
                                               (begin
                                                 (if stdin_0
                                                   (check-not-closed
                                                    'subprocess
                                                    stdin_0)
                                                   (void))
                                                 (begin
                                                   (if (if stderr_0
                                                         (not
                                                          (eq?
                                                           stderr_0
                                                           'stdout))
                                                         #f)
                                                     (check-not-closed
                                                      'subprocess
                                                      stderr_0)
                                                     (void))
                                                   (begin
                                                     (poll-subprocess-finalizations)
                                                     (begin
                                                       (check-current-custodian
                                                        'subprocess)
                                                       (let ((envvars_0
                                                              (|#%app|
                                                               rktio_empty_envvars
                                                               (unsafe-place-local-ref
                                                                cell.1))))
                                                         (begin
                                                           (let ((lst_0
                                                                  (1/environment-variables-names
                                                                   env-vars_0)))
                                                             (letrec*
                                                              ((for-loop_0
                                                                (|#%name|
                                                                 for-loop
                                                                 (lambda (lst_1)
                                                                   (if (pair?
                                                                        lst_1)
                                                                     (let ((name_0
                                                                            (unsafe-car
                                                                             lst_1)))
                                                                       (let ((rest_0
                                                                              (unsafe-cdr
                                                                               lst_1)))
                                                                         (begin
                                                                           (|#%app|
                                                                            rktio_envvars_set
                                                                            (unsafe-place-local-ref
                                                                             cell.1)
                                                                            envvars_0
                                                                            name_0
                                                                            (1/environment-variables-ref
                                                                             env-vars_0
                                                                             name_0))
                                                                           (for-loop_0
                                                                            rest_0))))
                                                                     (values))))))
                                                              (for-loop_0
                                                               lst_0)))
                                                           (let ((send-args_0
                                                                  (|#%app|
                                                                   rktio_from_bytes_list
                                                                   (cons
                                                                    command-bstr_0
                                                                    (1/reverse
                                                                     (letrec*
                                                                      ((for-loop_0
                                                                        (|#%name|
                                                                         for-loop
                                                                         (lambda (fold-var_0
                                                                                  lst_0)
                                                                           (if (pair?
                                                                                lst_0)
                                                                             (let ((arg_0
                                                                                    (unsafe-car
                                                                                     lst_0)))
                                                                               (let ((rest_0
                                                                                      (unsafe-cdr
                                                                                       lst_0)))
                                                                                 (let ((fold-var_1
                                                                                        (let ((fold-var_1
                                                                                               (cons
                                                                                                (if (string?
                                                                                                     arg_0)
                                                                                                  (1/string->bytes/locale
                                                                                                   arg_0
                                                                                                   63)
                                                                                                  (if (1/path?
                                                                                                       arg_0)
                                                                                                    (path-bytes
                                                                                                     arg_0)
                                                                                                    arg_0))
                                                                                                fold-var_0)))
                                                                                          (values
                                                                                           fold-var_1))))
                                                                                   (for-loop_0
                                                                                    fold-var_1
                                                                                    rest_0))))
                                                                             fold-var_0)))))
                                                                      (for-loop_0
                                                                       null
                                                                       args_0)))))))
                                                             (let ((r_0
                                                                    (let ((app_0
                                                                           (add1
                                                                            (length
                                                                             args_0))))
                                                                      (let ((app_1
                                                                             (if stdout_0
                                                                               (fd-port-fd
                                                                                stdout_0)
                                                                               #f)))
                                                                        (let ((app_2
                                                                               (if stdin_0
                                                                                 (fd-port-fd
                                                                                  stdin_0)
                                                                                 #f)))
                                                                          (let ((app_3
                                                                                 (if stderr_0
                                                                                   (if (not
                                                                                        (eq?
                                                                                         stderr_0
                                                                                         'stdout))
                                                                                     (fd-port-fd
                                                                                      stderr_0)
                                                                                     #f)
                                                                                   #f)))
                                                                            (let ((app_4
                                                                                   (if (1/subprocess?
                                                                                        group_0)
                                                                                     (subprocess-process
                                                                                      group_0)
                                                                                     #f)))
                                                                              (|#%app|
                                                                               rktio_process
                                                                               (unsafe-place-local-ref
                                                                                cell.1)
                                                                               command-bstr_0
                                                                               app_0
                                                                               send-args_0
                                                                               app_1
                                                                               app_2
                                                                               app_3
                                                                               app_4
                                                                               (->host
                                                                                (current-directory$1)
                                                                                #f
                                                                                null)
                                                                               envvars_0
                                                                               flags_4))))))))
                                                               (begin
                                                                 (|#%app|
                                                                  rktio_free_bytes_list
                                                                  send-args_0
                                                                  (length
                                                                   args_0))
                                                                 (begin
                                                                   (if envvars_0
                                                                     (|#%app|
                                                                      rktio_envvars_free
                                                                      (unsafe-place-local-ref
                                                                       cell.1)
                                                                      envvars_0)
                                                                     (void))
                                                                   (begin
                                                                     (if (vector?
                                                                          r_0)
                                                                       (begin
                                                                         (unsafe-end-atomic)
                                                                         (let ((base-msg_0
                                                                                "process creation failed"))
                                                                           (raise
                                                                            (let ((app_0
                                                                                   (let ((msg_0
                                                                                          (string-append
                                                                                           base-msg_0
                                                                                           "\n  system error: "
                                                                                           (format-rktio-system-error-message
                                                                                            r_0))))
                                                                                     (error-message->adjusted-string
                                                                                      'subprocess
                                                                                      'racket/primitive
                                                                                      msg_0
                                                                                      'racket/primitive))))
                                                                              (|#%app|
                                                                               exn:fail
                                                                               app_0
                                                                               (current-continuation-marks))))))
                                                                       (void))
                                                                     (let ((in_0
                                                                            (let ((fd_0
                                                                                   (|#%app|
                                                                                    rktio_process_result_stdout_fd
                                                                                    r_0)))
                                                                              (if fd_0
                                                                                (open-input-fd.1
                                                                                 unsafe-undefined
                                                                                 unsafe-undefined
                                                                                 fd_0
                                                                                 'subprocess-stdout)
                                                                                #f))))
                                                                       (let ((out_0
                                                                              (let ((fd_0
                                                                                     (|#%app|
                                                                                      rktio_process_result_stdin_fd
                                                                                      r_0)))
                                                                                (if fd_0
                                                                                  (open-output-fd.1
                                                                                   'infer
                                                                                   unsafe-undefined
                                                                                   unsafe-undefined
                                                                                   unsafe-undefined
                                                                                   fd_0
                                                                                   'subprocess-stdin)
                                                                                  #f))))
                                                                         (let ((err_0
                                                                                (let ((fd_0
                                                                                       (|#%app|
                                                                                        rktio_process_result_stderr_fd
                                                                                        r_0)))
                                                                                  (if fd_0
                                                                                    (open-input-fd.1
                                                                                     unsafe-undefined
                                                                                     unsafe-undefined
                                                                                     fd_0
                                                                                     'subprocess-stderr)
                                                                                    #f))))
                                                                           (let ((sp_0
                                                                                  (make-subprocess
                                                                                   (|#%app|
                                                                                    rktio_process_result_process
                                                                                    r_0)
                                                                                   #f
                                                                                   (eq?
                                                                                    group_0
                                                                                    'new))))
                                                                             (begin
                                                                               (register-subprocess-finalizer
                                                                                sp_0)
                                                                               (if cust-mode_0
                                                                                 (let ((close_0
                                                                                        (if (eq?
                                                                                             cust-mode_0
                                                                                             'kill)
                                                                                          kill-subprocess
                                                                                          interrupt-subprocess)))
                                                                                   (set-subprocess-cust-ref!
                                                                                    sp_0
                                                                                    (|#%app|
                                                                                     1/unsafe-custodian-register
                                                                                     (current-custodian)
                                                                                     sp_0
                                                                                     close_0
                                                                                     #t
                                                                                     #f)))
                                                                                 (void))
                                                                               (|#%app|
                                                                                rktio_free
                                                                                r_0)
                                                                               (unsafe-end-atomic)
                                                                               (values
                                                                                sp_0
                                                                                in_0
                                                                                out_0
                                                                                err_0))))))))))))))))))))))))))))))))))))))))))
(define 1/subprocess-wait
  (|#%name|
   subprocess-wait
   (lambda (sp_0)
     (begin
       (if (1/subprocess? sp_0)
         (void)
         (raise-argument-error 'subprocess-wait "subprocess?" sp_0))
       (void (sync sp_0))))))
(define 1/subprocess-status
  (|#%name|
   subprocess-status
   (lambda (sp_0)
     (begin
       (if (1/subprocess? sp_0)
         (void)
         (raise-argument-error 'subprocess-status "subprocess?" sp_0))
       (begin
         (unsafe-start-atomic)
         (let ((r_0
                (|#%app|
                 rktio_process_status
                 (unsafe-place-local-ref cell.1)
                 (subprocess-process sp_0))))
           (if (vector? r_0)
             (begin
               (unsafe-end-atomic)
               (let ((base-msg_0 "status access failed"))
                 (raise
                  (let ((app_0
                         (let ((msg_0
                                (string-append
                                 base-msg_0
                                 "\n  system error: "
                                 (format-rktio-system-error-message r_0))))
                           (error-message->adjusted-string
                            'subprocess-status
                            'racket/primitive
                            msg_0
                            'racket/primitive))))
                    (|#%app| exn:fail app_0 (current-continuation-marks))))))
             (if (|#%app| rktio_status_running r_0)
               (begin (|#%app| rktio_free r_0) (unsafe-end-atomic) 'running)
               (begin
                 (no-custodian! sp_0)
                 (let ((v_0 (|#%app| rktio_status_result r_0)))
                   (begin
                     (|#%app| rktio_free r_0)
                     (unsafe-end-atomic)
                     v_0)))))))))))
(define 1/subprocess-pid
  (|#%name|
   subprocess-pid
   (lambda (sp_0)
     (begin
       (if (1/subprocess? sp_0)
         (void)
         (raise-argument-error 'subprocess-pid "subprocess?" sp_0))
       (unsafe-start-atomic)
       (begin0
         (|#%app|
          rktio_process_pid
          (unsafe-place-local-ref cell.1)
          (subprocess-process sp_0))
         (unsafe-end-atomic))))))
(define kill-subprocess
  (lambda (sp_0)
    (let ((p_0 (subprocess-process sp_0)))
      (if p_0
        (|#%app| rktio_process_kill (unsafe-place-local-ref cell.1) p_0)
        (void)))))
(define interrupt-subprocess
  (lambda (sp_0)
    (let ((p_0 (subprocess-process sp_0)))
      (if p_0
        (|#%app| rktio_process_interrupt (unsafe-place-local-ref cell.1) p_0)
        (void)))))
(define 1/subprocess-kill
  (|#%name|
   subprocess-kill
   (lambda (sp_0 force?_0)
     (begin
       (if (1/subprocess? sp_0)
         (void)
         (raise-argument-error 'subprocess-kill "subprocess?" sp_0))
       (unsafe-start-atomic)
       (begin0
         (if force?_0 (kill-subprocess sp_0) (interrupt-subprocess sp_0))
         (unsafe-end-atomic))))))
(define no-custodian!
  (lambda (sp_0)
    (if (subprocess-cust-ref sp_0)
      (begin
        (|#%app| 1/unsafe-custodian-unregister sp_0 (subprocess-cust-ref sp_0))
        (set-subprocess-cust-ref! sp_0 #f))
      (void))))
(define cell.1$4 (unsafe-make-place-local (make-will-executor)))
(define subprocess-init!
  (lambda () (unsafe-place-local-set! cell.1$4 (make-will-executor))))
(define register-subprocess-finalizer
  (lambda (sp_0)
    (will-register
     (unsafe-place-local-ref cell.1$4)
     sp_0
     (lambda (sp_1)
       (begin
         (if (subprocess-process sp_1)
           (begin
             (|#%app|
              rktio_process_forget
              (unsafe-place-local-ref cell.1)
              (subprocess-process sp_1))
             (set-subprocess-process! sp_1 #f))
           (void))
         (no-custodian! sp_1)
         #t)))))
(define poll-subprocess-finalizations
  (lambda ()
    (if (will-try-execute (unsafe-place-local-ref cell.1$4))
      (poll-subprocess-finalizations)
      (void))))
(define 1/current-subprocess-custodian-mode
  (make-parameter
   #f
   (lambda (v_0)
     (begin
       (if (let ((or-part_0 (not v_0)))
             (if or-part_0
               or-part_0
               (let ((or-part_1 (eq? v_0 'kill)))
                 (if or-part_1 or-part_1 (eq? v_0 'interrupt)))))
         (void)
         (raise-argument-error
          'current-subprocess-custodian-mode
          "(or/c #f 'kill 'interrupt)"
          v_0))
       v_0))
   'current-subprocess-custodian-mode))
(define 1/subprocess-group-enabled
  (make-parameter #f (lambda (v_0) (if v_0 #t #f)) 'subprocess-group-enabled))
(define 1/current-subprocess-keep-file-descriptors
  (make-parameter
   'inherited
   (lambda (v_0)
     (begin
       (if (let ((or-part_0 (null? v_0)))
             (if or-part_0
               or-part_0
               (let ((or-part_1 (eq? v_0 'all)))
                 (if or-part_1 or-part_1 (eq? v_0 'inherited)))))
         (void)
         (raise-argument-error
          'current-subprocess-keep-file-descriptors
          "(or/c '() 'uninherited 'all)"
          v_0))
       v_0))
   'current-subprocess-keep-file-descriptors))
(define 1/shell-execute
  (|#%name|
   shell-execute
   (lambda (verb_0 target_0 parameters_0 dir_0 show-mode_0)
     (begin
       (if (let ((or-part_0 (not verb_0)))
             (if or-part_0 or-part_0 (string? verb_0)))
         (void)
         (raise-argument-error 'shell-execute "(or/c string? #f)" verb_0))
       (begin
         (if (string? target_0)
           (void)
           (raise-argument-error 'shell-execute "string?" target_0))
         (begin
           (if (string? parameters_0)
             (void)
             (raise-argument-error 'shell-execute "string?" parameters_0))
           (begin
             (if (path-string? dir_0)
               (void)
               (raise-argument-error 'shell-execute "path-string?" dir_0))
             (let ((show_mode_0
                    (let ((index_0
                           (if (symbol? show-mode_0)
                             (hash-ref hash3229 show-mode_0 (lambda () 0))
                             0)))
                      (if (unsafe-fx< index_0 6)
                        (if (unsafe-fx< index_0 2)
                          (if (unsafe-fx< index_0 1)
                            (raise-argument-error
                             'shell-execute
                             "(or/c 'sw_hide ....)"
                             show-mode_0)
                            0)
                          (if (unsafe-fx< index_0 3)
                            1
                            (if (unsafe-fx< index_0 4)
                              2
                              (if (unsafe-fx< index_0 5) 3 4))))
                        (if (unsafe-fx< index_0 9)
                          (if (unsafe-fx< index_0 7)
                            5
                            (if (unsafe-fx< index_0 8) 6 7))
                          (if (unsafe-fx< index_0 10)
                            8
                            (if (unsafe-fx< index_0 11)
                              9
                              (if (unsafe-fx< index_0 12) 10 11))))))))
               (let ((r_0
                      (let ((app_0
                             (if verb_0 (1/string->bytes/utf-8 verb_0) #f)))
                        (let ((app_1 (1/string->bytes/utf-8 target_0)))
                          (let ((app_2 (1/string->bytes/utf-8 parameters_0)))
                            (|#%app|
                             rktio_shell_execute
                             (unsafe-place-local-ref cell.1)
                             app_0
                             app_1
                             app_2
                             (->host (->path dir_0) 'shell-execute '(exists))
                             show_mode_0))))))
                 (begin
                   (if (vector? r_0)
                     (let ((base-msg_0 "failed"))
                       (raise
                        (let ((app_0
                               (let ((msg_0
                                      (string-append
                                       base-msg_0
                                       "\n  system error: "
                                       (format-rktio-system-error-message
                                        r_0))))
                                 (error-message->adjusted-string
                                  'shell-execute
                                  'racket/primitive
                                  msg_0
                                  'racket/primitive))))
                          (|#%app|
                           exn:fail
                           app_0
                           (current-continuation-marks)))))
                     (void))
                   #f))))))))))
(define effect_3140
  (begin
    (void
     (|#%app|
      set-get-subprocesses-time!
      (lambda ()
        (|#%app|
         rktio_get_process_children_milliseconds
         (unsafe-place-local-ref cell.1)))))
    (void)))
(define 1/processor-count
  (|#%name|
   processor-count
   (lambda ()
     (|#%app| rktio_processor_count (unsafe-place-local-ref cell.1)))))
(define raise-network-error
  (lambda (who_0 orig-err_0 base-msg_0)
    (let ((err_0 (remap-rktio-error orig-err_0)))
      (let ((msg_0
             (let ((msg_0
                    (string-append
                     base-msg_0
                     "\n  system error: "
                     (format-rktio-system-error-message err_0))))
               (error-message->adjusted-string
                who_0
                'racket/primitive
                msg_0
                'racket/primitive))))
        (raise
         (if (not (eq? (vector-ref err_0 0) 3))
           (let ((app_0 (current-continuation-marks)))
             (|#%app|
              exn:fail:network:errno
              msg_0
              app_0
              (let ((app_1 (vector-ref err_0 1)))
                (cons
                 app_1
                 (let ((kind_0 (vector-ref err_0 0)))
                   (if (eqv? kind_0 0)
                     'posix
                     (if (eqv? kind_0 1)
                       'windows
                       (if (eqv? kind_0 2)
                         'gai
                         (error
                          'raise-network-error
                          "confused about rktio error")))))))))
           (|#%app| exn:fail:network msg_0 (current-continuation-marks))))))))
(define raise-network-arguments-error
  (lambda (who_0 msg_0 socket-str_0 u_0)
    (begin
      (if (equal? socket-str_0 "socket")
        (void)
        (raise-argument-error
         'raise-network-arguments-error
         "\"socket\""
         socket-str_0))
      (raise
       (let ((app_0
              (let ((msg_1
                     (string-append
                      msg_0
                      "\n  socket: "
                      (error-value->string u_0))))
                (error-message->adjusted-string
                 who_0
                 'racket/primitive
                 msg_1
                 'racket/primitive))))
         (|#%app| exn:fail:network app_0 (current-continuation-marks)))))))
(define raise-network-option-error
  (lambda (who_0 mode_0 v_0)
    (raise-network-error who_0 v_0 (string-append mode_0 "sockopt failed"))))
(define finish_1989
  (make-struct-type-install-properties
   '(tcp-input-port)
   1
   0
   struct:fd-input-port
   (list
    (cons prop:authentic #t)
    (cons
     prop:fd-place-message-opener
     (lambda (fd_0 name_0)
       (make-tcp-input-port.1 unsafe-undefined fd_0 name_0)))
    (cons prop:file-stream #f))
   (current-inspector)
   #f
   '()
   #f
   'create-tcp-input-port))
(define struct:tcp-input-port
  (make-record-type-descriptor
   'tcp-input-port
   struct:fd-input-port
   (|#%nongenerative-uid| tcp-input-port)
   #f
   #f
   '(1 . 1)))
(define effect_2486 (finish_1989 struct:tcp-input-port))
(define create-tcp-input-port
  (|#%name|
   create-tcp-input-port
   (record-constructor
    (make-record-constructor-descriptor struct:tcp-input-port #f #f))))
(define tcp-input-port?
  (|#%name| tcp-input-port? (record-predicate struct:tcp-input-port)))
(define tcp-input-port-abandon?
  (|#%name| tcp-input-port-abandon? (record-accessor struct:tcp-input-port 0)))
(define set-tcp-input-port-abandon?!
  (|#%name|
   set-tcp-input-port-abandon?!
   (record-mutator struct:tcp-input-port 0)))
(define finish_2584
  (make-struct-type-install-properties
   '(tcp-input-port-methods)
   0
   0
   struct:fd-input-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'tcp-input-port-methods))
(define struct:tcp-input-port-methods.1
  (make-record-type-descriptor
   'tcp-input-port-methods
   struct:fd-input-port-methods.1
   (|#%nongenerative-uid| tcp-input-port-methods)
   #f
   #f
   '(0 . 0)))
(define effect_2506 (finish_2584 struct:tcp-input-port-methods.1))
(define tcp-input-port-methods1.1
  (|#%name|
   tcp-input-port-methods
   (record-constructor
    (make-record-constructor-descriptor
     struct:tcp-input-port-methods.1
     #f
     #f))))
(define tcp-input-port-methods?.1_2414
  (|#%name|
   tcp-input-port-methods?
   (record-predicate struct:tcp-input-port-methods.1)))
(define tcp-input-port-methods?.1
  (|#%name|
   tcp-input-port-methods?
   (lambda (v)
     (if (tcp-input-port-methods?.1_2414 v)
       #t
       ($value
        (if (impersonator? v)
          (tcp-input-port-methods?.1_2414 (impersonator-val v))
          #f))))))
(define tcp-input-port-vtable.1
  (let ((app_0 (core-port-methods-close.1 fd-input-port-vtable.1)))
    (let ((app_1 (core-port-methods-count-lines!.1 fd-input-port-vtable.1)))
      (let ((app_2 (core-port-methods-get-location.1 fd-input-port-vtable.1)))
        (let ((app_3
               (core-port-methods-file-position.1 fd-input-port-vtable.1)))
          (let ((app_4
                 (core-port-methods-buffer-mode.1 fd-input-port-vtable.1)))
            (let ((app_5
                   (core-input-port-methods-prepare-change.1
                    fd-input-port-vtable.1)))
              (let ((app_6
                     (core-input-port-methods-read-in.1
                      fd-input-port-vtable.1)))
                (let ((app_7
                       (core-input-port-methods-peek-in.1
                        fd-input-port-vtable.1)))
                  (let ((app_8
                         (core-input-port-methods-byte-ready.1
                          fd-input-port-vtable.1)))
                    (let ((app_9
                           (core-input-port-methods-get-progress-evt.1
                            fd-input-port-vtable.1)))
                      (let ((app_10
                             (core-input-port-methods-commit.1
                              fd-input-port-vtable.1)))
                        (let ((app_11
                               (peek-via-read-input-port-methods-read-in/inner.1
                                fd-input-port-vtable.1)))
                          (tcp-input-port-methods1.1
                           app_0
                           app_1
                           app_2
                           app_3
                           app_4
                           app_5
                           app_6
                           app_7
                           app_8
                           app_9
                           app_10
                           app_11
                           (peek-via-read-input-port-methods-byte-ready/inner.1
                            fd-input-port-vtable.1)
                           (|#%name|
                            on-close
                            (lambda (this-id_0)
                              (if (tcp-input-port-abandon? this-id_0)
                                (void)
                                (|#%app|
                                 rktio_socket_shutdown
                                 (unsafe-place-local-ref cell.1)
                                 (fd-input-port-fd this-id_0)
                                 0))))
                           (|#%name|
                            raise-read-error
                            (lambda (this-id_0 n51_0)
                              (raise-network-error
                               #f
                               n51_0
                               "error reading from stream port")))))))))))))))))
(define make-tcp-input-port.1
  (|#%name|
   make-tcp-input-port
   (lambda (fd-refcount2_0 fd4_0 name5_0)
     (let ((fd-refcount_0
            (if (eq? fd-refcount2_0 unsafe-undefined) (box 1) fd-refcount2_0)))
       (let ((app_0 (direct2.1 #f 0 0)))
         (let ((temp82_0
                (create-tcp-input-port
                 tcp-input-port-vtable.1
                 name5_0
                 app_0
                 #f
                 #f
                 0
                 #f
                 #f
                 #f
                 #f
                 #f
                 (make-bytes 4096)
                 0
                 0
                 #f
                 'block
                 fd4_0
                 fd-refcount_0
                 #f
                 #f
                 #f)))
           (finish-fd-input-port.1 unsafe-undefined temp82_0)))))))
(define finish_2498
  (make-struct-type-install-properties
   '(tcp-output-port)
   1
   0
   struct:fd-output-port
   (list
    (cons prop:authentic #t)
    (cons
     prop:fd-place-message-opener
     (lambda (fd_0 name_0)
       (make-tcp-output-port.1 unsafe-undefined fd_0 name_0)))
    (cons prop:file-stream #f))
   (current-inspector)
   #f
   '()
   #f
   'create-tcp-output-port))
(define struct:tcp-output-port
  (make-record-type-descriptor
   'tcp-output-port
   struct:fd-output-port
   (|#%nongenerative-uid| tcp-output-port)
   #f
   #f
   '(1 . 1)))
(define effect_2179 (finish_2498 struct:tcp-output-port))
(define create-tcp-output-port
  (|#%name|
   create-tcp-output-port
   (record-constructor
    (make-record-constructor-descriptor struct:tcp-output-port #f #f))))
(define tcp-output-port?
  (|#%name| tcp-output-port? (record-predicate struct:tcp-output-port)))
(define tcp-output-port-abandon?
  (|#%name|
   tcp-output-port-abandon?
   (record-accessor struct:tcp-output-port 0)))
(define set-tcp-output-port-abandon?!
  (|#%name|
   set-tcp-output-port-abandon?!
   (record-mutator struct:tcp-output-port 0)))
(define finish_2811
  (make-struct-type-install-properties
   '(tcp-output-port-methods)
   0
   0
   struct:fd-output-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'tcp-output-port-methods))
(define struct:tcp-output-port-methods.1
  (make-record-type-descriptor
   'tcp-output-port-methods
   struct:fd-output-port-methods.1
   (|#%nongenerative-uid| tcp-output-port-methods)
   #f
   #f
   '(0 . 0)))
(define effect_2820 (finish_2811 struct:tcp-output-port-methods.1))
(define tcp-output-port-methods7.1
  (|#%name|
   tcp-output-port-methods
   (record-constructor
    (make-record-constructor-descriptor
     struct:tcp-output-port-methods.1
     #f
     #f))))
(define tcp-output-port-methods?.1_2754
  (|#%name|
   tcp-output-port-methods?
   (record-predicate struct:tcp-output-port-methods.1)))
(define tcp-output-port-methods?.1
  (|#%name|
   tcp-output-port-methods?
   (lambda (v)
     (if (tcp-output-port-methods?.1_2754 v)
       #t
       ($value
        (if (impersonator? v)
          (tcp-output-port-methods?.1_2754 (impersonator-val v))
          #f))))))
(define tcp-output-port-vtable.1
  (let ((app_0 (core-port-methods-close.1 fd-output-port-vtable.1)))
    (let ((app_1 (core-port-methods-count-lines!.1 fd-output-port-vtable.1)))
      (let ((app_2 (core-port-methods-get-location.1 fd-output-port-vtable.1)))
        (let ((app_3
               (core-port-methods-file-position.1 fd-output-port-vtable.1)))
          (let ((app_4
                 (core-output-port-methods-write-out.1
                  fd-output-port-vtable.1)))
            (let ((app_5
                   (core-output-port-methods-write-out-special.1
                    fd-output-port-vtable.1)))
              (let ((app_6
                     (core-output-port-methods-get-write-evt.1
                      fd-output-port-vtable.1)))
                (tcp-output-port-methods7.1
                 app_0
                 app_1
                 app_2
                 app_3
                 (|#%name|
                  buffer-mode
                  (case-lambda
                   ((this-id_0) (fd-output-port-buffer-mode this-id_0))
                   ((this-id_0 mode87_0)
                    (begin
                      (set-fd-output-port-buffer-mode! this-id_0 mode87_0)
                      (|#%app|
                       rktio_tcp_nodelay
                       (unsafe-place-local-ref cell.1)
                       (fd-output-port-fd this-id_0)
                       (eq? mode87_0 'block))))))
                 app_4
                 app_5
                 app_6
                 (core-output-port-methods-get-write-special-evt.1
                  fd-output-port-vtable.1)
                 (|#%name|
                  on-close
                  (lambda (this-id_0)
                    (if (tcp-output-port-abandon? this-id_0)
                      (void)
                      (|#%app|
                       rktio_socket_shutdown
                       (unsafe-place-local-ref cell.1)
                       (fd-output-port-fd this-id_0)
                       1))))
                 (|#%name|
                  raise-write-error
                  (lambda (this-id_0 n161_0)
                    (raise-network-error
                     #f
                     n161_0
                     "error writing to stream port"))))))))))))
(define make-tcp-output-port.1
  (|#%name|
   make-tcp-output-port
   (lambda (fd-refcount8_0 fd10_0 name11_0)
     (let ((fd-refcount_0
            (if (eq? fd-refcount8_0 unsafe-undefined) (box 1) fd-refcount8_0)))
       (let ((app_0 (direct2.1 #f 0 0)))
         (let ((temp187_0
                (create-tcp-output-port
                 tcp-output-port-vtable.1
                 name11_0
                 app_0
                 #f
                 #f
                 0
                 #f
                 always-evt
                 #f
                 #f
                 #f
                 fd10_0
                 fd-refcount_0
                 (make-bytes 4096)
                 0
                 0
                 #f
                 'block
                 #f
                 #f)))
           (finish-fd-output-port.1 unsafe-undefined #f temp187_0)))))))
(define open-input-output-tcp.1
  (|#%name|
   open-input-output-tcp
   (lambda (close?13_0 fd15_0 name16_0)
     (let ((refcount_0 (box (if close?13_0 2 3))))
       (let ((app_0 (make-tcp-input-port.1 refcount_0 fd15_0 name16_0)))
         (values
          app_0
          (make-tcp-output-port.1 refcount_0 fd15_0 name16_0)))))))
(define 1/tcp-port?
  (|#%name|
   tcp-port?
   (lambda (p_0)
     (let ((cp_0
            (let ((or-part_0 (->core-input-port.1 #f p_0 #f)))
              (if or-part_0 or-part_0 (->core-output-port.1 #f p_0 #f)))))
       (let ((or-part_0 (tcp-input-port? cp_0)))
         (if or-part_0 or-part_0 (tcp-output-port? cp_0)))))))
(define 1/tcp-abandon-port
  (|#%name|
   tcp-abandon-port
   (lambda (p_0)
     (let ((cp_0
            (let ((or-part_0 (->core-input-port.1 #f p_0 #f)))
              (if or-part_0 or-part_0 (->core-output-port.1 #f p_0 #f)))))
       (if (tcp-input-port? cp_0)
         (begin (set-tcp-input-port-abandon?! cp_0 #t) (close-port p_0))
         (if (tcp-output-port? cp_0)
           (begin (set-tcp-output-port-abandon?! cp_0 #t) (close-port p_0))
           (void)))))))
(define finish_2561
  (make-struct-type-install-properties
   '(rktio-evt)
   2
   0
   #f
   (let ((app_0 (cons prop:authentic #t)))
     (list
      app_0
      (cons
       prop:evt
       (|#%app|
        poller
        (lambda (self_0 poll-ctx_0)
          (if (|#%app| (rktio-evt-poll self_0))
            (values (list self_0) #f)
            (begin
              (sandman-poll-ctx-add-poll-set-adder!
               poll-ctx_0
               (rktio-evt-add-to-poll-set self_0))
              (values #f self_0))))))))
   (current-inspector)
   #f
   '(0 1)
   #f
   'rktio-evt))
(define struct:rktio-evt
  (make-record-type-descriptor
   'rktio-evt
   #f
   (|#%nongenerative-uid| rktio-evt)
   #f
   #f
   '(2 . 0)))
(define effect_1868 (finish_2561 struct:rktio-evt))
(define rktio-evt1.1
  (|#%name|
   rktio-evt
   (record-constructor
    (make-record-constructor-descriptor struct:rktio-evt #f #f))))
(define rktio-evt? (|#%name| rktio-evt? (record-predicate struct:rktio-evt)))
(define rktio-evt-poll
  (|#%name| rktio-evt-poll (record-accessor struct:rktio-evt 0)))
(define rktio-evt-add-to-poll-set
  (|#%name| rktio-evt-add-to-poll-set (record-accessor struct:rktio-evt 1)))
(define call-with-resolved-address.1
  (|#%name|
   call-with-resolved-address
   (lambda (enable-break?4_0
            family5_0
            passive?6_0
            port-number-on-error?3_0
            retain-address?8_0
            tcp?7_0
            which2_0
            who1_0
            hostname17_0
            port-no18_0
            proc19_0)
     (let ((family_0 (if (eq? family5_0 unsafe-undefined) -1 family5_0)))
       (begin
         (poll-address-finalizations)
         (if (if (not hostname17_0) (not port-no18_0) #f)
           (|#%app| proc19_0 #f)
           (call-with-resource
            (box
             (|#%app|
              rktio_start_addrinfo_lookup
              (unsafe-place-local-ref cell.1)
              (if hostname17_0 (1/string->bytes/utf-8 hostname17_0) #f)
              (if port-no18_0 port-no18_0 0)
              family_0
              passive?6_0
              tcp?7_0))
            (lambda (lookup-box_0)
              (let ((lookup_0 (unbox lookup-box_0)))
                (if lookup_0
                  (|#%app|
                   rktio_addrinfo_lookup_stop
                   (unsafe-place-local-ref cell.1)
                   lookup_0)
                  (void))))
            (lambda (lookup-box_0)
              (let ((lookup_0 (unbox lookup-box_0)))
                (letrec*
                 ((loop_0
                   (|#%name|
                    loop
                    (lambda ()
                      (if (if (not (vector? lookup_0))
                            (eqv?
                             (|#%app|
                              rktio_poll_addrinfo_lookup_ready
                              (unsafe-place-local-ref cell.1)
                              lookup_0)
                             0)
                            #f)
                        (begin
                          (unsafe-end-atomic)
                          (|#%app|
                           (if enable-break?4_0 sync/enable-break sync)
                           (rktio-evt1.1
                            (lambda ()
                              (not
                               (eqv?
                                (|#%app|
                                 rktio_poll_addrinfo_lookup_ready
                                 (unsafe-place-local-ref cell.1)
                                 lookup_0)
                                0)))
                            (lambda (ps_0)
                              (|#%app|
                               rktio_poll_add_addrinfo_lookup
                               (unsafe-place-local-ref cell.1)
                               lookup_0
                               ps_0))))
                          (unsafe-start-atomic)
                          (loop_0))
                        (begin
                          (set-box! lookup-box_0 #f)
                          (call-with-resource
                           (if (vector? lookup_0)
                             lookup_0
                             (|#%app|
                              rktio_addrinfo_lookup_get
                              (unsafe-place-local-ref cell.1)
                              lookup_0))
                           (lambda (addr_0)
                             (|#%app|
                              rktio_addrinfo_free
                              (unsafe-place-local-ref cell.1)
                              addr_0))
                           (lambda (addr_0)
                             (if (if who1_0 (vector? addr_0) #f)
                               (begin
                                 (unsafe-end-atomic)
                                 (raise-network-error
                                  who1_0
                                  addr_0
                                  (string-append
                                   "can't resolve "
                                   which2_0
                                   "address"
                                   "\n  address: "
                                   (if hostname17_0 hostname17_0 "<unspec>")
                                   (if (if port-number-on-error?3_0
                                         port-no18_0
                                         #f)
                                     (string-append
                                      "\n  port number: "
                                      (number->string port-no18_0))
                                     ""))))
                               (begin0
                                 (|#%app| proc19_0 addr_0)
                                 (if retain-address?8_0
                                   (void)
                                   (|#%app|
                                    rktio_addrinfo_free
                                    (unsafe-place-local-ref cell.1)
                                    addr_0))))))))))))
                 (loop_0)))))))))))
(define cell.1$3 (unsafe-make-place-local (make-will-executor)))
(define register-address-finalizer
  (lambda (addr_0)
    (will-register
     (unsafe-place-local-ref cell.1$3)
     addr_0
     (lambda (addr_1)
       (begin
         (|#%app| rktio_addrinfo_free (unsafe-place-local-ref cell.1) addr_1)
         #t)))))
(define poll-address-finalizations
  (lambda ()
    (if (will-try-execute (unsafe-place-local-ref cell.1$3))
      (poll-address-finalizations)
      (void))))
(define address-init!
  (lambda () (unsafe-place-local-set! cell.1$3 (make-will-executor))))
(define finish_3124
  (make-struct-type-install-properties
   '(connect-progress)
   2
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'connect-progress))
(define struct:connect-progress
  (make-record-type-descriptor
   'connect-progress
   #f
   (|#%nongenerative-uid| connect-progress)
   #f
   #f
   '(2 . 3)))
(define effect_2319 (finish_3124 struct:connect-progress))
(define connect-progress1.1
  (|#%name|
   connect-progress
   (record-constructor
    (make-record-constructor-descriptor struct:connect-progress #f #f))))
(define connect-progress?
  (|#%name| connect-progress? (record-predicate struct:connect-progress)))
(define connect-progress-conn
  (|#%name| connect-progress-conn (record-accessor struct:connect-progress 0)))
(define connect-progress-trying-fd
  (|#%name|
   connect-progress-trying-fd
   (record-accessor struct:connect-progress 1)))
(define set-connect-progress-conn!
  (|#%name|
   set-connect-progress-conn!
   (record-mutator struct:connect-progress 0)))
(define set-connect-progress-trying-fd!
  (|#%name|
   set-connect-progress-trying-fd!
   (record-mutator struct:connect-progress 1)))
(define 1/tcp-connect
  (let ((tcp-connect_0
         (|#%name|
          tcp-connect
          (lambda (hostname4_0 port-no5_0 local-hostname2_0 local-port-no3_0)
            (do-tcp-connect.1
             #f
             'tcp-connect
             hostname4_0
             port-no5_0
             local-hostname2_0
             local-port-no3_0)))))
    (|#%name|
     tcp-connect
     (case-lambda
      ((hostname_0 port-no_0) (tcp-connect_0 hostname_0 port-no_0 #f #f))
      ((hostname_0 port-no_0 local-hostname_0 local-port-no3_0)
       (tcp-connect_0 hostname_0 port-no_0 local-hostname_0 local-port-no3_0))
      ((hostname_0 port-no_0 local-hostname2_0)
       (tcp-connect_0 hostname_0 port-no_0 local-hostname2_0 #f))))))
(define 1/tcp-connect/enable-break
  (let ((tcp-connect/enable-break_0
         (|#%name|
          tcp-connect/enable-break
          (lambda (hostname8_0 port-no9_0 local-hostname6_0 local-port-no7_0)
            (do-tcp-connect.1
             #t
             'tcp-connect/enable-break
             hostname8_0
             port-no9_0
             local-hostname6_0
             local-port-no7_0)))))
    (|#%name|
     tcp-connect/enable-break
     (case-lambda
      ((hostname_0 port-no_0)
       (tcp-connect/enable-break_0 hostname_0 port-no_0 #f #f))
      ((hostname_0 port-no_0 local-hostname_0 local-port-no7_0)
       (tcp-connect/enable-break_0
        hostname_0
        port-no_0
        local-hostname_0
        local-port-no7_0))
      ((hostname_0 port-no_0 local-hostname6_0)
       (tcp-connect/enable-break_0
        hostname_0
        port-no_0
        local-hostname6_0
        #f))))))
(define do-tcp-connect.1
  (|#%name|
   do-tcp-connect
   (lambda (enable-break?10_0
            who14_0
            hostname15_0
            port-no16_0
            local-hostname12_0
            local-port-no13_0)
     (begin
       (if (string? hostname15_0)
         (void)
         (raise-argument-error who14_0 "string?" hostname15_0))
       (begin
         (if (port-number? port-no16_0)
           (void)
           (raise-argument-error who14_0 "port-number?" port-no16_0))
         (begin
           (if (let ((or-part_0 (not local-hostname12_0)))
                 (if or-part_0 or-part_0 (string? local-hostname12_0)))
             (void)
             (raise-argument-error
              who14_0
              "(or/c string? #f)"
              local-hostname12_0))
           (begin
             (if (let ((or-part_0 (not local-port-no13_0)))
                   (if or-part_0 or-part_0 (port-number? local-port-no13_0)))
               (void)
               (raise-argument-error
                who14_0
                "(or/c port-number? #f)"
                local-port-no13_0))
             (begin
               (if (if local-hostname12_0 (not local-port-no13_0) #f)
                 (raise-arguments-error
                  who14_0
                  "no local port number supplied when local hostname was supplied"
                  "hostname"
                  local-hostname12_0)
                 (void))
               (let ((raise-connect-error_0
                      (|#%name|
                       raise-connect-error
                       (lambda (err35_0 what32_0 hostname33_0 port-no34_0)
                         (let ((what_0
                                (if (eq? what32_0 unsafe-undefined)
                                  "connection failed"
                                  what32_0)))
                           (let ((hostname_0
                                  (if (eq? hostname33_0 unsafe-undefined)
                                    hostname15_0
                                    hostname33_0)))
                             (let ((port-no_0
                                    (if (eq? port-no34_0 unsafe-undefined)
                                      port-no16_0
                                      port-no34_0)))
                               (begin
                                 (unsafe-end-atomic)
                                 (raise-network-error
                                  who14_0
                                  err35_0
                                  (let ((app_0
                                         (if hostname_0
                                           (1/format
                                            "\n  hostname: ~a"
                                            hostname_0)
                                           "")))
                                    (string-append
                                     what_0
                                     app_0
                                     (if port-no_0
                                       (1/format
                                        "\n  port number: ~a"
                                        port-no_0)
                                       ""))))))))))))
                 (let ((raise-connect-error_1
                        (|#%name|
                         raise-connect-error
                         (case-lambda
                          ((err_0)
                           (raise-connect-error_0
                            err_0
                            unsafe-undefined
                            unsafe-undefined
                            unsafe-undefined))
                          ((err_0 what_0 hostname_0 port-no34_0)
                           (raise-connect-error_0
                            err_0
                            what_0
                            hostname_0
                            port-no34_0))
                          ((err_0 what_0 hostname33_0)
                           (raise-connect-error_0
                            err_0
                            what_0
                            hostname33_0
                            unsafe-undefined))
                          ((err_0 what32_0)
                           (raise-connect-error_0
                            err_0
                            what32_0
                            unsafe-undefined
                            unsafe-undefined))))))
                   (begin
                     (1/security-guard-check-network
                      who14_0
                      hostname15_0
                      port-no16_0
                      'client)
                     (unsafe-start-atomic)
                     (begin0
                       (let ((temp39_0
                              (lambda (remote-addr_0)
                                (if (vector? remote-addr_0)
                                  (raise-connect-error_1
                                   remote-addr_0
                                   "host not found")
                                  (let ((temp43_0
                                         (lambda (local-addr_0)
                                           (if (vector? local-addr_0)
                                             (raise-connect-error_1
                                              local-addr_0
                                              "local host not found"
                                              local-hostname12_0
                                              local-port-no13_0)
                                             (call-with-resource
                                              (connect-progress1.1
                                               (|#%app|
                                                rktio_start_connect
                                                (unsafe-place-local-ref cell.1)
                                                remote-addr_0
                                                local-addr_0)
                                               #f)
                                              (lambda (conn-prog_0)
                                                (begin
                                                  (remove-trying-fd!
                                                   conn-prog_0)
                                                  (let ((conn_0
                                                         (connect-progress-conn
                                                          conn-prog_0)))
                                                    (if conn_0
                                                      (|#%app|
                                                       rktio_connect_stop
                                                       (unsafe-place-local-ref
                                                        cell.1)
                                                       conn_0)
                                                      (void)))))
                                              (lambda (conn-prog_0)
                                                (let ((conn_0
                                                       (connect-progress-conn
                                                        conn-prog_0)))
                                                  (if (vector? conn_0)
                                                    (raise-connect-error_1
                                                     conn_0)
                                                    (letrec*
                                                     ((loop_0
                                                       (|#%name|
                                                        loop
                                                        (lambda ()
                                                          (if (eqv?
                                                               (|#%app|
                                                                rktio_poll_connect_ready
                                                                (unsafe-place-local-ref
                                                                 cell.1)
                                                                conn_0)
                                                               0)
                                                            (begin
                                                              (init-trying-fd!
                                                               conn-prog_0)
                                                              (unsafe-end-atomic)
                                                              (|#%app|
                                                               (if enable-break?10_0
                                                                 sync/enable-break
                                                                 sync)
                                                               (rktio-evt1.1
                                                                (lambda ()
                                                                  (not
                                                                   (eqv?
                                                                    (|#%app|
                                                                     rktio_poll_connect_ready
                                                                     (unsafe-place-local-ref
                                                                      cell.1)
                                                                     conn_0)
                                                                    0)))
                                                                (lambda (ps_0)
                                                                  (|#%app|
                                                                   rktio_poll_add_connect
                                                                   (unsafe-place-local-ref
                                                                    cell.1)
                                                                   conn_0
                                                                   ps_0))))
                                                              (unsafe-start-atomic)
                                                              (loop_0))
                                                            (begin
                                                              (remove-trying-fd!
                                                               conn-prog_0)
                                                              (begin
                                                                (check-current-custodian
                                                                 who14_0)
                                                                (let ((fd_0
                                                                       (|#%app|
                                                                        rktio_connect_finish
                                                                        (unsafe-place-local-ref
                                                                         cell.1)
                                                                        conn_0)))
                                                                  (if (vector?
                                                                       fd_0)
                                                                    (if (racket-error?
                                                                         fd_0
                                                                         19)
                                                                      (loop_0)
                                                                      (begin
                                                                        (set-connect-progress-conn!
                                                                         conn-prog_0
                                                                         #f)
                                                                        (raise-connect-error_1
                                                                         fd_0)))
                                                                    (let ((name_0
                                                                           (string->immutable-string
                                                                            hostname15_0)))
                                                                      (begin
                                                                        (|#%app|
                                                                         rktio_tcp_nodelay
                                                                         (unsafe-place-local-ref
                                                                          cell.1)
                                                                         fd_0
                                                                         #t)
                                                                        (open-input-output-tcp.1
                                                                         #t
                                                                         fd_0
                                                                         name_0))))))))))))
                                                     (loop_0))))))))))
                                    (call-with-resolved-address.1
                                     enable-break?10_0
                                     unsafe-undefined
                                     #f
                                     #t
                                     #f
                                     #t
                                     ""
                                     #f
                                     local-hostname12_0
                                     local-port-no13_0
                                     temp43_0))))))
                         (call-with-resolved-address.1
                          enable-break?10_0
                          unsafe-undefined
                          #f
                          #t
                          #f
                          #t
                          ""
                          #f
                          hostname15_0
                          port-no16_0
                          temp39_0))
                       (unsafe-end-atomic)))))))))))))
(define init-trying-fd!
  (lambda (conn-prog_0)
    (if (connect-progress-trying-fd conn-prog_0)
      (void)
      (let ((fd_0
             (|#%app|
              rktio_connect_trying
              (unsafe-place-local-ref cell.1)
              (connect-progress-conn conn-prog_0))))
        (begin
          (set-connect-progress-trying-fd! conn-prog_0 fd_0)
          (void (fd-semaphore-update! fd_0 'write)))))))
(define remove-trying-fd!
  (lambda (conn-prog_0)
    (let ((fd_0 (connect-progress-trying-fd conn-prog_0)))
      (if fd_0
        (begin
          (fd-semaphore-update! fd_0 'remove)
          (set-connect-progress-trying-fd! conn-prog_0 #f))
        (void)))))
(define finish_2775
  (make-struct-type-install-properties
   '(tcp-listener)
   3
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app| poller (lambda (l_0 ctx_0) (poll-listener l_0 ctx_0)))))
   (current-inspector)
   #f
   '(0 1 2)
   #f
   'tcp-listener))
(define struct:tcp-listener
  (make-record-type-descriptor
   'tcp-listener
   #f
   (|#%nongenerative-uid| tcp-listener)
   #f
   #f
   '(3 . 0)))
(define effect_2347 (finish_2775 struct:tcp-listener))
(define tcp-listener1.1
  (|#%name|
   tcp-listener
   (record-constructor
    (make-record-constructor-descriptor struct:tcp-listener #f #f))))
(define 1/tcp-listener?_2760
  (|#%name| tcp-listener? (record-predicate struct:tcp-listener)))
(define 1/tcp-listener?
  (|#%name|
   tcp-listener?
   (lambda (v)
     (if (1/tcp-listener?_2760 v)
       #t
       ($value
        (if (impersonator? v)
          (1/tcp-listener?_2760 (impersonator-val v))
          #f))))))
(define tcp-listener-lnr_2358
  (|#%name| tcp-listener-lnr (record-accessor struct:tcp-listener 0)))
(define tcp-listener-lnr
  (|#%name|
   tcp-listener-lnr
   (lambda (s)
     (if (1/tcp-listener?_2760 s)
       (tcp-listener-lnr_2358 s)
       ($value
        (impersonate-ref
         tcp-listener-lnr_2358
         struct:tcp-listener
         0
         s
         'lnr))))))
(define tcp-listener-closed_2540
  (|#%name| tcp-listener-closed (record-accessor struct:tcp-listener 1)))
(define tcp-listener-closed
  (|#%name|
   tcp-listener-closed
   (lambda (s)
     (if (1/tcp-listener?_2760 s)
       (tcp-listener-closed_2540 s)
       ($value
        (impersonate-ref
         tcp-listener-closed_2540
         struct:tcp-listener
         1
         s
         'closed))))))
(define tcp-listener-custodian-reference_2721
  (|#%name|
   tcp-listener-custodian-reference
   (record-accessor struct:tcp-listener 2)))
(define tcp-listener-custodian-reference
  (|#%name|
   tcp-listener-custodian-reference
   (lambda (s)
     (if (1/tcp-listener?_2760 s)
       (tcp-listener-custodian-reference_2721 s)
       ($value
        (impersonate-ref
         tcp-listener-custodian-reference_2721
         struct:tcp-listener
         2
         s
         'custodian-reference))))))
(define 1/tcp-listen
  (let ((tcp-listen_0
         (|#%name|
          tcp-listen
          (lambda (port-no5_0 max-allow-wait2_0 reuse?3_0 hostname4_0)
            (begin
              (if (listen-port-number? port-no5_0)
                (void)
                (raise-argument-error
                 'tcp-listen
                 "listen-port-number?"
                 port-no5_0))
              (begin
                (if (exact-nonnegative-integer? max-allow-wait2_0)
                  (void)
                  (raise-argument-error
                   'tcp-listen
                   "exact-nonnegative-integer?"
                   max-allow-wait2_0))
                (begin
                  (if (let ((or-part_0 (not hostname4_0)))
                        (if or-part_0 or-part_0 (string? hostname4_0)))
                    (void)
                    (raise-argument-error
                     'tcp-listen
                     "(or/c string? #f)"
                     hostname4_0))
                  (let ((raise-listen-error_0
                         (|#%name|
                          raise-listen-error
                          (lambda (what_0 err_0)
                            (begin
                              (unsafe-end-atomic)
                              (raise-network-error
                               'tcp-listen
                               err_0
                               (let ((app_0
                                      (if hostname4_0
                                        (1/format
                                         "\n  hostname: ~a"
                                         hostname4_0)
                                        "")))
                                 (string-append
                                  what_0
                                  app_0
                                  (1/format
                                   "\n  port number: ~a"
                                   port-no5_0)))))))))
                    (begin
                      (1/security-guard-check-network
                       'tcp-listen
                       hostname4_0
                       port-no5_0
                       'server)
                      (letrec*
                       ((loop_0
                         (|#%name|
                          loop
                          (lambda (family_0)
                            (|#%app|
                             (begin
                               (unsafe-start-atomic)
                               (begin0
                                 (let ((temp12_0
                                        (lambda (addr_0)
                                          (if (vector? addr_0)
                                            (raise-listen-error_0
                                             "address-resolution error"
                                             addr_0)
                                            (begin
                                              (check-current-custodian
                                               'tcp-listen)
                                              (let ((lnr_0
                                                     (|#%app|
                                                      rktio_listen
                                                      (unsafe-place-local-ref
                                                       cell.1)
                                                      addr_0
                                                      (min
                                                       max-allow-wait2_0
                                                       10000)
                                                      reuse?3_0)))
                                                (if (vector? lnr_0)
                                                  (if (racket-error? lnr_0 24)
                                                    (lambda ()
                                                      (loop_0
                                                       (|#%app|
                                                        rktio_get_ipv4_family
                                                        (unsafe-place-local-ref
                                                         cell.1))))
                                                    (raise-listen-error_0
                                                     "listen failed"
                                                     lnr_0))
                                                  (let ((closed_0 (box #f)))
                                                    (let ((custodian-reference_0
                                                           (|#%app|
                                                            1/unsafe-custodian-register
                                                            (current-custodian)
                                                            lnr_0
                                                            (lambda (fd_0)
                                                              (do-tcp-close
                                                               lnr_0
                                                               closed_0))
                                                            #f
                                                            #f)))
                                                      (lambda ()
                                                        (tcp-listener1.1
                                                         lnr_0
                                                         closed_0
                                                         custodian-reference_0)))))))))))
                                   (call-with-resolved-address.1
                                    #f
                                    family_0
                                    #t
                                    #t
                                    #f
                                    #t
                                    ""
                                    #f
                                    hostname4_0
                                    port-no5_0
                                    temp12_0))
                                 (unsafe-end-atomic))))))))
                       (loop_0 -1)))))))))))
    (|#%name|
     tcp-listen
     (case-lambda
      ((port-no_0) (tcp-listen_0 port-no_0 4 #f #f))
      ((port-no_0 max-allow-wait_0 reuse?_0 hostname4_0)
       (tcp-listen_0 port-no_0 max-allow-wait_0 reuse?_0 hostname4_0))
      ((port-no_0 max-allow-wait_0 reuse?3_0)
       (tcp-listen_0 port-no_0 max-allow-wait_0 reuse?3_0 #f))
      ((port-no_0 max-allow-wait2_0)
       (tcp-listen_0 port-no_0 max-allow-wait2_0 #f #f))))))
(define do-tcp-close
  (lambda (lnr_0 closed_0)
    (begin
      (|#%app| rktio_listen_stop (unsafe-place-local-ref cell.1) lnr_0)
      (set-box! closed_0 #t))))
(define 1/tcp-close
  (|#%name|
   tcp-close
   (lambda (listener_0)
     (begin
       (if (1/tcp-listener? listener_0)
         (void)
         (raise-argument-error 'tcp-close "tcp-listener?" listener_0))
       (let ((closed_0 (tcp-listener-closed listener_0)))
         (begin
           (unsafe-start-atomic)
           (if (unbox closed_0)
             (begin
               (unsafe-end-atomic)
               (raise-arguments-error
                'tcp-close
                "listener is closed"
                "listener"
                listener_0))
             (let ((lnr_0 (tcp-listener-lnr listener_0)))
               (begin
                 (do-tcp-close lnr_0 closed_0)
                 (|#%app|
                  1/unsafe-custodian-unregister
                  lnr_0
                  (tcp-listener-custodian-reference listener_0))
                 (unsafe-end-atomic))))))))))
(define tcp-listener-closed?
  (lambda (listener_0) (unbox (tcp-listener-closed listener_0))))
(define poll-listener
  (lambda (l_0 ctx_0)
    (if (unbox (tcp-listener-closed l_0))
      (values (list l_0) #f)
      (if (eqv?
           (|#%app|
            rktio_poll_accept_ready
            (unsafe-place-local-ref cell.1)
            (tcp-listener-lnr l_0))
           1)
        (values (list l_0) #f)
        (begin
          (sandman-poll-ctx-add-poll-set-adder!
           ctx_0
           (lambda (ps_0)
             (|#%app|
              rktio_poll_add_accept
              (unsafe-place-local-ref cell.1)
              (tcp-listener-lnr l_0)
              ps_0)))
          (values #f l_0))))))
(define 1/tcp-accept
  (|#%name|
   tcp-accept
   (lambda (listener_0) (do-tcp-accept.1 #f 'tcp-accept listener_0))))
(define 1/tcp-accept/enable-break
  (|#%name|
   tcp-accept/enable-break
   (lambda (listener_0)
     (do-tcp-accept.1 #t 'tcp-accept/enable-break listener_0))))
(define do-tcp-accept.1
  (|#%name|
   do-tcp-accept
   (lambda (enable-break?1_0 who3_0 listener4_0)
     (begin
       (if (1/tcp-listener? listener4_0)
         (void)
         (raise-argument-error who3_0 "tcp-listener?" listener4_0))
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda ()
             (begin
               (unsafe-start-atomic)
               (if (unbox (tcp-listener-closed listener4_0))
                 (closed-error who3_0 listener4_0)
                 (if (accept-ready? listener4_0)
                   (begin
                     (check-current-custodian who3_0)
                     (let ((fd_0
                            (|#%app|
                             rktio_accept
                             (unsafe-place-local-ref cell.1)
                             (tcp-listener-lnr listener4_0))))
                       (if (vector? fd_0)
                         (begin
                           (unsafe-end-atomic)
                           (raise-network-error
                            who3_0
                            fd_0
                            "accept from listener failed"))
                         (begin0
                           (open-input-output-accepted-tcp fd_0)
                           (unsafe-end-atomic)))))
                   (begin
                     (unsafe-end-atomic)
                     (|#%app|
                      (if enable-break?1_0 sync/enable-break sync)
                      (rktio-evt1.1
                       (lambda ()
                         (let ((or-part_0
                                (unbox (tcp-listener-closed listener4_0))))
                           (if or-part_0
                             or-part_0
                             (accept-ready? listener4_0))))
                       (lambda (ps_0)
                         (|#%app|
                          rktio_poll_add_accept
                          (unsafe-place-local-ref cell.1)
                          (tcp-listener-lnr listener4_0)
                          ps_0))))
                     (loop_0)))))))))
        (loop_0))))))
(define 1/tcp-accept-ready?
  (|#%name|
   tcp-accept-ready?
   (lambda (listener_0)
     (begin
       (if (1/tcp-listener? listener_0)
         (void)
         (raise-argument-error 'tcp-accept-ready? "tcp-listener?" listener_0))
       (unsafe-start-atomic)
       (if (unbox (tcp-listener-closed listener_0))
         (closed-error 'tcp-accept-ready? listener_0)
         (begin0 (accept-ready? listener_0) (unsafe-end-atomic)))))))
(define 1/tcp-accept-evt
  (|#%name|
   tcp-accept-evt
   (lambda (listener_0)
     (begin
       (if (1/tcp-listener? listener_0)
         (void)
         (raise-argument-error 'tcp-accept-evt "tcp-listener?" listener_0))
       (accept-evt6.1 listener_0)))))
(define finish_2779
  (make-struct-type-install-properties
   '(tcp-accept-evt)
   1
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (self_0 poll-ctx_0)
        (let ((listener_0 (accept-evt-listener self_0)))
          (if (unbox (tcp-listener-closed listener_0))
            (error-result
             (lambda ()
               (begin
                 (unsafe-start-atomic)
                 (closed-error 'tcp-accept-evt listener_0))))
            (if (custodian-shut-down? (current-custodian))
              (let ((c_0 (current-custodian)))
                (error-result
                 (lambda ()
                   (begin
                     (unsafe-start-atomic)
                     (with-continuation-mark*
                      authentic
                      parameterization-key
                      (extend-parameterization
                       (continuation-mark-set-first #f parameterization-key)
                       current-custodian
                       c_0)
                      (check-current-custodian 'tcp-accept-evt))))))
              (if (accept-ready? listener_0)
                (let ((fd_0
                       (|#%app|
                        rktio_accept
                        (unsafe-place-local-ref cell.1)
                        (tcp-listener-lnr listener_0))))
                  (if (vector? fd_0)
                    (begin
                      (unsafe-end-atomic)
                      (error-result
                       (lambda ()
                         (raise-network-error
                          'tcp-accept-evt
                          fd_0
                          "accept from listener failed"))))
                    (values
                     (list
                      (call-with-values
                       (lambda () (open-input-output-accepted-tcp fd_0))
                       list))
                     #f)))
                (let ((sched-info_0 (|#%app| poll-ctx-sched-info poll-ctx_0)))
                  (begin
                    (if sched-info_0
                      (|#%app|
                       schedule-info-current-exts
                       sched-info_0
                       (sandman-add-poll-set-adder
                        (|#%app| schedule-info-current-exts sched-info_0)
                        (lambda (ps_0)
                          (|#%app|
                           rktio_poll_add_accept
                           (unsafe-place-local-ref cell.1)
                           (tcp-listener-lnr listener_0)
                           ps_0))))
                      (void))
                    (values #f self_0)))))))))))
   (current-inspector)
   #f
   '(0)
   #f
   'accept-evt))
(define struct:accept-evt
  (make-record-type-descriptor
   'tcp-accept-evt
   #f
   (|#%nongenerative-uid| tcp-accept-evt)
   #f
   #f
   '(1 . 0)))
(define effect_2608 (finish_2779 struct:accept-evt))
(define accept-evt6.1
  (|#%name|
   accept-evt
   (record-constructor
    (make-record-constructor-descriptor struct:accept-evt #f #f))))
(define accept-evt?_2605
  (|#%name| tcp-accept-evt? (record-predicate struct:accept-evt)))
(define accept-evt?
  (|#%name|
   tcp-accept-evt?
   (lambda (v)
     (if (accept-evt?_2605 v)
       #t
       ($value
        (if (impersonator? v) (accept-evt?_2605 (impersonator-val v)) #f))))))
(define accept-evt-listener_2406
  (|#%name| tcp-accept-evt-listener (record-accessor struct:accept-evt 0)))
(define accept-evt-listener
  (|#%name|
   tcp-accept-evt-listener
   (lambda (s)
     (if (accept-evt?_2605 s)
       (accept-evt-listener_2406 s)
       ($value
        (impersonate-ref
         accept-evt-listener_2406
         struct:accept-evt
         0
         s
         'listener))))))
(define error-result
  (lambda (thunk_0)
    (values #f (wrap-evt always-evt (lambda (v_0) (|#%app| thunk_0))))))
(define accept-ready?
  (lambda (listener_0)
    (not
     (eqv?
      (|#%app|
       rktio_poll_accept_ready
       (unsafe-place-local-ref cell.1)
       (tcp-listener-lnr listener_0))
      0))))
(define closed-error
  (lambda (who_0 listener_0)
    (begin
      (unsafe-end-atomic)
      (raise-arguments-error
       who_0
       "listener is closed"
       "listener"
       listener_0))))
(define open-input-output-accepted-tcp
  (lambda (fd_0)
    (begin
      (|#%app| rktio_tcp_nodelay (unsafe-place-local-ref cell.1) fd_0 #t)
      (let ((temp18_0 "tcp-accepted"))
        (open-input-output-tcp.1 #t fd_0 temp18_0)))))
(define string->integer
  (lambda (s_0)
    (call-with-values
     (lambda () (values s_0 (unsafe-string-length s_0)))
     (lambda (vec_0 len_0)
       (letrec*
        ((for-loop_0
          (|#%name|
           for-loop
           (lambda (v_0 pos_0)
             (if (unsafe-fx< pos_0 len_0)
               (let ((c_0 (string-ref vec_0 pos_0)))
                 (let ((v_1
                        (let ((v_1
                               (let ((app_0 (* v_0 10)))
                                 (+ app_0 (- (char->integer c_0) 48)))))
                          (values v_1))))
                   (for-loop_0 v_1 (unsafe-fx+ 1 pos_0))))
               v_0)))))
        (for-loop_0 0 0))))))
(define finish_2442
  (make-struct-type-install-properties
   '(udp)
   4
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'udp))
(define struct:udp
  (make-record-type-descriptor
   'udp
   #f
   (|#%nongenerative-uid| udp)
   #f
   #f
   '(4 . 15)))
(define effect_2743 (finish_2442 struct:udp))
(define udp1.1
  (|#%name|
   udp
   (record-constructor (make-record-constructor-descriptor struct:udp #f #f))))
(define 1/udp? (|#%name| udp? (record-predicate struct:udp)))
(define udp-s-box (|#%name| udp-s-box (record-accessor struct:udp 0)))
(define udp-is-bound? (|#%name| udp-is-bound? (record-accessor struct:udp 1)))
(define udp-is-connected?
  (|#%name| udp-is-connected? (record-accessor struct:udp 2)))
(define udp-custodian-reference
  (|#%name| udp-custodian-reference (record-accessor struct:udp 3)))
(define set-udp-s-box! (|#%name| set-udp-s-box! (record-mutator struct:udp 0)))
(define set-udp-is-bound?!
  (|#%name| set-udp-is-bound?! (record-mutator struct:udp 1)))
(define set-udp-is-connected?!
  (|#%name| set-udp-is-connected?! (record-mutator struct:udp 2)))
(define set-udp-custodian-reference!
  (|#%name| set-udp-custodian-reference! (record-mutator struct:udp 3)))
(define udp-s (lambda (u_0) (unbox (udp-s-box u_0))))
(define 1/udp-open-socket
  (let ((udp-open-socket_0
         (|#%name|
          udp-open-socket
          (lambda (family-hostname2_0 family-port-no3_0)
            (begin
              (if (let ((or-part_0 (not family-hostname2_0)))
                    (if or-part_0 or-part_0 (string? family-hostname2_0)))
                (void)
                (raise-argument-error
                 'udp-open-socket
                 "(or/c string? #f)"
                 family-hostname2_0))
              (if (let ((or-part_0 (not family-port-no3_0)))
                    (if or-part_0 or-part_0 (port-number? family-port-no3_0)))
                (void)
                (raise-argument-error
                 'udp-open-socket
                 "(or/c port-number? #f)"
                 family-port-no3_0))
              (1/security-guard-check-network
               'udp-open-socket
               family-hostname2_0
               family-port-no3_0
               'server)
              (unsafe-start-atomic)
              (begin0
                (let ((temp21_0
                       (lambda (addr_0)
                         (begin
                           (check-current-custodian 'udp-open-socket)
                           (let ((s_0
                                  (|#%app|
                                   rktio_udp_open
                                   (unsafe-place-local-ref cell.1)
                                   addr_0
                                   (udp-default-family))))
                             (if (vector? s_0)
                               (begin
                                 (unsafe-end-atomic)
                                 (raise-network-error
                                  'udp-open-socket
                                  s_0
                                  "creation failed"))
                               (let ((s-box_0 (box s_0)))
                                 (let ((custodian-reference_0
                                        (|#%app|
                                         1/unsafe-custodian-register
                                         (current-custodian)
                                         s-box_0
                                         (lambda (s-box_1)
                                           (do-udp-close s-box_1))
                                         #f
                                         #f)))
                                   (udp1.1
                                    s-box_0
                                    #f
                                    #f
                                    custodian-reference_0)))))))))
                  (call-with-resolved-address.1
                   #f
                   unsafe-undefined
                   #f
                   #t
                   #f
                   #f
                   ""
                   'udp-open-socket
                   family-hostname2_0
                   family-port-no3_0
                   temp21_0))
                (unsafe-end-atomic)))))))
    (|#%name|
     udp-open-socket
     (case-lambda
      (() (udp-open-socket_0 #f #f))
      ((family-hostname_0 family-port-no3_0)
       (udp-open-socket_0 family-hostname_0 family-port-no3_0))
      ((family-hostname2_0) (udp-open-socket_0 family-hostname2_0 #f))))))
(define do-udp-close
  (lambda (s-box_0)
    (let ((s_0 (unbox s-box_0)))
      (if s_0
        (begin
          (|#%app| rktio_close (unsafe-place-local-ref cell.1) s_0)
          (set-box! s-box_0 #f))
        (void)))))
(define 1/udp-close
  (|#%name|
   udp-close
   (lambda (u_0)
     (begin
       (if (1/udp? u_0) (void) (raise-argument-error 'udp-close "udp?" u_0))
       (unsafe-start-atomic)
       (begin0
         (if (unbox (udp-s-box u_0))
           (let ((s-box_0 (udp-s-box u_0)))
             (begin
               (do-udp-close s-box_0)
               (|#%app|
                1/unsafe-custodian-unregister
                s-box_0
                (udp-custodian-reference u_0))))
           (begin
             (unsafe-end-atomic)
             (raise-network-arguments-error
              'udp-close
              "udp socket was already closed"
              "socket"
              u_0)))
         (unsafe-end-atomic))))))
(define 1/udp-bound?
  (|#%name|
   udp-bound?
   (lambda (u_0)
     (begin
       (if (1/udp? u_0) (void) (raise-argument-error 'udp-bound? "udp?" u_0))
       (udp-is-bound? u_0)))))
(define 1/udp-bind!
  (let ((udp-bind!_0
         (|#%name|
          udp-bind!
          (lambda (u5_0 hostname6_0 port-no7_0 reuse?4_0)
            (begin
              (if (1/udp? u5_0)
                (void)
                (raise-argument-error 'udp-bind! "udp?" u5_0))
              (if (let ((or-part_0 (not hostname6_0)))
                    (if or-part_0 or-part_0 (string? hostname6_0)))
                (void)
                (raise-argument-error
                 'udp-bind!
                 "(or/c string? #f)"
                 hostname6_0))
              (if (listen-port-number? port-no7_0)
                (void)
                (raise-argument-error
                 'udp-bind!
                 "listen-port-number?"
                 port-no7_0))
              (1/security-guard-check-network
               'udp-bind!
               hostname6_0
               port-no7_0
               'server)
              (unsafe-start-atomic)
              (begin0
                (let ((temp30_0
                       (lambda (addr_0)
                         (begin
                           (check-udp-closed.1
                            void
                            unsafe-undefined
                            'udp-bind!
                            u5_0)
                           (begin
                             (if (udp-is-bound? u5_0)
                               (begin
                                 (unsafe-end-atomic)
                                 (raise-arguments-error
                                  'udp-bind!
                                  "udp socket is already bound"
                                  "socket"
                                  u5_0))
                               (void))
                             (let ((b_0
                                    (|#%app|
                                     rktio_udp_bind
                                     (unsafe-place-local-ref cell.1)
                                     (unbox (udp-s-box u5_0))
                                     addr_0
                                     reuse?4_0)))
                               (begin
                                 (if (vector? b_0)
                                   (begin
                                     (unsafe-end-atomic)
                                     (raise-network-error
                                      'udp-bind!
                                      b_0
                                      (string-append
                                       "can't bind"
                                       (if reuse?4_0 " as reusable" "")
                                       "\n  address: "
                                       (if hostname6_0 hostname6_0 "<unspec>")
                                       "\n  port number: "
                                       (number->string port-no7_0))))
                                   (void))
                                 (set-udp-is-bound?! u5_0 #t))))))))
                  (call-with-resolved-address.1
                   #f
                   unsafe-undefined
                   #t
                   #t
                   #f
                   #f
                   ""
                   'udp-bind!
                   hostname6_0
                   port-no7_0
                   temp30_0))
                (unsafe-end-atomic)))))))
    (|#%name|
     udp-bind!
     (case-lambda
      ((u_0 hostname_0 port-no_0) (udp-bind!_0 u_0 hostname_0 port-no_0 #f))
      ((u_0 hostname_0 port-no_0 reuse?4_0)
       (udp-bind!_0 u_0 hostname_0 port-no_0 reuse?4_0))))))
(define 1/udp-connected?
  (|#%name|
   udp-connected?
   (lambda (u_0)
     (begin
       (if (1/udp? u_0)
         (void)
         (raise-argument-error 'udp-connected? "udp?" u_0))
       (udp-is-connected? u_0)))))
(define 1/udp-connect!
  (|#%name|
   udp-connect!
   (lambda (u_0 hostname_0 port-no_0)
     (begin
       (if (1/udp? u_0) (void) (raise-argument-error 'udp-connect! "udp?" u_0))
       (if (let ((or-part_0 (not hostname_0)))
             (if or-part_0 or-part_0 (string? hostname_0)))
         (void)
         (raise-argument-error 'udp-connect! "(or/c string? #f)" hostname_0))
       (if (let ((or-part_0 (not port-no_0)))
             (if or-part_0 or-part_0 (port-number? port-no_0)))
         (void)
         (raise-argument-error
          'udp-connect!
          "(or/c port-number? #f)"
          port-no_0))
       (if (eq? (not hostname_0) (not port-no_0))
         (void)
         (raise-arguments-error
          'udp-connect!
          "last second and third arguments must be both #f or both non-#f"
          "second argument"
          hostname_0
          "third argument"
          port-no_0))
       (1/security-guard-check-network
        'udp-connect!
        hostname_0
        port-no_0
        'client)
       (unsafe-start-atomic)
       (begin0
         (if (not hostname_0)
           (begin
             (check-udp-closed.1 void unsafe-undefined 'udp-connect! u_0)
             (if (udp-is-connected? u_0)
               (let ((d_0
                      (|#%app|
                       rktio_udp_disconnect
                       (unsafe-place-local-ref cell.1)
                       (unbox (udp-s-box u_0)))))
                 (begin
                   (if (vector? d_0)
                     (begin
                       (unsafe-end-atomic)
                       (raise-network-error
                        'udp-connect!
                        d_0
                        "can't disconnect"))
                     (void))
                   (set-udp-is-connected?! u_0 #f)))
               (void)))
           (let ((temp41_0
                  (lambda (addr_0)
                    (begin
                      (check-udp-closed.1
                       void
                       unsafe-undefined
                       'udp-connect!
                       u_0)
                      (let ((c_0
                             (|#%app|
                              rktio_udp_connect
                              (unsafe-place-local-ref cell.1)
                              (unbox (udp-s-box u_0))
                              addr_0)))
                        (begin
                          (if (vector? c_0)
                            (begin
                              (unsafe-end-atomic)
                              (raise-network-error
                               'udp-connect!
                               c_0
                               (string-append
                                "can't connect"
                                "\n  address: "
                                hostname_0
                                "\n  port number: "
                                (number->string port-no_0))))
                            (void))
                          (set-udp-is-connected?! u_0 #t)))))))
             (call-with-resolved-address.1
              #f
              unsafe-undefined
              #f
              #t
              #f
              #f
              ""
              'udp-connect!
              hostname_0
              port-no_0
              temp41_0)))
         (unsafe-end-atomic))))))
(define check-udp-closed.1
  (|#%name|
   check-udp-closed
   (lambda (continue9_0 handle-error8_0 who12_0 u13_0)
     (let ((handle-error_0
            (if (eq? handle-error8_0 unsafe-undefined)
              handle-error-immediately
              handle-error8_0)))
       (if (unbox (udp-s-box u13_0))
         (|#%app| continue9_0)
         (|#%app|
          handle-error_0
          (lambda ()
            (raise-network-arguments-error
             who12_0
             "udp socket is closed"
             "socket"
             u13_0))))))))
(define handle-error-immediately
  (lambda (thunk_0) (begin (unsafe-end-atomic) (|#%app| thunk_0))))
(define udp-default-family
  (lambda () (|#%app| rktio_get_ipv4_family (unsafe-place-local-ref cell.1))))
(define 1/udp-ttl
  (|#%name|
   udp-ttl
   (lambda (u_0)
     (begin
       (if (1/udp? u_0) (void) (raise-argument-error 'udp-ttl "udp?" u_0))
       (unsafe-start-atomic)
       (begin0
         (begin
           (check-udp-closed.1 void unsafe-undefined 'udp-ttl u_0)
           (let ((v_0
                  (|#%app|
                   rktio_udp_get_ttl
                   (unsafe-place-local-ref cell.1)
                   (unbox (udp-s-box u_0)))))
             (if (vector? v_0)
               (begin
                 (unsafe-end-atomic)
                 (let ((mode_0 "get"))
                   (raise-network-error
                    'udp-ttl
                    v_0
                    (string-append mode_0 "sockopt failed"))))
               v_0)))
         (unsafe-end-atomic))))))
(define 1/udp-set-ttl!
  (|#%name|
   udp-set-ttl!
   (lambda (u_0 ttl_0)
     (begin
       (if (1/udp? u_0) (void) (raise-argument-error 'udp-set-ttl! "udp?" u_0))
       (if (byte? ttl_0)
         (void)
         (raise-argument-error 'udp-set-ttl! "byte?" ttl_0))
       (unsafe-start-atomic)
       (begin0
         (begin
           (check-udp-closed.1 void unsafe-undefined 'udp-set-ttl! u_0)
           (let ((r_0
                  (|#%app|
                   rktio_udp_set_ttl
                   (unsafe-place-local-ref cell.1)
                   (unbox (udp-s-box u_0))
                   ttl_0)))
             (if (vector? r_0)
               (begin
                 (unsafe-end-atomic)
                 (let ((mode_0 "set"))
                   (raise-network-error
                    'udp-set-ttl!
                    r_0
                    (string-append mode_0 "sockopt failed"))))
               (void))))
         (unsafe-end-atomic))))))
(define 1/tcp-addresses
  (let ((tcp-addresses_0
         (|#%name|
          tcp-addresses
          (lambda (p2_0 port-numbers?1_0)
            (begin
              (if (let ((or-part_0 (1/tcp-port? p2_0)))
                    (if or-part_0
                      or-part_0
                      (let ((or-part_1 (1/tcp-listener? p2_0)))
                        (if or-part_1 or-part_1 (1/udp? p2_0)))))
                (void)
                (raise-argument-error
                 'tcp-addresses
                 "(or/c tcp-port? tcp-listener? udp?)"
                 p2_0))
              (begin
                (unsafe-start-atomic)
                (call-with-values
                 (lambda ()
                   (if (1/tcp-listener? p2_0)
                     (if (unbox (tcp-listener-closed p2_0))
                       (begin
                         (unsafe-end-atomic)
                         (raise-arguments-error
                          'tcp-addresses
                          "listener is closed"
                          "listener"
                          p2_0))
                       (values
                        (|#%app|
                         rktio_listener_address
                         (unsafe-place-local-ref cell.1)
                         (tcp-listener-lnr p2_0))
                        #f))
                     (let ((fd_0
                            (if (1/udp? p2_0)
                              (begin
                                (check-udp-closed.1
                                 void
                                 unsafe-undefined
                                 'tcp-addresses
                                 p2_0)
                                (unbox (udp-s-box p2_0)))
                              (if (1/port-closed? p2_0)
                                (begin
                                  (unsafe-end-atomic)
                                  (raise-arguments-error
                                   'tcp-addresses
                                   "port is closed"
                                   "port"
                                   p2_0))
                                (fd-port-fd p2_0)))))
                       (let ((app_0
                              (|#%app|
                               rktio_socket_address
                               (unsafe-place-local-ref cell.1)
                               fd_0)))
                         (values
                          app_0
                          (|#%app|
                           rktio_socket_peer_address
                           (unsafe-place-local-ref cell.1)
                           fd_0))))))
                 (lambda (local-address_0 peer-address_0)
                   (let ((local-address-bytes_0
                          (if (not (vector? local-address_0))
                            (|#%app| rktio_to_bytes_list local-address_0 2)
                            #f)))
                     (let ((peer-address-bytes_0
                            (if peer-address_0
                              (if (not (vector? peer-address_0))
                                (|#%app| rktio_to_bytes_list peer-address_0 2)
                                #f)
                              #f)))
                       (begin
                         (unsafe-end-atomic)
                         (begin
                           (if (vector? local-address_0)
                             (raise-network-error
                              'tcp-addresses
                              local-address_0
                              "could not get address")
                             (void))
                           (begin
                             (if (if (vector? peer-address_0)
                                   (not (1/udp? p2_0))
                                   #f)
                               (raise-network-error
                                'tcp-addresses
                                peer-address_0
                                "could not get peer address")
                               (void))
                             (let ((convert_0
                                    (|#%name|
                                     convert
                                     (lambda (bstr_0)
                                       (1/bytes->string/utf-8
                                        bstr_0
                                        '#\x3f)))))
                               (let ((local-hostname_0
                                      (convert_0 (car local-address-bytes_0))))
                                 (let ((peer-hostname_0
                                        (if peer-address-bytes_0
                                          (convert_0
                                           (car peer-address-bytes_0))
                                          "0.0.0.0")))
                                   (if port-numbers?1_0
                                     (let ((app_0
                                            (string->integer
                                             (convert_0
                                              (cadr local-address-bytes_0)))))
                                       (values
                                        local-hostname_0
                                        app_0
                                        peer-hostname_0
                                        (if peer-address-bytes_0
                                          (string->integer
                                           (convert_0
                                            (cadr peer-address-bytes_0)))
                                          0)))
                                     (values
                                      local-hostname_0
                                      peer-hostname_0))))))))))))))))))
    (|#%name|
     tcp-addresses
     (case-lambda
      ((p_0) (tcp-addresses_0 p_0 #f))
      ((p_0 port-numbers?1_0) (tcp-addresses_0 p_0 port-numbers?1_0))))))
(define check-bstr
  (lambda (who_0 bstr_0 start_0 end_0)
    (begin
      (if (bytes? bstr_0) (void) (raise-argument-error who_0 "bytes?" bstr_0))
      (begin
        (if (exact-nonnegative-integer? start_0)
          (void)
          (raise-argument-error who_0 "exact-nonnegative-integer?" start_0))
        (begin
          (if (exact-nonnegative-integer? end_0)
            (void)
            (raise-argument-error who_0 "exact-nonnegative-integer?" end_0))
          (let ((len_0 (unsafe-bytes-length bstr_0)))
            (begin
              (if (<= 0 start_0 len_0)
                (void)
                (raise-range-error
                 who_0
                 "byte string"
                 "starting "
                 start_0
                 bstr_0
                 0
                 len_0
                 #f))
              (if (<= start_0 end_0 len_0)
                (void)
                (raise-range-error
                 who_0
                 "byte string"
                 "ending "
                 end_0
                 bstr_0
                 0
                 len_0
                 start_0)))))))))
(define 1/udp-send
  (let ((udp-send_0
         (|#%name|
          udp-send
          (lambda (u3_0 bstr4_0 start1_0 end2_0)
            (let ((end_0
                   (if (eq? end2_0 unsafe-undefined)
                     (if (bytes? bstr4_0) (unsafe-bytes-length bstr4_0) #f)
                     end2_0)))
              (begin
                (check-send 'udp-send u3_0 bstr4_0 start1_0 end_0)
                (do-udp-send-to.1
                 #f
                 #t
                 'udp-send
                 u3_0
                 #f
                 #f
                 bstr4_0
                 start1_0
                 end_0)))))))
    (|#%name|
     udp-send
     (case-lambda
      ((u_0 bstr_0) (udp-send_0 u_0 bstr_0 0 unsafe-undefined))
      ((u_0 bstr_0 start_0 end2_0) (udp-send_0 u_0 bstr_0 start_0 end2_0))
      ((u_0 bstr_0 start1_0)
       (udp-send_0 u_0 bstr_0 start1_0 unsafe-undefined))))))
(define 1/udp-send*
  (let ((udp-send*_0
         (|#%name|
          udp-send*
          (lambda (u7_0 bstr8_0 start5_0 end6_0)
            (let ((end_0
                   (if (eq? end6_0 unsafe-undefined)
                     (if (bytes? bstr8_0) (unsafe-bytes-length bstr8_0) #f)
                     end6_0)))
              (begin
                (check-send 'udp-send* u7_0 bstr8_0 start5_0 end_0)
                (do-udp-send-to.1
                 #f
                 #f
                 'udp-send*
                 u7_0
                 #f
                 #f
                 bstr8_0
                 start5_0
                 end_0)))))))
    (|#%name|
     udp-send*
     (case-lambda
      ((u_0 bstr_0) (udp-send*_0 u_0 bstr_0 0 unsafe-undefined))
      ((u_0 bstr_0 start_0 end6_0) (udp-send*_0 u_0 bstr_0 start_0 end6_0))
      ((u_0 bstr_0 start5_0)
       (udp-send*_0 u_0 bstr_0 start5_0 unsafe-undefined))))))
(define 1/udp-send/enable-break
  (let ((udp-send/enable-break_0
         (|#%name|
          udp-send/enable-break
          (lambda (u11_0 bstr12_0 start9_0 end10_0)
            (let ((end_0
                   (if (eq? end10_0 unsafe-undefined)
                     (if (bytes? bstr12_0) (unsafe-bytes-length bstr12_0) #f)
                     end10_0)))
              (begin
                (check-send
                 'udp-send/enable-break
                 u11_0
                 bstr12_0
                 start9_0
                 end_0)
                (do-udp-send-to.1
                 #t
                 #t
                 'udp-send/enable-break
                 u11_0
                 #f
                 #f
                 bstr12_0
                 start9_0
                 end_0)))))))
    (|#%name|
     udp-send/enable-break
     (case-lambda
      ((u_0 bstr_0) (udp-send/enable-break_0 u_0 bstr_0 0 unsafe-undefined))
      ((u_0 bstr_0 start_0 end10_0)
       (udp-send/enable-break_0 u_0 bstr_0 start_0 end10_0))
      ((u_0 bstr_0 start9_0)
       (udp-send/enable-break_0 u_0 bstr_0 start9_0 unsafe-undefined))))))
(define 1/udp-send-to
  (let ((udp-send-to_0
         (|#%name|
          udp-send-to
          (lambda (u15_0 hostname16_0 port-no17_0 bstr18_0 start13_0 end14_0)
            (let ((end_0
                   (if (eq? end14_0 unsafe-undefined)
                     (if (bytes? bstr18_0) (unsafe-bytes-length bstr18_0) #f)
                     end14_0)))
              (begin
                (check-send-to
                 'udp-send-to
                 u15_0
                 hostname16_0
                 port-no17_0
                 bstr18_0
                 start13_0
                 end_0)
                (do-udp-send-to.1
                 #f
                 #t
                 'udp-send-to
                 u15_0
                 hostname16_0
                 port-no17_0
                 bstr18_0
                 start13_0
                 end_0)))))))
    (|#%name|
     udp-send-to
     (case-lambda
      ((u_0 hostname_0 port-no_0 bstr_0)
       (udp-send-to_0 u_0 hostname_0 port-no_0 bstr_0 0 unsafe-undefined))
      ((u_0 hostname_0 port-no_0 bstr_0 start_0 end14_0)
       (udp-send-to_0 u_0 hostname_0 port-no_0 bstr_0 start_0 end14_0))
      ((u_0 hostname_0 port-no_0 bstr_0 start13_0)
       (udp-send-to_0
        u_0
        hostname_0
        port-no_0
        bstr_0
        start13_0
        unsafe-undefined))))))
(define 1/udp-send-to*
  (let ((udp-send-to*_0
         (|#%name|
          udp-send-to*
          (lambda (u21_0 hostname22_0 port-no23_0 bstr24_0 start19_0 end20_0)
            (let ((end_0
                   (if (eq? end20_0 unsafe-undefined)
                     (if (bytes? bstr24_0) (unsafe-bytes-length bstr24_0) #f)
                     end20_0)))
              (begin
                (check-send-to
                 'udp-send-to*
                 u21_0
                 hostname22_0
                 port-no23_0
                 bstr24_0
                 start19_0
                 end_0)
                (do-udp-send-to.1
                 #f
                 #f
                 'udp-send-to*
                 u21_0
                 hostname22_0
                 port-no23_0
                 bstr24_0
                 start19_0
                 end_0)))))))
    (|#%name|
     udp-send-to*
     (case-lambda
      ((u_0 hostname_0 port-no_0 bstr_0)
       (udp-send-to*_0 u_0 hostname_0 port-no_0 bstr_0 0 unsafe-undefined))
      ((u_0 hostname_0 port-no_0 bstr_0 start_0 end20_0)
       (udp-send-to*_0 u_0 hostname_0 port-no_0 bstr_0 start_0 end20_0))
      ((u_0 hostname_0 port-no_0 bstr_0 start19_0)
       (udp-send-to*_0
        u_0
        hostname_0
        port-no_0
        bstr_0
        start19_0
        unsafe-undefined))))))
(define 1/udp-send-to/enable-break
  (let ((udp-send-to/enable-break_0
         (|#%name|
          udp-send-to/enable-break
          (lambda (u27_0 hostname28_0 port-no29_0 bstr30_0 start25_0 end26_0)
            (let ((end_0
                   (if (eq? end26_0 unsafe-undefined)
                     (if (bytes? bstr30_0) (unsafe-bytes-length bstr30_0) #f)
                     end26_0)))
              (begin
                (check-send-to
                 'udp-send-to/enable-break
                 u27_0
                 hostname28_0
                 port-no29_0
                 bstr30_0
                 start25_0
                 end_0)
                (do-udp-send-to.1
                 #t
                 #t
                 'udp-send-to/enable-break
                 u27_0
                 hostname28_0
                 port-no29_0
                 bstr30_0
                 start25_0
                 end_0)))))))
    (|#%name|
     udp-send-to/enable-break
     (case-lambda
      ((u_0 hostname_0 port-no_0 bstr_0)
       (udp-send-to/enable-break_0
        u_0
        hostname_0
        port-no_0
        bstr_0
        0
        unsafe-undefined))
      ((u_0 hostname_0 port-no_0 bstr_0 start_0 end26_0)
       (udp-send-to/enable-break_0
        u_0
        hostname_0
        port-no_0
        bstr_0
        start_0
        end26_0))
      ((u_0 hostname_0 port-no_0 bstr_0 start25_0)
       (udp-send-to/enable-break_0
        u_0
        hostname_0
        port-no_0
        bstr_0
        start25_0
        unsafe-undefined))))))
(define 1/udp-send-evt
  (let ((udp-send-evt_0
         (|#%name|
          udp-send-evt
          (lambda (u33_0 bstr34_0 start31_0 end32_0)
            (let ((end_0
                   (if (eq? end32_0 unsafe-undefined)
                     (if (bytes? bstr34_0) (unsafe-bytes-length bstr34_0) #f)
                     end32_0)))
              (begin
                (check-send 'udp-send-evt u33_0 bstr34_0 start31_0 end_0)
                (do-udp-send-to-evt
                 'udp-send-evt
                 u33_0
                 #f
                 #f
                 bstr34_0
                 start31_0
                 end_0)))))))
    (|#%name|
     udp-send-evt
     (case-lambda
      ((u_0 bstr_0) (udp-send-evt_0 u_0 bstr_0 0 unsafe-undefined))
      ((u_0 bstr_0 start_0 end32_0)
       (udp-send-evt_0 u_0 bstr_0 start_0 end32_0))
      ((u_0 bstr_0 start31_0)
       (udp-send-evt_0 u_0 bstr_0 start31_0 unsafe-undefined))))))
(define 1/udp-send-to-evt
  (let ((udp-send-to-evt_0
         (|#%name|
          udp-send-to-evt
          (lambda (u37_0 hostname38_0 port-no39_0 bstr40_0 start35_0 end36_0)
            (let ((end_0
                   (if (eq? end36_0 unsafe-undefined)
                     (if (bytes? bstr40_0) (unsafe-bytes-length bstr40_0) #f)
                     end36_0)))
              (begin
                (check-send-to
                 'udp-send-to-evt
                 u37_0
                 hostname38_0
                 port-no39_0
                 bstr40_0
                 start35_0
                 end_0)
                (do-udp-send-to-evt
                 'udp-send-to-evt
                 u37_0
                 hostname38_0
                 port-no39_0
                 bstr40_0
                 start35_0
                 end_0)))))))
    (|#%name|
     udp-send-to-evt
     (case-lambda
      ((u_0 hostname_0 port-no_0 bstr_0)
       (udp-send-to-evt_0 u_0 hostname_0 port-no_0 bstr_0 0 unsafe-undefined))
      ((u_0 hostname_0 port-no_0 bstr_0 start_0 end36_0)
       (udp-send-to-evt_0 u_0 hostname_0 port-no_0 bstr_0 start_0 end36_0))
      ((u_0 hostname_0 port-no_0 bstr_0 start35_0)
       (udp-send-to-evt_0
        u_0
        hostname_0
        port-no_0
        bstr_0
        start35_0
        unsafe-undefined))))))
(define 1/udp-send-ready-evt
  (|#%name|
   udp-send-ready-evt
   (lambda (u_0)
     (begin
       (if (1/udp? u_0)
         (void)
         (raise-argument-error 'udp-send-ready-evt "udp?" u_0))
       (udp-sending-ready-evt67.1
        (lambda ()
          (let ((or-part_0 (not (unbox (udp-s-box u_0)))))
            (if or-part_0
              or-part_0
              (not
               (eqv?
                (|#%app|
                 rktio_poll_write_ready
                 (unsafe-place-local-ref cell.1)
                 (unbox (udp-s-box u_0)))
                0)))))
        (lambda (ps_0)
          (|#%app|
           rktio_poll_add
           (unsafe-place-local-ref cell.1)
           (unbox (udp-s-box u_0))
           ps_0
           2)))))))
(define check-send
  (lambda (who_0 u_0 bstr_0 start_0 end_0)
    (begin
      (if (1/udp? u_0) (void) (raise-argument-error who_0 "udp?" u_0))
      (check-bstr who_0 bstr_0 start_0 end_0))))
(define check-send-to
  (lambda (who_0 u_0 hostname_0 port-no_0 bstr_0 start_0 end_0)
    (begin
      (if (1/udp? u_0) (void) (raise-argument-error who_0 "udp?" u_0))
      (if (string? hostname_0)
        (void)
        (raise-argument-error who_0 "string?" hostname_0))
      (if (port-number? port-no_0)
        (void)
        (raise-argument-error who_0 "port-number?" port-no_0))
      (check-bstr who_0 bstr_0 start_0 end_0)
      (1/security-guard-check-network who_0 hostname_0 port-no_0 'client))))
(define do-udp-send-to.1
  (|#%name|
   do-udp-send-to
   (lambda (enable-break?42_0
            wait?41_0
            who45_0
            u46_0
            hostname47_0
            port-no48_0
            bstr49_0
            start50_0
            end51_0)
     (begin
       (unsafe-start-atomic)
       (begin0
         (let ((temp127_0
                (lambda (addr_0)
                  (do-udp-maybe-send-to-addr.1
                   enable-break?42_0
                   unsafe-undefined
                   wait?41_0
                   who45_0
                   u46_0
                   addr_0
                   bstr49_0
                   start50_0
                   end51_0))))
           (call-with-resolved-address.1
            #f
            unsafe-undefined
            #f
            #t
            #f
            #f
            ""
            who45_0
            hostname47_0
            port-no48_0
            temp127_0))
         (unsafe-end-atomic))))))
(define do-udp-send-to-evt
  (lambda (who_0 u_0 hostname_0 port-no_0 bstr_0 start_0 end_0)
    (begin
      (unsafe-start-atomic)
      (begin0
        (let ((temp141_0
               (lambda (addr_0)
                 (udp-sending-evt66.1
                  u_0
                  (lambda ()
                    (begin
                      (if addr_0 (register-address-finalizer addr_0) (void))
                      (let ((temp149_0 (lambda (thunk_0) thunk_0)))
                        (do-udp-maybe-send-to-addr.1
                         #f
                         temp149_0
                         #f
                         who_0
                         u_0
                         addr_0
                         bstr_0
                         start_0
                         end_0))))))))
          (call-with-resolved-address.1
           #f
           unsafe-undefined
           #f
           #t
           #t
           #f
           ""
           who_0
           hostname_0
           port-no_0
           temp141_0))
        (unsafe-end-atomic)))))
(define do-udp-maybe-send-to-addr.1
  (|#%name|
   do-udp-maybe-send-to-addr
   (lambda (enable-break?54_0
            handle-error55_0
            wait?53_0
            who59_0
            u60_0
            addr61_0
            bstr62_0
            start63_0
            end64_0)
     (let ((handle-error_0
            (if (eq? handle-error55_0 unsafe-undefined)
              handle-error-immediately
              handle-error55_0)))
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda ()
             (let ((temp153_0
                    (lambda ()
                      (if (if addr61_0 (1/udp-connected? u60_0) #f)
                        (|#%app|
                         handle-error_0
                         (lambda ()
                           (raise-network-arguments-error
                            who59_0
                            "udp socket is connected"
                            "socket"
                            u60_0)))
                        (if (if (not addr61_0)
                              (not (1/udp-connected? u60_0))
                              #f)
                          (|#%app|
                           handle-error_0
                           (lambda ()
                             (raise-network-arguments-error
                              who59_0
                              "udp socket is not connected"
                              "socket"
                              u60_0)))
                          (begin
                            (set-udp-is-bound?! u60_0 #t)
                            (let ((r_0
                                   (|#%app|
                                    rktio_udp_sendto_in
                                    (unsafe-place-local-ref cell.1)
                                    (unbox (udp-s-box u60_0))
                                    addr61_0
                                    bstr62_0
                                    start63_0
                                    end64_0)))
                              (if (vector? r_0)
                                (|#%app|
                                 handle-error_0
                                 (lambda ()
                                   (raise-network-error
                                    who59_0
                                    r_0
                                    "send failed")))
                                (if (eqv? r_0 0)
                                  (if (not wait?53_0)
                                    #f
                                    (begin
                                      (unsafe-end-atomic)
                                      (|#%app|
                                       (if enable-break?54_0
                                         sync/enable-break
                                         sync)
                                       (rktio-evt1.1
                                        (lambda ()
                                          (let ((or-part_0
                                                 (not
                                                  (unbox (udp-s-box u60_0)))))
                                            (if or-part_0
                                              or-part_0
                                              (not
                                               (eqv?
                                                (|#%app|
                                                 rktio_poll_write_ready
                                                 (unsafe-place-local-ref
                                                  cell.1)
                                                 (unbox (udp-s-box u60_0)))
                                                0)))))
                                        (lambda (ps_0)
                                          (|#%app|
                                           rktio_poll_add
                                           (unsafe-place-local-ref cell.1)
                                           (unbox (udp-s-box u60_0))
                                           ps_0
                                           2))))
                                      (unsafe-start-atomic)
                                      (loop_0)))
                                  (if (= r_0 (- end64_0 start63_0))
                                    (if wait?53_0 (void) #t)
                                    (|#%app|
                                     handle-error_0
                                     (lambda ()
                                       (raise
                                        (let ((app_0
                                               (let ((app_0
                                                      (symbol->string
                                                       who59_0)))
                                                 (string-append
                                                  app_0
                                                  ": didn't send enough"
                                                  "\n  requested bytes: "
                                                  (number->string
                                                   (- end64_0 start63_0))
                                                  "\n  sent bytes: "
                                                  r_0))))
                                          (|#%app|
                                           exn:fail:network
                                           app_0
                                           (current-continuation-marks))))))))))))))))
               (check-udp-closed.1 temp153_0 handle-error_0 who59_0 u60_0))))))
        (loop_0))))))
(define finish_2899
  (make-struct-type-install-properties
   '(udp-send-evt)
   2
   0
   #f
   (let ((app_0 (cons prop:authentic #t)))
     (list
      app_0
      (cons
       prop:evt
       (|#%app|
        poller
        (lambda (self_0 poll-ctx_0)
          (let ((try_0 (udp-sending-evt-try self_0)))
            (let ((r_0 (|#%app| try_0)))
              (if (procedure? r_0)
                (values #f (wrap-evt always-evt (lambda (v_0) (|#%app| r_0))))
                (if r_0
                  (values (list (void)) #f)
                  (begin
                    (sandman-poll-ctx-add-poll-set-adder!
                     poll-ctx_0
                     (lambda (ps_0)
                       (|#%app|
                        rktio_poll_add
                        (unsafe-place-local-ref cell.1)
                        (let ((u_0 (udp-sending-evt-u self_0)))
                          (unbox (udp-s-box u_0)))
                        ps_0
                        1)))
                    (values #f self_0)))))))))))
   (current-inspector)
   #f
   '(0 1)
   #f
   'udp-sending-evt))
(define struct:udp-sending-evt
  (make-record-type-descriptor
   'udp-send-evt
   #f
   (|#%nongenerative-uid| udp-send-evt)
   #f
   #f
   '(2 . 0)))
(define effect_2114 (finish_2899 struct:udp-sending-evt))
(define udp-sending-evt66.1
  (|#%name|
   udp-sending-evt
   (record-constructor
    (make-record-constructor-descriptor struct:udp-sending-evt #f #f))))
(define udp-sending-evt?
  (|#%name| udp-send-evt? (record-predicate struct:udp-sending-evt)))
(define udp-sending-evt-u
  (|#%name| udp-send-evt-u (record-accessor struct:udp-sending-evt 0)))
(define udp-sending-evt-try
  (|#%name| udp-send-evt-try (record-accessor struct:udp-sending-evt 1)))
(define finish_2617
  (make-struct-type-install-properties
   '(udp-send-ready-evt)
   0
   0
   struct:rktio-evt
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'udp-sending-ready-evt))
(define struct:udp-sending-ready-evt
  (make-record-type-descriptor
   'udp-send-ready-evt
   struct:rktio-evt
   (|#%nongenerative-uid| udp-send-ready-evt)
   #f
   #f
   '(0 . 0)))
(define effect_2524 (finish_2617 struct:udp-sending-ready-evt))
(define udp-sending-ready-evt67.1
  (|#%name|
   udp-sending-ready-evt
   (record-constructor
    (make-record-constructor-descriptor struct:udp-sending-ready-evt #f #f))))
(define udp-sending-ready-evt?
  (|#%name|
   udp-send-ready-evt?
   (record-predicate struct:udp-sending-ready-evt)))
(define 1/udp-receive!
  (let ((udp-receive!_0
         (|#%name|
          udp-receive!
          (lambda (u3_0 bstr4_0 start1_0 end2_0)
            (let ((end_0
                   (if (eq? end2_0 unsafe-undefined)
                     (if (bytes? bstr4_0) (unsafe-bytes-length bstr4_0) #f)
                     end2_0)))
              (do-udp-receive!.1
               #f
               #t
               'udp-receive!
               u3_0
               bstr4_0
               start1_0
               end_0))))))
    (|#%name|
     udp-receive!
     (case-lambda
      ((u_0 bstr_0) (udp-receive!_0 u_0 bstr_0 0 unsafe-undefined))
      ((u_0 bstr_0 start_0 end2_0) (udp-receive!_0 u_0 bstr_0 start_0 end2_0))
      ((u_0 bstr_0 start1_0)
       (udp-receive!_0 u_0 bstr_0 start1_0 unsafe-undefined))))))
(define 1/udp-receive!*
  (let ((udp-receive!*_0
         (|#%name|
          udp-receive!*
          (lambda (u7_0 bstr8_0 start5_0 end6_0)
            (let ((end_0
                   (if (eq? end6_0 unsafe-undefined)
                     (if (bytes? bstr8_0) (unsafe-bytes-length bstr8_0) #f)
                     end6_0)))
              (do-udp-receive!.1
               #f
               #f
               'udp-receive!*
               u7_0
               bstr8_0
               start5_0
               end_0))))))
    (|#%name|
     udp-receive!*
     (case-lambda
      ((u_0 bstr_0) (udp-receive!*_0 u_0 bstr_0 0 unsafe-undefined))
      ((u_0 bstr_0 start_0 end6_0) (udp-receive!*_0 u_0 bstr_0 start_0 end6_0))
      ((u_0 bstr_0 start5_0)
       (udp-receive!*_0 u_0 bstr_0 start5_0 unsafe-undefined))))))
(define 1/udp-receive!/enable-break
  (let ((udp-receive!/enable-break_0
         (|#%name|
          udp-receive!/enable-break
          (lambda (u11_0 bstr12_0 start9_0 end10_0)
            (let ((end_0
                   (if (eq? end10_0 unsafe-undefined)
                     (if (bytes? bstr12_0) (unsafe-bytes-length bstr12_0) #f)
                     end10_0)))
              (do-udp-receive!.1
               #t
               #t
               'udp-receive!/enable-break
               u11_0
               bstr12_0
               start9_0
               end_0))))))
    (|#%name|
     udp-receive!/enable-break
     (case-lambda
      ((u_0 bstr_0)
       (udp-receive!/enable-break_0 u_0 bstr_0 0 unsafe-undefined))
      ((u_0 bstr_0 start_0 end10_0)
       (udp-receive!/enable-break_0 u_0 bstr_0 start_0 end10_0))
      ((u_0 bstr_0 start9_0)
       (udp-receive!/enable-break_0 u_0 bstr_0 start9_0 unsafe-undefined))))))
(define do-udp-receive!.1
  (|#%name|
   do-udp-receive!
   (lambda (enable-break?14_0
            wait?13_0
            who17_0
            u18_0
            bstr19_0
            start20_0
            end21_0)
     (begin
       (check-receive! who17_0 u18_0 bstr19_0 start20_0 end21_0)
       (unsafe-start-atomic)
       (begin0
         (do-udp-maybe-receive!.1
          enable-break?14_0
          unsafe-undefined
          wait?13_0
          who17_0
          u18_0
          bstr19_0
          start20_0
          end21_0)
         (unsafe-end-atomic))))))
(define 1/udp-receive!-evt
  (let ((udp-receive!-evt_0
         (|#%name|
          udp-receive!-evt
          (lambda (u25_0 bstr26_0 start23_0 end24_0)
            (let ((end_0
                   (if (eq? end24_0 unsafe-undefined)
                     (if (bytes? bstr26_0) (unsafe-bytes-length bstr26_0) #f)
                     end24_0)))
              (begin
                (check-receive!
                 'udp-receive!-evt
                 u25_0
                 bstr26_0
                 start23_0
                 end_0)
                (udp-receiving-evt39.1
                 u25_0
                 (lambda ()
                   (let ((temp75_0 (lambda (thunk_0) thunk_0)))
                     (do-udp-maybe-receive!.1
                      #f
                      temp75_0
                      #f
                      'udp-receive!-evt
                      u25_0
                      bstr26_0
                      start23_0
                      end_0))))))))))
    (|#%name|
     udp-receive!-evt
     (case-lambda
      ((u_0 bstr_0) (udp-receive!-evt_0 u_0 bstr_0 0 unsafe-undefined))
      ((u_0 bstr_0 start_0 end24_0)
       (udp-receive!-evt_0 u_0 bstr_0 start_0 end24_0))
      ((u_0 bstr_0 start23_0)
       (udp-receive!-evt_0 u_0 bstr_0 start23_0 unsafe-undefined))))))
(define 1/udp-receive-ready-evt
  (|#%name|
   udp-receive-ready-evt
   (lambda (u_0)
     (begin
       (if (1/udp? u_0)
         (void)
         (raise-argument-error 'udp-receive-ready-evt "udp?" u_0))
       (udp-receiving-ready-evt40.1
        (lambda ()
          (let ((or-part_0 (not (unbox (udp-s-box u_0)))))
            (if or-part_0
              or-part_0
              (not
               (eqv?
                (|#%app|
                 rktio_poll_read_ready
                 (unsafe-place-local-ref cell.1)
                 (unbox (udp-s-box u_0)))
                0)))))
        (lambda (ps_0)
          (|#%app|
           rktio_poll_add
           (unsafe-place-local-ref cell.1)
           (unbox (udp-s-box u_0))
           ps_0
           1)))))))
(define check-receive!
  (lambda (who_0 u_0 bstr_0 start_0 end_0)
    (begin
      (if (1/udp? u_0) (void) (raise-argument-error who_0 "udp?" u_0))
      (check-bstr who_0 bstr_0 start_0 end_0))))
(define do-udp-maybe-receive!.1
  (|#%name|
   do-udp-maybe-receive!
   (lambda (enable-break?28_0
            handle-error29_0
            wait?27_0
            who33_0
            u34_0
            bstr35_0
            start36_0
            end37_0)
     (let ((handle-error_0
            (if (eq? handle-error29_0 unsafe-undefined)
              handle-error-immediately
              handle-error29_0)))
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda ()
             (let ((temp80_0
                    (lambda ()
                      (if (not (1/udp-bound? u34_0))
                        (|#%app|
                         handle-error_0
                         (lambda ()
                           (raise-network-arguments-error
                            who33_0
                            "udp socket is not bound"
                            "socket"
                            u34_0)))
                        (let ((r_0
                               (|#%app|
                                rktio_udp_recvfrom_in
                                (unsafe-place-local-ref cell.1)
                                (unbox (udp-s-box u34_0))
                                bstr35_0
                                start36_0
                                end37_0)))
                          (if (vector? r_0)
                            (if (let ((or-part_0 (racket-error? r_0 23)))
                                  (if or-part_0
                                    or-part_0
                                    (racket-error? r_0 22)))
                              (if wait?27_0
                                (begin
                                  (unsafe-end-atomic)
                                  (|#%app|
                                   (if enable-break?28_0
                                     sync/enable-break
                                     sync)
                                   (rktio-evt1.1
                                    (lambda ()
                                      (let ((or-part_0
                                             (not (unbox (udp-s-box u34_0)))))
                                        (if or-part_0
                                          or-part_0
                                          (not
                                           (eqv?
                                            (|#%app|
                                             rktio_poll_read_ready
                                             (unsafe-place-local-ref cell.1)
                                             (unbox (udp-s-box u34_0)))
                                            0)))))
                                    (lambda (ps_0)
                                      (|#%app|
                                       rktio_poll_add
                                       (unsafe-place-local-ref cell.1)
                                       (unbox (udp-s-box u34_0))
                                       ps_0
                                       1))))
                                  (unsafe-start-atomic)
                                  (loop_0))
                                (values #f #f #f))
                              (|#%app|
                               handle-error_0
                               (lambda ()
                                 (raise-network-error
                                  who33_0
                                  r_0
                                  "receive failed"))))
                            (let ((len_0 (|#%app| rktio_recv_length_ref r_0)))
                              (let ((address_0
                                     (|#%app|
                                      rktio_to_bytes_list
                                      (|#%app| rktio_recv_address_ref r_0)
                                      2)))
                                (begin
                                  (|#%app| rktio_free r_0)
                                  (let ((app_0
                                         (if (let ((app_0 (car address_0)))
                                               (bytes=?
                                                app_0
                                                (unsafe-place-local-ref
                                                 cell.1$2)))
                                           (unsafe-place-local-ref cell.2)
                                           (begin
                                             (unsafe-place-local-set!
                                              cell.1$2
                                              (car address_0))
                                             (unsafe-place-local-set!
                                              cell.2
                                              (string->immutable-string
                                               (1/bytes->string/utf-8
                                                (unsafe-place-local-ref
                                                 cell.1$2)
                                                '#\x3f)))
                                             (unsafe-place-local-ref
                                              cell.2)))))
                                    (values
                                     len_0
                                     app_0
                                     (string->integer
                                      (1/bytes->string/utf-8
                                       (cadr address_0))))))))))))))
               (check-udp-closed.1 temp80_0 handle-error_0 who33_0 u34_0))))))
        (loop_0))))))
(define cell.1$2 (unsafe-make-place-local #vu8()))
(define cell.2 (unsafe-make-place-local ""))
(define finish_2403
  (make-struct-type-install-properties
   '(udp-receive-evt)
   2
   0
   #f
   (let ((app_0 (cons prop:authentic #t)))
     (list
      app_0
      (cons
       prop:evt
       (|#%app|
        poller
        (lambda (self_0 poll-ctx_0)
          (let ((try_0 (udp-receiving-evt-try self_0)))
            (|#%call-with-values|
             try_0
             (case-lambda
              ((thunk_0)
               (values
                #f
                (wrap-evt always-evt (lambda (v_0) (|#%app| thunk_0)))))
              ((r_0 hostname_0 port-no_0)
               (if r_0
                 (values (list (list r_0 hostname_0 port-no_0)) #f)
                 (begin
                   (sandman-poll-ctx-add-poll-set-adder!
                    poll-ctx_0
                    (lambda (ps_0)
                      (|#%app|
                       rktio_poll_add
                       (unsafe-place-local-ref cell.1)
                       (let ((u_0 (udp-receiving-evt-u self_0)))
                         (unbox (udp-s-box u_0)))
                       ps_0
                       1)))
                   (values #f self_0))))))))))))
   (current-inspector)
   #f
   '(0 1)
   #f
   'udp-receiving-evt))
(define struct:udp-receiving-evt
  (make-record-type-descriptor
   'udp-receive-evt
   #f
   (|#%nongenerative-uid| udp-receive-evt)
   #f
   #f
   '(2 . 0)))
(define effect_2638 (finish_2403 struct:udp-receiving-evt))
(define udp-receiving-evt39.1
  (|#%name|
   udp-receiving-evt
   (record-constructor
    (make-record-constructor-descriptor struct:udp-receiving-evt #f #f))))
(define udp-receiving-evt?
  (|#%name| udp-receive-evt? (record-predicate struct:udp-receiving-evt)))
(define udp-receiving-evt-u
  (|#%name| udp-receive-evt-u (record-accessor struct:udp-receiving-evt 0)))
(define udp-receiving-evt-try
  (|#%name| udp-receive-evt-try (record-accessor struct:udp-receiving-evt 1)))
(define finish_2856
  (make-struct-type-install-properties
   '(udp-receive-ready-evt)
   0
   0
   struct:rktio-evt
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'udp-receiving-ready-evt))
(define struct:udp-receiving-ready-evt
  (make-record-type-descriptor
   'udp-receive-ready-evt
   struct:rktio-evt
   (|#%nongenerative-uid| udp-receive-ready-evt)
   #f
   #f
   '(0 . 0)))
(define effect_2865 (finish_2856 struct:udp-receiving-ready-evt))
(define udp-receiving-ready-evt40.1
  (|#%name|
   udp-receiving-ready-evt
   (record-constructor
    (make-record-constructor-descriptor
     struct:udp-receiving-ready-evt
     #f
     #f))))
(define udp-receiving-ready-evt?
  (|#%name|
   udp-receive-ready-evt?
   (record-predicate struct:udp-receiving-ready-evt)))
(define 1/udp-set-receive-buffer-size!
  (|#%name|
   udp-set-receive-buffer-size!
   (lambda (u_0 size_0)
     (begin
       (if (1/udp? u_0)
         (void)
         (raise-argument-error 'udp-set-receive-buffer-size! "udp?" u_0))
       (if (exact-positive-integer? size_0)
         (void)
         (raise-argument-error
          'udp-set-receive-buffer-size!
          "exact-positive-integer?"
          size_0))
       (unsafe-start-atomic)
       (begin0
         (begin
           (check-udp-closed.1
            void
            unsafe-undefined
            'udp-set-receive-buffer-size!
            u_0)
           (begin
             (if (fixnum? size_0)
               (void)
               (begin
                 (unsafe-end-atomic)
                 (raise-non-fixnum 'udp-set-receive-buffer-size! size_0)))
             (let ((r_0
                    (|#%app|
                     rktio_udp_set_receive_buffer_size
                     (unsafe-place-local-ref cell.1)
                     (unbox (udp-s-box u_0))
                     size_0)))
               (if (vector? r_0)
                 (raise-option-error$1 'udp-set-receive-buffer-size! "set" r_0)
                 (void)))))
         (unsafe-end-atomic))))))
(define raise-option-error$1
  (|#%name|
   raise-option-error
   (lambda (who_0 mode_0 v_0)
     (begin
       (unsafe-end-atomic)
       (raise-network-error
        who_0
        v_0
        (string-append mode_0 "sockopt failed"))))))
(define raise-non-fixnum
  (lambda (who_0 size_0)
    (raise
     (let ((app_0
            (let ((msg_0
                   (string-append
                    "given size is too large\n"
                    "  given size: "
                    (number->string size_0))))
              (error-message->adjusted-string
               who_0
               'racket/primitive
               msg_0
               'racket/primitive))))
       (|#%app| exn:fail:network app_0 (current-continuation-marks))))))
(define 1/udp-multicast-join-group!
  (|#%name|
   udp-multicast-join-group!
   (lambda (u_0 multicast-hostname_0 hostname_0)
     (do-udp-multicast-join-or-leave-group!
      'udp-multicast-join-group!
      0
      u_0
      multicast-hostname_0
      hostname_0))))
(define 1/udp-multicast-leave-group!
  (|#%name|
   udp-multicast-leave-group!
   (lambda (u_0 multicast-hostname_0 hostname_0)
     (do-udp-multicast-join-or-leave-group!
      'udp-multicast-leave-group!
      1
      u_0
      multicast-hostname_0
      hostname_0))))
(define do-udp-multicast-join-or-leave-group!
  (lambda (who_0 action_0 u_0 multicast-hostname_0 hostname_0)
    (begin
      (if (1/udp? u_0) (void) (raise-argument-error who_0 "udp?" u_0))
      (if (string? multicast-hostname_0)
        (void)
        (raise-argument-error who_0 "string?" multicast-hostname_0))
      (if (let ((or-part_0 (not hostname_0)))
            (if or-part_0 or-part_0 (string? hostname_0)))
        (void)
        (raise-argument-error who_0 "(or/c string? #f)" hostname_0))
      (unsafe-start-atomic)
      (begin0
        (let ((temp4_0 "multicast "))
          (let ((temp8_0 (udp-default-family)))
            (let ((temp10_0
                   (lambda (multicast-addr_0)
                     (let ((temp12_0 "interface "))
                       (let ((temp15_0 (if hostname_0 -1 #f)))
                         (let ((temp16_0 (udp-default-family)))
                           (let ((temp18_0
                                  (lambda (intf-addr_0)
                                    (begin
                                      (check-udp-closed.1
                                       void
                                       unsafe-undefined
                                       who_0
                                       u_0)
                                      (let ((v_0
                                             (|#%app|
                                              rktio_udp_change_multicast_group
                                              (unsafe-place-local-ref cell.1)
                                              (unbox (udp-s-box u_0))
                                              multicast-addr_0
                                              intf-addr_0
                                              action_0)))
                                        (if (vector? v_0)
                                          (let ((mode_0 "set"))
                                            (begin
                                              (unsafe-end-atomic)
                                              (raise-network-error
                                               who_0
                                               v_0
                                               (string-append
                                                mode_0
                                                "sockopt failed"))))
                                          (void)))))))
                             (let ((temp16_1 temp16_0)
                                   (temp15_1 temp15_0)
                                   (temp12_1 temp12_0))
                               (call-with-resolved-address.1
                                #f
                                temp16_1
                                #f
                                #f
                                #f
                                #f
                                temp12_1
                                who_0
                                hostname_0
                                temp15_1
                                temp18_0)))))))))
              (let ((temp8_1 temp8_0) (temp4_1 temp4_0))
                (call-with-resolved-address.1
                 #f
                 temp8_1
                 #f
                 #f
                 #f
                 #f
                 temp4_1
                 who_0
                 multicast-hostname_0
                 -1
                 temp10_0)))))
        (unsafe-end-atomic)))))
(define raise-option-error
  (lambda (who_0 mode_0 v_0)
    (begin
      (unsafe-end-atomic)
      (raise-network-error
       who_0
       v_0
       (string-append mode_0 "sockopt failed")))))
(define 1/udp-multicast-interface
  (|#%name|
   udp-multicast-interface
   (lambda (u_0)
     (begin
       (if (1/udp? u_0)
         (void)
         (raise-argument-error 'udp-multicast-interface "udp?" u_0))
       (begin
         (unsafe-start-atomic)
         (begin
           (check-udp-closed.1
            void
            unsafe-undefined
            'udp-multicast-interface
            u_0)
           (let ((v_0
                  (|#%app|
                   rktio_udp_multicast_interface
                   (unsafe-place-local-ref cell.1)
                   (unbox (udp-s-box u_0)))))
             (if (vector? v_0)
               (let ((mode_0 "get"))
                 (begin
                   (unsafe-end-atomic)
                   (raise-network-error
                    'udp-multicast-interface
                    v_0
                    (string-append mode_0 "sockopt failed"))))
               (let ((bstr_0 (|#%app| rktio_to_bytes v_0)))
                 (begin
                   (|#%app| rktio_free v_0)
                   (unsafe-end-atomic)
                   (1/bytes->string/utf-8 bstr_0)))))))))))
(define 1/udp-multicast-set-interface!
  (|#%name|
   udp-multicast-set-interface!
   (lambda (u_0 hostname_0)
     (begin
       (if (1/udp? u_0)
         (void)
         (raise-argument-error 'udp-multicast-set-interface! "udp?" u_0))
       (if (let ((or-part_0 (not hostname_0)))
             (if or-part_0 or-part_0 (string? hostname_0)))
         (void)
         (raise-argument-error
          'udp-multicast-set-interface!
          "(or/c string? #f)"
          hostname_0))
       (unsafe-start-atomic)
       (begin0
         (let ((temp28_0 (if hostname_0 -1 #f)))
           (let ((temp29_0 (udp-default-family)))
             (let ((temp31_0
                    (lambda (addr_0)
                      (begin
                        (check-udp-closed.1
                         void
                         unsafe-undefined
                         'udp-multicast-set-interface!
                         u_0)
                        (let ((r_0
                               (|#%app|
                                rktio_udp_set_multicast_interface
                                (unsafe-place-local-ref cell.1)
                                (unbox (udp-s-box u_0))
                                addr_0)))
                          (if (vector? r_0)
                            (let ((mode_0 "set"))
                              (begin
                                (unsafe-end-atomic)
                                (raise-network-error
                                 'udp-multicast-set-interface!
                                 r_0
                                 (string-append mode_0 "sockopt failed"))))
                            (void)))))))
               (let ((temp29_1 temp29_0) (temp28_1 temp28_0))
                 (call-with-resolved-address.1
                  #f
                  temp29_1
                  #f
                  #f
                  #f
                  #f
                  ""
                  'udp-multicast-set-interface!
                  hostname_0
                  temp28_1
                  temp31_0)))))
         (unsafe-end-atomic))))))
(define 1/udp-multicast-loopback?
  (|#%name|
   udp-multicast-loopback?
   (lambda (u_0)
     (begin
       (if (1/udp? u_0)
         (void)
         (raise-argument-error 'udp-multicast-loopback? "udp?" u_0))
       (unsafe-start-atomic)
       (begin0
         (begin
           (check-udp-closed.1
            void
            unsafe-undefined
            'udp-multicast-loopback?
            u_0)
           (let ((v_0
                  (|#%app|
                   rktio_udp_get_multicast_loopback
                   (unsafe-place-local-ref cell.1)
                   (unbox (udp-s-box u_0)))))
             (if (vector? v_0)
               (let ((mode_0 "get"))
                 (begin
                   (unsafe-end-atomic)
                   (raise-network-error
                    'udp-multicast-loopback?
                    v_0
                    (string-append mode_0 "sockopt failed"))))
               (not (zero? v_0)))))
         (unsafe-end-atomic))))))
(define 1/udp-multicast-set-loopback!
  (|#%name|
   udp-multicast-set-loopback!
   (lambda (u_0 loopback?_0)
     (begin
       (if (1/udp? u_0)
         (void)
         (raise-argument-error 'udp-multicast-set-loopback! "udp?" u_0))
       (unsafe-start-atomic)
       (begin0
         (begin
           (check-udp-closed.1
            void
            unsafe-undefined
            'udp-multicast-set-loopback!
            u_0)
           (let ((r_0
                  (|#%app|
                   rktio_udp_set_multicast_loopback
                   (unsafe-place-local-ref cell.1)
                   (unbox (udp-s-box u_0))
                   loopback?_0)))
             (if (vector? r_0)
               (let ((mode_0 "set"))
                 (begin
                   (unsafe-end-atomic)
                   (raise-network-error
                    'udp-multicast-set-loopback!
                    r_0
                    (string-append mode_0 "sockopt failed"))))
               (void))))
         (unsafe-end-atomic))))))
(define 1/udp-multicast-ttl
  (|#%name|
   udp-multicast-ttl
   (lambda (u_0)
     (begin
       (if (1/udp? u_0)
         (void)
         (raise-argument-error 'udp-multicast-ttl "udp?" u_0))
       (unsafe-start-atomic)
       (begin0
         (begin
           (check-udp-closed.1 void unsafe-undefined 'udp-multicast-ttl u_0)
           (let ((v_0
                  (|#%app|
                   rktio_udp_get_multicast_ttl
                   (unsafe-place-local-ref cell.1)
                   (unbox (udp-s-box u_0)))))
             (if (vector? v_0)
               (let ((mode_0 "get"))
                 (begin
                   (unsafe-end-atomic)
                   (raise-network-error
                    'udp-multicast-ttl
                    v_0
                    (string-append mode_0 "sockopt failed"))))
               v_0)))
         (unsafe-end-atomic))))))
(define 1/udp-multicast-set-ttl!
  (|#%name|
   udp-multicast-set-ttl!
   (lambda (u_0 ttl_0)
     (begin
       (if (1/udp? u_0)
         (void)
         (raise-argument-error 'udp-multicast-set-ttl! "udp?" u_0))
       (if (byte? ttl_0)
         (void)
         (raise-argument-error 'udp-multicast-set-ttl! "byte?" ttl_0))
       (unsafe-start-atomic)
       (begin0
         (begin
           (check-udp-closed.1
            void
            unsafe-undefined
            'udp-multicast-set-ttl!
            u_0)
           (let ((r_0
                  (|#%app|
                   rktio_udp_set_multicast_ttl
                   (unsafe-place-local-ref cell.1)
                   (unbox (udp-s-box u_0))
                   ttl_0)))
             (if (vector? r_0)
               (let ((mode_0 "set"))
                 (begin
                   (unsafe-end-atomic)
                   (raise-network-error
                    'udp-multicast-set-ttl!
                    r_0
                    (string-append mode_0 "sockopt failed"))))
               (void))))
         (unsafe-end-atomic))))))
(define ffi-get-lib
  (lambda (who_0 path_0 as-global?_0 fail-as-false?_0 success-k_0)
    (begin
      (if (let ((or-part_0 (not path_0)))
            (if or-part_0 or-part_0 (path-string? path_0)))
        (void)
        (raise-argument-error who_0 "(or/c path-string? #f)" path_0))
      (begin
        (if (if (procedure? success-k_0)
              (procedure-arity-includes? success-k_0 1)
              #f)
          (void)
          (raise-argument-error
           who_0
           "(procedure-arity-includes/c 1)"
           success-k_0))
        (let ((bstr_0 (if path_0 (->host/as-is path_0 #f #f) #f)))
          (begin
            (unsafe-start-atomic)
            (let ((dll_0
                   (|#%app|
                    rktio_dll_open
                    (unsafe-place-local-ref cell.1)
                    bstr_0
                    as-global?_0)))
              (let ((err-str_0 (dll-get-error dll_0)))
                (begin
                  (unsafe-end-atomic)
                  (if (vector? dll_0)
                    (if fail-as-false?_0
                      #f
                      (let ((msg_0
                             (string-append
                              "could not load foreign library"
                              "\n  path: "
                              (if bstr_0
                                (1/bytes->string/locale bstr_0 '#\x3f)
                                "[all opened]"))))
                        (raise-dll-error who_0 msg_0 err-str_0 dll_0)))
                    (|#%app| success-k_0 dll_0)))))))))))
(define ffi-unload-lib
  (lambda (dll_0)
    (begin
      (unsafe-start-atomic)
      (let ((r_0
             (|#%app| rktio_dll_close (unsafe-place-local-ref cell.1) dll_0)))
        (if (vector? r_0)
          (let ((err-str_0 (dll-get-error r_0)))
            (begin
              (unsafe-end-atomic)
              (raise-dll-error
               'ffi-unload-lib
               "could not unload foreign library"
               err-str_0
               r_0)))
          (unsafe-end-atomic))))))
(define ffi-get-obj
  (lambda (who_0 dll_0 dll-name_0 name_0 success-k_0)
    (begin
      (if (let ((or-part_0 (not dll-name_0)))
            (if or-part_0 or-part_0 (path-string? dll-name_0)))
        (void)
        (raise-argument-error who_0 "(or/c path-string? #f)" dll-name_0))
      (begin
        (if (bytes? name_0)
          (void)
          (raise-argument-error who_0 "bytes?" name_0))
        (begin
          (if (if (procedure? success-k_0)
                (procedure-arity-includes? success-k_0 1)
                #f)
            (void)
            (raise-argument-error
             who_0
             "(procedure-arity-includes/c 1)"
             success-k_0))
          (begin
            (unsafe-start-atomic)
            (let ((obj_0
                   (|#%app|
                    rktio_dll_find_object
                    (unsafe-place-local-ref cell.1)
                    dll_0
                    name_0)))
              (let ((err-str_0 (dll-get-error obj_0)))
                (begin
                  (unsafe-end-atomic)
                  (if (vector? obj_0)
                    (let ((msg_0
                           (let ((app_0 (1/bytes->string/utf-8 name_0 '#\x3f)))
                             (string-append
                              "could not find export from foreign library"
                              "\n  name: "
                              app_0
                              "\n  library: "
                              (if dll-name_0
                                (1/bytes->string/locale
                                 (path-bytes (->path dll-name_0))
                                 '#\x3f)
                                "[all opened]")))))
                      (if err-str_0
                        (raise
                         (let ((app_0
                                (let ((msg_1
                                       (string-append
                                        msg_0
                                        "\n  system error: "
                                        (->string err-str_0))))
                                  (error-message->adjusted-string
                                   who_0
                                   'racket/primitive
                                   msg_1
                                   'racket/primitive))))
                           (|#%app|
                            exn:fail:filesystem
                            app_0
                            (current-continuation-marks))))
                        (raise-filesystem-error who_0 dll_0 msg_0)))
                    (|#%app| success-k_0 obj_0)))))))))))
(define dll-get-error
  (lambda (v_0)
    (if (vector? v_0)
      (let ((p_0
             (|#%app| rktio_dll_get_error (unsafe-place-local-ref cell.1))))
        (if (vector? p_0)
          (format-rktio-system-error-message v_0)
          (begin0 (|#%app| rktio_to_bytes p_0) (|#%app| rktio_free p_0))))
      #f)))
(define raise-dll-error
  (lambda (who_0 msg_0 err-str_0 v_0)
    (if err-str_0
      (raise
       (let ((app_0
              (let ((msg_1
                     (string-append
                      msg_0
                      "\n  system error: "
                      (->string err-str_0))))
                (error-message->adjusted-string
                 who_0
                 'racket/primitive
                 msg_1
                 'racket/primitive))))
         (|#%app| exn:fail:filesystem app_0 (current-continuation-marks))))
      (raise-filesystem-error who_0 v_0 msg_0))))
(define ->string
  (lambda (s_0) (if (bytes? s_0) (1/bytes->string/utf-8 s_0 '#\x3f) s_0)))
(define default-load-extension
  (lambda (path_0 sym_0)
    (begin
      (if (path-string? path_0)
        (void)
        (raise-argument-error 'default-load-extension "path-string?" path_0))
      (if (symbol? sym_0)
        (void)
        (raise-argument-error 'default-load-extension "symbol?" sym_0))
      (raise
       (let ((app_0
              (let ((who_0 "default-load-extension"))
                (let ((msg_0 "extensions are not supported"))
                  (error-message->adjusted-string
                   who_0
                   'racket/primitive
                   msg_0
                   'racket/primitive)))))
         (|#%app| exn:fail:unsupported app_0 (current-continuation-marks)))))))
(define 1/current-load-extension
  (make-parameter
   default-load-extension
   (lambda (p_0)
     (begin
       (if (if (procedure? p_0) (procedure-arity-includes? p_0 2) #f)
         (void)
         (raise-argument-error
          'current-load-extension
          "(procedure-arity-includes/c 2)"
          p_0))
       p_0))
   'current-load-extension))
(define rktio_seconds_to_date-error-kind (vector-immutable 3 25))
(define 1/seconds->date
  (let ((seconds->date_0
         (|#%name|
          seconds->date
          (lambda (s2_0 local?1_0)
            (begin
              (if (real? s2_0)
                (void)
                (raise-argument-error 'seconds->date "real?" s2_0))
              (let ((s_0 (inexact->exact s2_0)))
                (let ((si_0 (floor s_0)))
                  (let ((get-gmt_0 (if local?1_0 0 1)))
                    (let ((nsecs_0 (floor (* (- s_0 si_0) 1000000000))))
                      (let ((dt_0
                             (|#%app|
                              rktio_seconds_to_date*
                              (unsafe-place-local-ref cell.1)
                              si_0
                              nsecs_0
                              get-gmt_0)))
                        (if (date*? dt_0)
                          dt_0
                          (if (equal? dt_0 rktio_seconds_to_date-error-kind)
                            (raise-arguments-error
                             'seconds->date
                             "integer is out-of-range"
                             "integer"
                             si_0)
                            (let ((base-msg_0 "conversion error"))
                              (raise
                               (let ((app_0
                                      (let ((msg_0
                                             (string-append
                                              base-msg_0
                                              "\n  system error: "
                                              (format-rktio-system-error-message
                                               dt_0))))
                                        (error-message->adjusted-string
                                         'seconds->date
                                         'racket/primitive
                                         msg_0
                                         'racket/primitive))))
                                 (|#%app|
                                  exn:fail
                                  app_0
                                  (current-continuation-marks)))))))))))))))))
    (|#%name|
     seconds->date
     (case-lambda
      ((s_0) (seconds->date_0 s_0 #t))
      ((s_0 local?1_0) (seconds->date_0 s_0 local?1_0))))))
(define 1/unsafe-poller
  (|#%name|
   unsafe-poller
   (lambda (proc_0)
     (|#%app|
      poller
      (lambda (self_0 poll-ctx_0)
        (if (|#%app| poll-ctx-poll? poll-ctx_0)
          (|#%app| proc_0 self_0 #f)
          (call-with-values
           (lambda () (|#%app| proc_0 self_0 #f))
           (lambda (vals_0 evt_0)
             (if vals_0
               (values vals_0 #f)
               (if (eq? evt_0 self_0)
                 (call-with-values
                  (lambda () (|#%app| proc_0 self_0 poll-ctx_0))
                  (lambda (vals_1 evt_1)
                    (begin
                      (if vals_1
                        (sandman-poll-ctx-merge-timeout
                         poll-ctx_0
                         (current-inexact-monotonic-milliseconds))
                        (void))
                      (values #f self_0))))
                 (values #f evt_0)))))))))))
(define 1/unsafe-poll-ctx-fd-wakeup
  (|#%name|
   unsafe-poll-ctx-fd-wakeup
   (lambda (poll-ctx_0 fd_0 mode_0)
     (if poll-ctx_0
       (sandman-poll-ctx-add-poll-set-adder!
        poll-ctx_0
        (lambda (ps_0)
          (begin
            (unsafe-start-atomic)
            (begin0
              (let ((rfd_0
                     (|#%app|
                      rktio_system_fd
                      (unsafe-place-local-ref cell.1)
                      fd_0
                      (if (eq? mode_0 'read) 1 2))))
                (begin
                  (|#%app|
                   rktio_poll_add
                   (unsafe-place-local-ref cell.1)
                   rfd_0
                   ps_0
                   (if (eq? mode_0 'read) 1 2))
                  (|#%app|
                   rktio_forget
                   (unsafe-place-local-ref cell.1)
                   rfd_0)))
              (unsafe-end-atomic)))))
       (void)))))
(define 1/unsafe-poll-ctx-eventmask-wakeup
  (|#%name|
   unsafe-poll-ctx-eventmask-wakeup
   (lambda (poll-ctx_0 event-mask_0)
     (if poll-ctx_0
       (sandman-poll-ctx-add-poll-set-adder!
        poll-ctx_0
        (lambda (ps_0)
          (|#%app|
           rktio_poll_set_add_eventmask
           (unsafe-place-local-ref cell.1)
           ps_0
           event-mask_0)))
       (void)))))
(define 1/unsafe-poll-ctx-milliseconds-wakeup
  (|#%name|
   unsafe-poll-ctx-milliseconds-wakeup
   (lambda (poll-ctx_0 msecs_0)
     (if poll-ctx_0
       (sandman-poll-ctx-merge-timeout poll-ctx_0 msecs_0)
       (void)))))
(define 1/unsafe-signal-received
  (|#%name|
   unsafe-signal-received
   (lambda ()
     (|#%app| rktio_signal_received (unsafe-place-local-ref cell.1)))))
(define 1/unsafe-make-signal-received
  (|#%name|
   unsafe-make-signal-received
   (lambda ()
     (let ((rktio_0 (unsafe-place-local-ref cell.1)))
       (lambda () (|#%app| rktio_signal_received rktio_0))))))
(define 1/unsafe-set-sleep-in-thread!
  (|#%name|
   unsafe-set-sleep-in-thread!
   (lambda (do-sleep_0 woke-fd_0)
     (sandman-set-background-sleep! do-sleep_0 woke-fd_0))))
(define 1/unsafe-file-descriptor->port
  (|#%name|
   unsafe-file-descriptor->port
   (lambda (system-fd_0 name_0 mode_0)
     (begin
       (if (exact-integer? system-fd_0)
         (void)
         (raise-argument-error
          'unsafe-file-descriptor->port
          "exact-integer?"
          system-fd_0))
       (begin
         (if (list? mode_0)
           (void)
           (raise-argument-error
            'unsafe-file-descriptor->port
            "(listof (or/c 'read 'write 'text 'regular-file))"
            mode_0))
         (let ((read?_0 (memq 'read mode_0)))
           (let ((write?_0 (memq 'write mode_0)))
             (let ((refcount_0 (box (if (if read?_0 write?_0 #f) 2 1))))
               (let ((fd_0
                      (|#%app|
                       rktio_system_fd
                       (unsafe-place-local-ref cell.1)
                       system-fd_0
                       (let ((app_0 (if (memq 'text mode_0) 4 0)))
                         (bitwise-ior
                          (if read?_0 1 0)
                          (if write?_0 2 0)
                          app_0
                          (if (memq 'regular-file mode_0) 512 0))))))
                 (let ((i_0
                        (if read?_0
                          (open-input-fd.1
                           unsafe-undefined
                           refcount_0
                           fd_0
                           name_0)
                          #f)))
                   (let ((o_0
                          (if write?_0
                            (open-output-fd.1
                             'infer
                             unsafe-undefined
                             refcount_0
                             unsafe-undefined
                             fd_0
                             name_0)
                            #f)))
                     (if (if i_0 o_0 #f)
                       (values i_0 o_0)
                       (if i_0 i_0 o_0)))))))))))))
(define 1/unsafe-socket->port
  (|#%name|
   unsafe-socket->port
   (lambda (system-fd_0 name_0 mode_0)
     (begin
       (if (exact-integer? system-fd_0)
         (void)
         (raise-argument-error
          'unsafe-socket->port
          "exact-integer?"
          system-fd_0))
       (if (bytes? name_0)
         (void)
         (raise-argument-error 'unsafe-socket->port "bytes?" name_0))
       (if (list? mode_0)
         (void)
         (raise-argument-error
          'unsafe-socket->port
          "(listof (or/c 'no-close))"
          mode_0))
       (let ((temp13_0 (string->symbol (1/bytes->string/utf-8 name_0))))
         (let ((temp14_0 (not (memq 'no-close mode_0))))
           (let ((temp13_1 temp13_0))
             (open-input-output-tcp.1 temp14_0 system-fd_0 temp13_1))))))))
(define 1/unsafe-port->file-descriptor
  (|#%name|
   unsafe-port->file-descriptor
   (lambda (p_0)
     (let ((fd_0 (fd-port-fd p_0)))
       (if fd_0
         (if (not
              (|#%app|
               rktio_fd_is_pending_open
               (unsafe-place-local-ref cell.1)
               fd_0))
           (|#%app| rktio_fd_system_fd (unsafe-place-local-ref cell.1) fd_0)
           #f)
         #f)))))
(define 1/unsafe-port->socket
  (|#%name|
   unsafe-port->socket
   (lambda (p_0)
     (if (1/tcp-port? p_0) (1/unsafe-port->file-descriptor p_0) #f))))
(define unsafe-fd->semaphore
  (lambda (system-fd_0 mode_0 socket?_0)
    (begin
      (if (exact-integer? system-fd_0)
        (void)
        (raise-argument-error
         'unsafe-fd->semaphore
         "exact-integer?"
         system-fd_0))
      (begin
        (if (symbol? mode_0)
          (void)
          (raise-argument-error
           'unsafe-fd->semaphore
           "(or/c 'read 'write 'check-read 'check-write 'remove)"
           mode_0))
        (begin
          (unsafe-start-atomic)
          (let ((fd_0
                 (|#%app|
                  rktio_system_fd
                  (unsafe-place-local-ref cell.1)
                  system-fd_0
                  (bitwise-ior 1 2 (if socket?_0 128 0)))))
            (let ((sema_0 (fd-semaphore-update! fd_0 mode_0)))
              (begin
                (|#%app| rktio_forget (unsafe-place-local-ref cell.1) fd_0)
                (unsafe-end-atomic)
                sema_0))))))))
(define 1/unsafe-file-descriptor->semaphore
  (|#%name|
   unsafe-file-descriptor->semaphore
   (lambda (system-fd_0 mode_0) (unsafe-fd->semaphore system-fd_0 mode_0 #f))))
(define 1/unsafe-socket->semaphore
  (|#%name|
   unsafe-socket->semaphore
   (lambda (system-fd_0 mode_0) (unsafe-fd->semaphore system-fd_0 mode_0 #t))))
(define 1/unsafe-poll-fd
  (let ((unsafe-poll-fd_0
         (|#%name|
          unsafe-poll-fd
          (lambda (system-fd2_0 mode3_0 socket?1_0)
            (begin
              (unsafe-start-atomic)
              (begin0
                (let ((fd_0
                       (|#%app|
                        rktio_system_fd
                        (unsafe-place-local-ref cell.1)
                        system-fd2_0
                        (if socket?1_0 128 0))))
                  (let ((ready?_0
                         (if (eq? mode3_0 'read)
                           (eqv?
                            (|#%app|
                             rktio_poll_read_ready
                             (unsafe-place-local-ref cell.1)
                             fd_0)
                            1)
                           (if (eq? mode3_0 'write)
                             (eqv?
                              (|#%app|
                               rktio_poll_write_ready
                               (unsafe-place-local-ref cell.1)
                               fd_0)
                              1)
                             #f))))
                    (begin
                      (|#%app|
                       rktio_forget
                       (unsafe-place-local-ref cell.1)
                       fd_0)
                      ready?_0)))
                (unsafe-end-atomic)))))))
    (|#%name|
     unsafe-poll-fd
     (case-lambda
      ((system-fd_0 mode_0) (unsafe-poll-fd_0 system-fd_0 mode_0 #t))
      ((system-fd_0 mode_0 socket?1_0)
       (unsafe-poll-fd_0 system-fd_0 mode_0 socket?1_0))))))
(define get-machine-info
  (lambda ()
    (1/bytes->string/locale
     (begin
       (unsafe-start-atomic)
       (begin0
         (let ((v_0 (|#%app| rktio_uname (unsafe-place-local-ref cell.1))))
           (begin0 (|#%app| rktio_to_bytes v_0) (|#%app| rktio_free v_0)))
         (unsafe-end-atomic))))))
(define 1/executable-yield-handler
  (make-parameter
   void
   (lambda (p_0)
     (begin
       (if (if (procedure? p_0) (procedure-arity-includes? p_0 1) #f)
         (void)
         (raise-argument-error
          'executable-yield-handler
          "(procedure-arity-includes/c 1)"
          p_0))
       p_0))
   'executable-yield-handler))
(define 1/current-command-line-arguments
  (make-parameter
   '#()
   (lambda (v_0)
     (let ((l_0 (if (vector? v_0) (vector->list v_0) #f)))
       (begin
         (if (if (vector? v_0) (andmap_2814 string? l_0) #f)
           (void)
           (raise-argument-error
            'current-command-line-arguments
            "(vectorof string?)"
            v_0))
         (list->vector (map_2353 string->immutable-string l_0)))))
   'current-command-line-arguments))
(define 1/current-print
  (make-parameter
   (lambda (v_0) (if (void? v_0) (void) (begin (1/print v_0) (1/newline))))
   (lambda (p_0)
     (begin
       (if (if (procedure? p_0) (procedure-arity-includes? p_0 1) #f)
         (void)
         (raise-argument-error
          'current-print
          "(procedure-arity-includes/c 1)"
          p_0))
       p_0))
   'current-print))
(define 1/current-read-interaction
  (make-parameter
   (lambda (src_0 in_0)
     (1/error 'default-read-interaction "should have been replaced"))
   (lambda (p_0)
     (begin
       (if (if (procedure? p_0) (procedure-arity-includes? p_0 2) #f)
         (void)
         (raise-argument-error
          'current-read-interaction
          "(procedure-arity-includes/c 2)"
          p_0))
       p_0))
   'current-read-interaction))
(define 1/current-prompt-read
  (make-parameter
   (lambda ()
     (begin
       (1/display "> ")
       (let ((in_0 (|#%app| (1/current-get-interaction-input-port))))
         (let ((app_0 (1/current-read-interaction)))
           (|#%app| app_0 (object-name in_0) in_0)))))
   (lambda (p_0)
     (begin
       (if (if (procedure? p_0) (procedure-arity-includes? p_0 0) #f)
         (void)
         (raise-argument-error
          'current-prompt-read
          "(procedure-arity-includes/c 0)"
          p_0))
       p_0))
   'current-prompt-read))
(define 1/current-get-interaction-input-port
  (make-parameter
   (lambda () (1/current-input-port))
   (lambda (p_0)
     (begin
       (if (if (procedure? p_0) (procedure-arity-includes? p_0 0) #f)
         (void)
         (raise-argument-error
          'current-get-interaction-input-port
          "(procedure-arity-includes/c 0)"
          p_0))
       p_0))
   'current-get-interaction-input-port))
(define 1/current-get-interaction-evt
  (make-parameter
   (lambda () never-evt)
   (lambda (p_0)
     (begin
       (if (if (procedure? p_0) (procedure-arity-includes? p_0 0) #f)
         (void)
         (raise-argument-error
          'current-get-interaction-evt
          "(procedure-arity-includes/c 0)"
          p_0))
       p_0))
   'current-get-interaction-evt))
(define cell.1$1 (unsafe-make-place-local hash2610))
(define 1/cache-configuration
  (|#%name|
   cache-configuration
   (lambda (index_0 thunk_0)
     (hash-ref
      (unsafe-place-local-ref cell.1$1)
      index_0
      (lambda ()
        (let ((v_0 (|#%app| thunk_0)))
          (begin
            (unsafe-place-local-set!
             cell.1$1
             (hash-set (unsafe-place-local-ref cell.1$1) index_0 v_0))
            v_0)))))))
(define make-place-ports+fds
  (lambda (in_0 out_0 err_0)
    (call-with-values
     (lambda ()
       (if in_0
         (values #f (dup-fd (fd-port-fd in_0) void "stdin dup"))
         (reverse-pipe void "stdin pipe")))
     (lambda (parent-in-fd_0 child-in-fd_0)
       (let ((clean-in_0
              (|#%name|
               clean-in
               (lambda ()
                 (begin
                   (|#%app|
                    rktio_close
                    (unsafe-place-local-ref cell.1)
                    child-in-fd_0)
                   (if in_0
                     (void)
                     (|#%app|
                      rktio_close
                      (unsafe-place-local-ref cell.1)
                      parent-in-fd_0)))))))
         (call-with-values
          (lambda ()
            (if out_0
              (values #f (dup-fd (fd-port-fd out_0) clean-in_0 "stdout dup"))
              (pipe clean-in_0 "stdout pipe")))
          (lambda (parent-out-fd_0 child-out-fd_0)
            (let ((clean-out+in_0
                   (|#%name|
                    clean-out+in
                    (lambda ()
                      (begin
                        (|#%app|
                         rktio_close
                         (unsafe-place-local-ref cell.1)
                         child-out-fd_0)
                        (if out_0
                          (void)
                          (|#%app|
                           rktio_close
                           (unsafe-place-local-ref cell.1)
                           parent-out-fd_0))
                        (clean-in_0))))))
              (call-with-values
               (lambda ()
                 (if err_0
                   (values
                    #f
                    (dup-fd (fd-port-fd err_0) clean-out+in_0 "stderr dup"))
                   (pipe clean-out+in_0 "stderr pipe")))
               (lambda (parent-err-fd_0 child-err-fd_0)
                 (let ((app_0
                        (if parent-in-fd_0
                          (let ((temp2_0 "place-in"))
                            (open-output-fd.1
                             'infer
                             unsafe-undefined
                             unsafe-undefined
                             unsafe-undefined
                             parent-in-fd_0
                             temp2_0))
                          #f)))
                   (let ((app_1
                          (if parent-out-fd_0
                            (let ((temp4_0 "place-out"))
                              (open-input-fd.1
                               unsafe-undefined
                               unsafe-undefined
                               parent-out-fd_0
                               temp4_0))
                            #f)))
                     (values
                      app_0
                      app_1
                      (if parent-err-fd_0
                        (let ((temp6_0 "place-err"))
                          (open-input-fd.1
                           unsafe-undefined
                           unsafe-undefined
                           parent-err-fd_0
                           temp6_0))
                        #f)
                      child-in-fd_0
                      child-out-fd_0
                      child-err-fd_0)))))))))))))
(define dup-fd
  (lambda (fd_0 cleanup_0 during_0)
    (let ((new-fd_0 (|#%app| rktio_dup (unsafe-place-local-ref cell.1) fd_0)))
      (begin
        (if (vector? new-fd_0)
          (begin
            (|#%app| cleanup_0)
            (unsafe-end-atomic)
            (let ((base-msg_0 (string-append "error during " during_0)))
              (raise
               (let ((app_0
                      (let ((msg_0
                             (string-append
                              base-msg_0
                              "\n  system error: "
                              (format-rktio-system-error-message new-fd_0))))
                        (error-message->adjusted-string
                         'dynamic-place
                         'racket/primitive
                         msg_0
                         'racket/primitive))))
                 (|#%app| exn:fail app_0 (current-continuation-marks))))))
          (void))
        new-fd_0))))
(define pipe
  (lambda (cleanup_0 during_0)
    (let ((p_0 (|#%app| rktio_make_pipe (unsafe-place-local-ref cell.1) 3)))
      (begin
        (if (vector? p_0)
          (begin
            (|#%app| cleanup_0)
            (unsafe-end-atomic)
            (let ((base-msg_0 (string-append "error during " during_0)))
              (raise
               (let ((app_0
                      (let ((msg_0
                             (string-append
                              base-msg_0
                              "\n  system error: "
                              (format-rktio-system-error-message p_0))))
                        (error-message->adjusted-string
                         'dynamic-place
                         'racket/primitive
                         msg_0
                         'racket/primitive))))
                 (|#%app| exn:fail app_0 (current-continuation-marks))))))
          (void))
        (call-with-values
         (lambda () (|#%app| rktio_pipe_results p_0))
         (lambda (in_0 out_0)
           (begin (|#%app| rktio_free p_0) (values in_0 out_0))))))))
(define reverse-pipe
  (lambda (cleanup_0 during_0)
    (call-with-values
     (lambda () (pipe cleanup_0 during_0))
     (lambda (in_0 out_0) (values out_0 in_0)))))
(define io-place-init!
  (lambda (in-fd_0 out-fd_0 err-fd_0 cust_0 plumber_0)
    (begin
      (rktio-place-init!)
      (convert-cache-init!)
      (logger-init!)
      (shared-ltps-place-init!)
      (install-error-value->string-handler!)
      (init-current-directory!)
      (init-current-ports! in-fd_0 out-fd_0 err-fd_0 cust_0 plumber_0)
      (subprocess-init!)
      (address-init!)
      (sync-locale!))))
(define io-place-destroy! (lambda () (rktio-place-destroy!)))
