(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-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-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/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)
                (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-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/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-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/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)
                (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 call/ec call-with-escape-continuation)
(define bad-list$1
  (|#%name|
   bad-list
   (lambda (who_0 orig-l_0)
     (begin (raise-mismatch-error who_0 "not a proper list: " orig-l_0)))))
(define memq
  (|#%name|
   memq
   (lambda (v_0 orig-l_0)
     (begin
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda (ls_0)
             (begin
               (if (null? ls_0)
                 #f
                 (if (not (pair? ls_0))
                   (raise-mismatch-error 'memq "not a proper list: " orig-l_0)
                   (if (eq? v_0 (car ls_0)) ls_0 (loop_0 (cdr ls_0))))))))))
        (loop_0 orig-l_0))))))
(define memv
  (|#%name|
   memv
   (lambda (v_0 orig-l_0)
     (begin
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda (ls_0)
             (begin
               (if (null? ls_0)
                 #f
                 (if (not (pair? ls_0))
                   (raise-mismatch-error 'memv "not a proper list: " orig-l_0)
                   (if (eqv? v_0 (car ls_0)) ls_0 (loop_0 (cdr ls_0))))))))))
        (loop_0 orig-l_0))))))
(define member
  (let ((default_0
         (|#%name|
          member
          (lambda (v_0 orig-l_0)
            (begin
              (letrec*
               ((loop_0
                 (|#%name|
                  loop
                  (lambda (ls_0)
                    (begin
                      (if (null? ls_0)
                        #f
                        (if (not (pair? ls_0))
                          (raise-mismatch-error
                           'member
                           "not a proper list: "
                           orig-l_0)
                          (if (equal? v_0 (car ls_0))
                            ls_0
                            (loop_0 (cdr ls_0))))))))))
               (loop_0 orig-l_0)))))))
    (|#%name|
     member
     (case-lambda
      ((v_0 orig-l_0) (begin (default_0 v_0 orig-l_0)))
      ((v_0 orig-l_0 eq?_0)
       (begin
         (if (if (procedure? eq?_0) (procedure-arity-includes? eq?_0 2) #f)
           (void)
           (raise-argument-error
            'member
            "(procedure-arity-includes/c 2)"
            eq?_0))
         ((|#%name|
           member
           (lambda (v_1 orig-l_1)
             (begin
               (letrec*
                ((loop_0
                  (|#%name|
                   loop
                   (lambda (ls_0)
                     (begin
                       (if (null? ls_0)
                         #f
                         (if (not (pair? ls_0))
                           (raise-mismatch-error
                            'member
                            "not a proper list: "
                            orig-l_1)
                           (if (|#%app| eq?_0 v_1 (car ls_0))
                             ls_0
                             (loop_0 (cdr ls_0))))))))))
                (loop_0 orig-l_1)))))
          v_0
          orig-l_0)))))))
(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!)
 (make-struct-type
  'keyword-procedure
  #f
  4
  0
  #f
  (list
   (cons prop:checked-procedure #t)
   (cons prop:impersonator-of keyword-procedure-impersonator-of))
  (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 "procedure?" p_0)))))
(define 1/reverse
  (|#%name|
   reverse
   (lambda (l_0)
     (begin
       (begin
         (letrec*
          ((loop_0
            (|#%name|
             loop
             (lambda (a_0 l_1)
               (begin
                 (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
        (letrec ((copying-mergesort_0
                  (|#%name|
                   copying-mergesort
                   (lambda (A_0 less-than?_0 Alo_0 Blo_0 n_0)
                     (begin
                       (if (unsafe-fx= n_0 1)
                         (unsafe-vector-set!
                          A_0
                          Blo_0
                          (unsafe-vector-ref A_0 Alo_0))
                         (if (unsafe-fx= n_0 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_0 16)
                             (begin
                               (unsafe-vector-set!
                                A_0
                                Blo_0
                                (unsafe-vector-ref A_0 Alo_0))
                               (letrec*
                                ((iloop_0
                                  (|#%name|
                                   iloop
                                   (lambda (i_0)
                                     (begin
                                       (if (unsafe-fx< i_0 n_0)
                                         (let ((ref-i_0
                                                (unsafe-vector-ref
                                                 A_0
                                                 (unsafe-fx+ Alo_0 i_0))))
                                           (letrec*
                                            ((jloop_0
                                              (|#%name|
                                               jloop
                                               (lambda (j_0)
                                                 (begin
                                                   (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-_0 (unsafe-fxrshift n_0 1)))
                               (let ((n/2+_0 (unsafe-fx- n_0 n/2-_0)))
                                 (let ((Amid1_0 (unsafe-fx+ Alo_0 n/2-_0)))
                                   (let ((Amid2_0 (unsafe-fx+ Alo_0 n/2+_0)))
                                     (let ((Bmid1_0 (unsafe-fx+ Blo_0 n/2-_0)))
                                       (begin
                                         (copying-mergesort_0
                                          A_0
                                          less-than?_0
                                          Amid1_0
                                          Bmid1_0
                                          n/2+_0)
                                         (copying-mergesort_0
                                          A_0
                                          less-than?_0
                                          Alo_0
                                          Amid2_0
                                          n/2-_0)
                                         (let ((b2_0 (unsafe-fx+ Blo_0 n_0)))
                                           (letrec*
                                            ((loop_0
                                              (|#%name|
                                               loop
                                               (lambda (a1_0 b1_0 c1_0)
                                                 (begin
                                                   (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)
                                                                         (begin
                                                                           (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)))))))))))))))))
          (|#%name|
           generic-sort
           (lambda (A_0 less-than?_0 n_0)
             (begin
               (let ((n/2-_0 (unsafe-fxrshift n_0 1)))
                 (let ((n/2+_0 (unsafe-fx- n_0 n/2-_0)))
                   (begin
                     (copying-mergesort_0 A_0 less-than?_0 n/2-_0 n_0 n/2+_0)
                     (if (zero? n/2-_0)
                       (void)
                       (copying-mergesort_0 A_0 less-than?_0 0 n/2+_0 n/2-_0))
                     (letrec*
                      ((loop_0
                        (|#%name|
                         loop
                         (lambda (a1_0 b1_0 c1_0)
                           (begin
                             (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)
                                                   (begin
                                                     (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
          (letrec ((copying-mergesort_0
                    (|#%name|
                     copying-mergesort
                     (lambda (A_0 key_0 less-than?_0 Alo_0 Blo_0 n_0)
                       (begin
                         (if (unsafe-fx= n_0 1)
                           (unsafe-vector-set!
                            A_0
                            Blo_0
                            (unsafe-vector-ref A_0 Alo_0))
                           (if (unsafe-fx= n_0 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_0 16)
                               (begin
                                 (unsafe-vector-set!
                                  A_0
                                  Blo_0
                                  (unsafe-vector-ref A_0 Alo_0))
                                 (letrec*
                                  ((iloop_0
                                    (|#%name|
                                     iloop
                                     (lambda (i_0)
                                       (begin
                                         (if (unsafe-fx< i_0 n_0)
                                           (let ((ref-i_0
                                                  (unsafe-vector-ref
                                                   A_0
                                                   (unsafe-fx+ Alo_0 i_0))))
                                             (letrec*
                                              ((jloop_0
                                                (|#%name|
                                                 jloop
                                                 (lambda (j_0)
                                                   (begin
                                                     (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-_0 (unsafe-fxrshift n_0 1)))
                                 (let ((n/2+_0 (unsafe-fx- n_0 n/2-_0)))
                                   (let ((Amid1_0 (unsafe-fx+ Alo_0 n/2-_0)))
                                     (let ((Amid2_0 (unsafe-fx+ Alo_0 n/2+_0)))
                                       (let ((Bmid1_0
                                              (unsafe-fx+ Blo_0 n/2-_0)))
                                         (begin
                                           (copying-mergesort_0
                                            A_0
                                            key_0
                                            less-than?_0
                                            Amid1_0
                                            Bmid1_0
                                            n/2+_0)
                                           (copying-mergesort_0
                                            A_0
                                            key_0
                                            less-than?_0
                                            Alo_0
                                            Amid2_0
                                            n/2-_0)
                                           (let ((b2_0 (unsafe-fx+ Blo_0 n_0)))
                                             (letrec*
                                              ((loop_0
                                                (|#%name|
                                                 loop
                                                 (lambda (a1_0 b1_0 c1_0)
                                                   (begin
                                                     (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)
                                                                           (begin
                                                                             (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)))))))))))))))))
            (|#%name|
             generic-sort/key
             (lambda (A_0 less-than?_0 n_0 key_0)
               (begin
                 (let ((n/2-_0 (unsafe-fxrshift n_0 1)))
                   (let ((n/2+_0 (unsafe-fx- n_0 n/2-_0)))
                     (begin
                       (copying-mergesort_0
                        A_0
                        key_0
                        less-than?_0
                        n/2-_0
                        n_0
                        n/2+_0)
                       (if (zero? n/2-_0)
                         (void)
                         (copying-mergesort_0
                          A_0
                          key_0
                          less-than?_0
                          0
                          n/2+_0
                          n/2-_0))
                       (letrec*
                        ((loop_0
                          (|#%name|
                           loop
                           (lambda (a1_0 b1_0 c1_0)
                             (begin
                               (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)
                                                     (begin
                                                       (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
      (letrec ((loop_0
                (|#%name|
                 loop
                 (lambda (getkey_0 less-than?_0 last_0 next_0)
                   (begin
                     (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
                            getkey_0
                            less-than?_0
                            (unsafe-car next_0)
                            (unsafe-cdr next_0))
                           #f)))))))
               (loop_1
                (|#%name|
                 loop
                 (lambda (less-than?_0 last_0 next_0)
                   (begin
                     (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_1
                            less-than?_0
                            (unsafe-car next_0)
                            (unsafe-cdr next_0))
                           #f))))))))
        (case-lambda
         ((lst_0 less-than?_0)
          (let ((n_0 (length lst_0)))
            (if (unsafe-fx= n_0 0)
              lst_0
              (if (let ((app_0 (car lst_0)))
                    (loop_1 less-than?_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_2
                         (|#%name|
                          loop
                          (lambda (i_0 lst_1)
                            (begin
                              (if (pair? lst_1)
                                (begin
                                  (vector-set! vec_0 i_0 (car lst_1))
                                  (let ((app_0 (add1 i_0)))
                                    (loop_2 app_0 (cdr lst_1))))
                                (void)))))))
                       (loop_2 0 lst_0))
                      (generic-sort_0 vec_0 less-than?_0 n_0)
                      (letrec*
                       ((loop_2
                         (|#%name|
                          loop
                          (lambda (i_0 r_0)
                            (begin
                              (let ((i_1 (sub1 i_0)))
                                (if (< i_1 0)
                                  r_0
                                  (loop_2
                                   i_1
                                   (cons (vector-ref vec_0 i_1) r_0)))))))))
                       (loop_2 n_0 '())))))))))
         ((lst_0 less-than?_0 getkey_0)
          (if (if getkey_0 (not (eq? values getkey_0)) #f)
            (|#%app|
             (check-not-unsafe-undefined sort 'sort)
             lst_0
             less-than?_0
             getkey_0
             #f)
            (|#%app|
             (check-not-unsafe-undefined sort '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_2
                         (|#%name|
                          loop
                          (lambda (i_0 lst_1)
                            (begin
                              (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_2 (unsafe-fx+ i_0 1) (cdr lst_1))))
                                (void)))))))
                       (loop_2 0 lst_0))
                      (generic-sort/key_0 vec_0 less-than?_0 n_0 unsafe-car)
                      (letrec*
                       ((loop_2
                         (|#%name|
                          loop
                          (lambda (i_0 r_0)
                            (begin
                              (let ((i_1 (unsafe-fx- i_0 1)))
                                (if (unsafe-fx< i_1 0)
                                  r_0
                                  (loop_2
                                   i_1
                                   (cons
                                    (unsafe-cdr (unsafe-vector-ref vec_0 i_1))
                                    r_0)))))))))
                       (loop_2 n_0 '()))))
                  (if (let ((app_0 (car lst_0)))
                        (loop_0 getkey_0 less-than?_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_2
                             (|#%name|
                              loop
                              (lambda (i_0 lst_1)
                                (begin
                                  (if (pair? lst_1)
                                    (begin
                                      (vector-set! vec_0 i_0 (car lst_1))
                                      (let ((app_0 (add1 i_0)))
                                        (loop_2 app_0 (cdr lst_1))))
                                    (void)))))))
                           (loop_2 0 lst_0))
                          (generic-sort/key_0 vec_0 less-than?_0 n_0 getkey_0)
                          (letrec*
                           ((loop_2
                             (|#%name|
                              loop
                              (lambda (i_0 r_0)
                                (begin
                                  (let ((i_1 (sub1 i_0)))
                                    (if (< i_1 0)
                                      r_0
                                      (loop_2
                                       i_1
                                       (cons
                                        (vector-ref vec_0 i_1)
                                        r_0)))))))))
                           (loop_2 n_0 '())))))))))
            (|#%app|
             (check-not-unsafe-undefined sort '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)
                          (begin
                            (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)))))))))
                     (loop_0
                      (unsafe-vector-ref vec_0 start_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)
                              (begin
                                (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)
                              (begin
                                (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)
                              (begin
                                (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)))))))))
                         (loop_0
                          (unsafe-vector-ref vec_0 start_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|
           (check-not-unsafe-undefined vector-sort '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)
                        (begin
                          (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)))))))))
                   (loop_0
                    (unsafe-vector-ref vec_0 start_0)
                    (unsafe-fx+ start_0 1)))
                (void)
                (if (unsafe-fx<= n_0 3)
                  (begin
                    (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)
                            (begin
                              (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)
                            (begin
                              (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)
                            (begin
                              (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)))))))))
                       (loop_0
                        (unsafe-vector-ref vec_0 start_0)
                        (unsafe-fx+ start_0 1)))
                    (void)
                    (if (unsafe-fx<= n_0 3)
                      (begin
                        (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|
           (check-not-unsafe-undefined vector-sort! 'vector-sort!)
           vec_0
           less-than?_0
           start_0
           end_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
         '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
         '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|
               (check-not-unsafe-undefined range-ref 'range-ref)
               v_0
               2)))
         (if cont?_0
           (not
            (|#%app|
             cont?_0
             (|#%app|
              (check-not-unsafe-undefined range-ref 'range-ref)
              v_0
              0)))
           #f)))
     (lambda (v_0)
       (|#%app| (check-not-unsafe-undefined range-ref 'range-ref) v_0 0))
     (lambda (v_0)
       (let ((app_0 make-range))
         (let ((app_1
                (let ((app_1
                       (|#%app|
                        (check-not-unsafe-undefined range-ref 'range-ref)
                        v_0
                        1)))
                  (|#%app|
                   app_1
                   (|#%app|
                    (check-not-unsafe-undefined range-ref 'range-ref)
                    v_0
                    0)))))
           (let ((app_2
                  (|#%app|
                   (check-not-unsafe-undefined range-ref 'range-ref)
                   v_0
                   1)))
             (|#%app|
              app_0
              app_1
              app_2
              (|#%app|
               (check-not-unsafe-undefined range-ref 'range-ref)
               v_0
               2))))))))
   (cons
    prop:gen-sequence
    (lambda (v_0)
      (let ((app_0
             (|#%app|
              (check-not-unsafe-undefined range-ref 'range-ref)
              v_0
              1)))
        (let ((app_1
               (|#%app|
                (check-not-unsafe-undefined range-ref 'range-ref)
                v_0
                0)))
          (values
           values
           #f
           app_0
           app_1
           (|#%app| (check-not-unsafe-undefined range-ref 'range-ref) v_0 2)
           #f
           #f))))))))
(define check-range
  (lambda (a_0 b_0 step_0)
    (begin
      (if (real? a_0) (void) (raise-argument-error 'in-range "real?" a_0))
      (if (real? b_0) (void) (raise-argument-error 'in-range "real?" b_0))
      (if (real? step_0)
        (void)
        (raise-argument-error 'in-range "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 '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|
          (check-not-unsafe-undefined list-stream-ref 'list-stream-ref)
          v_0
          0))))
     (lambda (v_0)
       (car
        (|#%app|
         (check-not-unsafe-undefined list-stream-ref 'list-stream-ref)
         v_0
         0)))
     (lambda (v_0)
       (let ((app_0 make-list-stream))
         (|#%app|
          app_0
          (cdr
           (|#%app|
            (check-not-unsafe-undefined list-stream-ref 'list-stream-ref)
            v_0
            0)))))))
   (cons
    prop:gen-sequence
    (lambda (v_0)
      (values
       car
       cdr
       values
       (|#%app|
        (check-not-unsafe-undefined list-stream-ref 'list-stream-ref)
        v_0
        0)
       pair?
       #f
       #f))))))
(define check-list
  (lambda (l_0)
    (if (list? l_0) (void) (raise-argument-error 'in-list "list?" l_0))))
(define check-in-hash-keys
  (lambda (ht_0)
    (if (hash? ht_0)
      (void)
      (raise-argument-error 'in-hash-keys "hash?" ht_0))))
(define check-ranges
  (lambda (who_0 vec_0 start_0 stop_0 step_0 len_0)
    (begin
      (if (if (exact-nonnegative-integer? start_0)
            (let ((or-part_0 (< start_0 len_0)))
              (if or-part_0 or-part_0 (= len_0 start_0 stop_0)))
            #f)
        (void)
        (raise-range-error
         who_0
         "vector"
         "starting "
         start_0
         vec_0
         0
         (sub1 len_0)))
      (if (if (exact-integer? stop_0)
            (if (<= -1 stop_0) (<= stop_0 len_0) #f)
            #f)
        (void)
        (raise-range-error who_0 "vector" "stopping " stop_0 vec_0 -1 len_0))
      (if (if (exact-integer? step_0) (not (zero? step_0)) #f)
        (void)
        (raise-argument-error
         who_0
         "(and/c exact-integer? (not/c zero?))"
         step_0))
      (if (if (< start_0 stop_0) (< step_0 0) #f)
        (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)
        (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 who_0 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 vec_0 start_0 stop*_0 step_0 len_0)
            (values vec_0 start_0 stop*_0 step_0)))))))
(define check-vector
  (lambda (v_0)
    (if (vector? v_0) (void) (raise-argument-error 'in-vector "vector" v_0))))
(define check-string
  (lambda (v_0)
    (if (string? v_0) (void) (raise-argument-error 'in-string "string" v_0))))
(define check-bytes
  (lambda (v_0)
    (if (bytes? v_0) (void) (raise-argument-error 'in-bytes "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|
         (check-not-unsafe-undefined do-stream-ref 'do-stream-ref)
         v_0
         0)))
     (lambda (v_0)
       (|#%app|
        (|#%app|
         (check-not-unsafe-undefined do-stream-ref 'do-stream-ref)
         v_0
         1)))
     (lambda (v_0)
       (|#%app|
        (|#%app|
         (check-not-unsafe-undefined do-stream-ref 'do-stream-ref)
         v_0
         2))))))))
(define empty-stream (make-do-stream (lambda () #t) void void))
(define map2
  (|#%name|
   map
   (letrec ((loop_0
             (|#%name|
              loop
              (lambda (f_0 l1_0 l2_0)
                (begin
                  (if (null? l1_0)
                    null
                    (let ((r1_0 (cdr l1_0)))
                      (let ((r2_0 (cdr l2_0)))
                        (let ((r1_1 r1_0))
                          (let ((app_0
                                 (let ((app_0 (car l1_0)))
                                   (|#%app| f_0 app_0 (car l2_0)))))
                            (cons app_0 (loop_0 f_0 r1_1 r2_0)))))))))))
            (loop_1
             (|#%name|
              loop
              (lambda (f_0 l_0)
                (begin
                  (if (null? l_0)
                    null
                    (let ((r_0 (cdr l_0)))
                      (let ((app_0 (|#%app| f_0 (car l_0))))
                        (cons app_0 (loop_1 f_0 r_0))))))))))
     (case-lambda
      ((f_0 l_0) (begin (loop_1 f_0 l_0)))
      ((f_0 l1_0 l2_0) (loop_0 f_0 l1_0 l2_0))
      ((f_0 l_0 . args_0) (gen-map f_0 (cons l_0 args_0)))))))
(define andmap2
  (|#%name|
   andmap
   (case-lambda
    ((f_0 l_0)
     (begin
       (if (null? l_0)
         #t
         (letrec*
          ((loop_0
            (|#%name|
             loop
             (lambda (l_1)
               (begin
                 (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)
             (begin
               (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
  (letrec ((loop_0
            (|#%name|
             loop
             (lambda (kws_0)
               (begin
                 (if (null? kws_0)
                   null
                   (let ((app_0
                          (string-append "#:" (keyword->string (car kws_0)))))
                     (list* " " app_0 (loop_0 (cdr kws_0)))))))))
           (loop_1
            (|#%name|
             loop
             (lambda (w_0 ls_0)
               (begin
                 (if (null? ls_0)
                   null
                   (let ((app_0
                          (string-append
                           "\n   "
                           (let ((app_0 (error-value->string-handler)))
                             (|#%app| app_0 (car ls_0) w_0)))))
                     (cons app_0 (loop_1 w_0 (cdr ls_0))))))))))
    (lambda (who_0 f_0 ls_0)
      (begin
        (if (procedure? f_0)
          (void)
          (raise-argument-error who_0 "procedure?" f_0))
        (letrec*
         ((loop_2
           (|#%name|
            loop
            (lambda (prev-len_0 ls_1 i_0)
              (begin
                (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_2 len_0 app_0 (add1 i_0)))))))))))))
         (loop_2 #f ls_0 1))
        (if (procedure-arity-includes? f_0 (length ls_0))
          (void)
          (call-with-values
           (lambda () (procedure-keywords f_0))
           (case-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 (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 (loop_1 w_0 ls_0))))
                             null))))))))))
            (args (raise-binding-result-arity-error 2 args)))))))))
(define gen-map
  (letrec ((loop_0
            (|#%name|
             loop
             (lambda (f_0 ls_0)
               (begin
                 (if (null? (car ls_0))
                   null
                   (let ((next-ls_0 (map2 cdr ls_0)))
                     (let ((app_0 (apply f_0 (map2 car ls_0))))
                       (cons app_0 (loop_0 f_0 next-ls_0))))))))))
    (lambda (f_0 ls_0) (begin #t (loop_0 f_0 ls_0)))))
(define gen-andmap
  (lambda (f_0 ls_0)
    (begin
      #t
      (letrec*
       ((loop_0
         (|#%name|
          loop
          (lambda (ls_1)
            (begin
              (if (null? (car ls_1))
                #t
                (if (null? (cdar ls_1))
                  (apply f_0 (map2 car ls_1))
                  (let ((next-ls_0 (map2 cdr ls_1)))
                    (if (apply f_0 (map2 car ls_1))
                      (loop_0 next-ls_0)
                      #f)))))))))
       (loop_0 ls_0)))))
(define hash-keys
  (letrec ((loop_0
            (|#%name|
             loop
             (lambda (h_0 pos_0)
               (begin
                 (if pos_0
                   (let ((app_0 (hash-iterate-key h_0 pos_0)))
                     (cons app_0 (loop_0 h_0 (hash-iterate-next h_0 pos_0))))
                   null))))))
    (lambda (h_0) (loop_0 h_0 (hash-iterate-first h_0)))))
(define hash-values
  (letrec ((procz1 (lambda (k_0 v_0) v_0)))
    (lambda (table_0)
      (begin
        (if (hash? table_0)
          (void)
          (raise-argument-error 'hash-values "hash?" table_0))
        (hash-map table_0 procz1)))))
(define sort.1
  (|#%name|
   sort
   (lambda (cache-keys?2_0 key1_0 lst5_0 less?6_0)
     (begin
       (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|
            (check-not-unsafe-undefined sort 'sort)
            lst5_0
            less?6_0
            key1_0
            cache-keys?2_0)
           (|#%app|
            (check-not-unsafe-undefined sort 'sort)
            lst5_0
            less?6_0)))))))
(define do-remove
  (letrec ((loop_0
            (|#%name|
             loop
             (lambda (equal?_0 item_0 list_0)
               (begin
                 (if (null? list_0)
                   null
                   (if (|#%app| equal?_0 item_0 (car list_0))
                     (cdr list_0)
                     (let ((app_0 (car list_0)))
                       (cons
                        app_0
                        (loop_0 equal?_0 item_0 (cdr list_0)))))))))))
    (lambda (who_0 item_0 list_0 equal?_0)
      (begin
        (if (list? list_0) (void) (raise-argument-error who_0 "list?" list_0))
        (loop_0 equal?_0 item_0 list_0)))))
(define remq (lambda (item_0 list_0) (do-remove 'remq item_0 list_0 eq?)))
(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 effect279
  (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 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 effect281
  (struct-type-install-properties!
   struct:sandman
   'sandman
   11
   0
   #f
   null
   'prefab
   #f
   '(0 1 2 3 4 5 6 7 8 9 10)
   #f
   'sandman))
(define sandman1.1
  (|#%name|
   sandman
   (record-constructor
    (make-record-constructor-descriptor struct:sandman #f #f))))
(define sandman?280 (|#%name| sandman? (record-predicate struct:sandman)))
(define sandman?
  (|#%name|
   sandman?
   (lambda (v)
     (if (sandman?280 v)
       #t
       ($value
        (if (impersonator? v) (sandman?280 (impersonator-val v)) #f))))))
(define sandman-do-sleep282
  (|#%name| sandman-do-sleep (record-accessor struct:sandman 0)))
(define sandman-do-sleep
  (|#%name|
   sandman-do-sleep
   (lambda (s)
     (if (sandman?280 s)
       (sandman-do-sleep282 s)
       ($value
        (impersonate-ref
         sandman-do-sleep282
         struct:sandman
         0
         s
         'sandman
         'do-sleep))))))
(define sandman-do-poll283
  (|#%name| sandman-do-poll (record-accessor struct:sandman 1)))
(define sandman-do-poll
  (|#%name|
   sandman-do-poll
   (lambda (s)
     (if (sandman?280 s)
       (sandman-do-poll283 s)
       ($value
        (impersonate-ref
         sandman-do-poll283
         struct:sandman
         1
         s
         'sandman
         'do-poll))))))
(define sandman-do-get-wakeup284
  (|#%name| sandman-do-get-wakeup (record-accessor struct:sandman 2)))
(define sandman-do-get-wakeup
  (|#%name|
   sandman-do-get-wakeup
   (lambda (s)
     (if (sandman?280 s)
       (sandman-do-get-wakeup284 s)
       ($value
        (impersonate-ref
         sandman-do-get-wakeup284
         struct:sandman
         2
         s
         'sandman
         'do-get-wakeup))))))
(define sandman-do-wakeup285
  (|#%name| sandman-do-wakeup (record-accessor struct:sandman 3)))
(define sandman-do-wakeup
  (|#%name|
   sandman-do-wakeup
   (lambda (s)
     (if (sandman?280 s)
       (sandman-do-wakeup285 s)
       ($value
        (impersonate-ref
         sandman-do-wakeup285
         struct:sandman
         3
         s
         'sandman
         'do-wakeup))))))
(define sandman-do-any-sleepers?286
  (|#%name| sandman-do-any-sleepers? (record-accessor struct:sandman 4)))
(define sandman-do-any-sleepers?
  (|#%name|
   sandman-do-any-sleepers?
   (lambda (s)
     (if (sandman?280 s)
       (sandman-do-any-sleepers?286 s)
       ($value
        (impersonate-ref
         sandman-do-any-sleepers?286
         struct:sandman
         4
         s
         'sandman
         'do-any-sleepers?))))))
(define sandman-do-sleepers-external-events287
  (|#%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?280 s)
       (sandman-do-sleepers-external-events287 s)
       ($value
        (impersonate-ref
         sandman-do-sleepers-external-events287
         struct:sandman
         5
         s
         'sandman
         'do-sleepers-external-events))))))
(define sandman-do-add-thread!288
  (|#%name| sandman-do-add-thread! (record-accessor struct:sandman 6)))
(define sandman-do-add-thread!
  (|#%name|
   sandman-do-add-thread!
   (lambda (s)
     (if (sandman?280 s)
       (sandman-do-add-thread!288 s)
       ($value
        (impersonate-ref
         sandman-do-add-thread!288
         struct:sandman
         6
         s
         'sandman
         'do-add-thread!))))))
(define sandman-do-remove-thread!289
  (|#%name| sandman-do-remove-thread! (record-accessor struct:sandman 7)))
(define sandman-do-remove-thread!
  (|#%name|
   sandman-do-remove-thread!
   (lambda (s)
     (if (sandman?280 s)
       (sandman-do-remove-thread!289 s)
       ($value
        (impersonate-ref
         sandman-do-remove-thread!289
         struct:sandman
         7
         s
         'sandman
         'do-remove-thread!))))))
(define sandman-do-merge-external-event-sets290
  (|#%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?280 s)
       (sandman-do-merge-external-event-sets290 s)
       ($value
        (impersonate-ref
         sandman-do-merge-external-event-sets290
         struct:sandman
         8
         s
         'sandman
         'do-merge-external-event-sets))))))
(define sandman-do-merge-timeout291
  (|#%name| sandman-do-merge-timeout (record-accessor struct:sandman 9)))
(define sandman-do-merge-timeout
  (|#%name|
   sandman-do-merge-timeout
   (lambda (s)
     (if (sandman?280 s)
       (sandman-do-merge-timeout291 s)
       ($value
        (impersonate-ref
         sandman-do-merge-timeout291
         struct:sandman
         9
         s
         'sandman
         'do-merge-timeout))))))
(define sandman-do-extract-timeout292
  (|#%name| sandman-do-extract-timeout (record-accessor struct:sandman 10)))
(define sandman-do-extract-timeout
  (|#%name|
   sandman-do-extract-timeout
   (lambda (s)
     (if (sandman?280 s)
       (sandman-do-extract-timeout292 s)
       ($value
        (impersonate-ref
         sandman-do-extract-timeout292
         struct:sandman
         10
         s
         'sandman
         'do-extract-timeout))))))
(define effect293
  (begin
    (register-struct-constructor! sandman1.1)
    (register-struct-predicate! sandman?)
    (register-struct-field-accessor! sandman-do-sleep struct:sandman 0)
    (register-struct-field-accessor! sandman-do-poll struct:sandman 1)
    (register-struct-field-accessor! sandman-do-get-wakeup struct:sandman 2)
    (register-struct-field-accessor! sandman-do-wakeup struct:sandman 3)
    (register-struct-field-accessor! sandman-do-any-sleepers? struct:sandman 4)
    (register-struct-field-accessor!
     sandman-do-sleepers-external-events
     struct:sandman
     5)
    (register-struct-field-accessor! sandman-do-add-thread! struct:sandman 6)
    (register-struct-field-accessor!
     sandman-do-remove-thread!
     struct:sandman
     7)
    (register-struct-field-accessor!
     sandman-do-merge-external-event-sets
     struct:sandman
     8)
    (register-struct-field-accessor! sandman-do-merge-timeout struct:sandman 9)
    (register-struct-field-accessor!
     sandman-do-extract-timeout
     struct:sandman
     10)
    (void)))
(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_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_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_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_UTF16 2)
(define RKTIO_CONVERT_RECASE_UTF16 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_IPV4 24)
(define RKTIO_ERROR_CONVERT_NOT_ENOUGH_SPACE 28)
(define RKTIO_ERROR_CONVERT_BAD_SEQUENCE 29)
(define RKTIO_ERROR_CONVERT_PREMATURE_END 30)
(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_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_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_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_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_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_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_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_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_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_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_identity_to_vector
  (hash-ref rktio-table 'rktio_identity_to_vector))
(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 effect542
  (begin
    (void
     (|#%app|
      rktio_do_install_os_signal_handler
      (unsafe-place-local-ref cell.1)))
    (void)))
(define make-ltps
  (letrec ((procz1
            (lambda (ltps_0)
              (begin
                (|#%app|
                 rktio_ltps_remove_all
                 (unsafe-place-local-ref cell.1)
                 ltps_0)
                (|#%app|
                 rktio_ltps_close
                 (unsafe-place-local-ref cell.1)
                 ltps_0)
                (|#%app| shared-ltps-reset!)))))
    (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
             procz1
             #f
             #f))
          (if (vector? ltps_0) rktio_NULL ltps_0))))))
(define cell.1$3 (unsafe-make-place-local (make-ltps)))
(define shared-ltps-place-init!
  (lambda () (unsafe-place-local-set! cell.1$3 (make-ltps))))
(define shared-ltps-reset!
  (lambda () (unsafe-place-local-set! cell.1$3 rktio_NULL)))
(define fd-semaphore-update!
  (lambda (fd_0 mode_0)
    (if (eq? (unsafe-place-local-ref cell.1$3) rktio_NULL)
      #f
      (let ((h_0
             (|#%app|
              rktio_ltps_add
              (unsafe-place-local-ref cell.1)
              (unsafe-place-local-ref cell.1$3)
              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$3) rktio_NULL)
      #f
      (begin
        (|#%app|
         rktio_ltps_poll
         (unsafe-place-local-ref cell.1)
         (unsafe-place-local-ref cell.1$3))
        (letrec*
         ((loop_0
           (|#%name|
            loop
            (lambda (did?_0)
              (begin
                (let ((h_0
                       (|#%app|
                        rktio_ltps_get_signaled_handle
                        (unsafe-place-local-ref cell.1)
                        (unsafe-place-local-ref cell.1$3))))
                  (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 struct:exts (make-record-type-descriptor* 'exts #f #f #f #f 2 3))
(define effect551
  (struct-type-install-properties!
   struct:exts
   'exts
   2
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1)
   #f
   'exts))
(define exts1.1
  (|#%name|
   exts
   (record-constructor
    (make-record-constructor-descriptor struct:exts #f #f))))
(define exts?550 (|#%name| exts? (record-predicate struct:exts)))
(define exts?
  (|#%name|
   exts?
   (lambda (v)
     (if (exts?550 v)
       #t
       ($value (if (impersonator? v) (exts?550 (impersonator-val v)) #f))))))
(define exts-timeout-at552
  (|#%name| exts-timeout-at (record-accessor struct:exts 0)))
(define exts-timeout-at
  (|#%name|
   exts-timeout-at
   (lambda (s)
     (if (exts?550 s)
       (exts-timeout-at552 s)
       ($value
        (impersonate-ref
         exts-timeout-at552
         struct:exts
         0
         s
         'exts
         'timeout-at))))))
(define exts-fd-adders553
  (|#%name| exts-fd-adders (record-accessor struct:exts 1)))
(define exts-fd-adders
  (|#%name|
   exts-fd-adders
   (lambda (s)
     (if (exts?550 s)
       (exts-fd-adders553 s)
       ($value
        (impersonate-ref
         exts-fd-adders553
         struct:exts
         1
         s
         'exts
         'fd-adders))))))
(define effect554
  (begin
    (register-struct-constructor! exts1.1)
    (register-struct-predicate! exts?)
    (register-struct-field-accessor! exts-timeout-at struct:exts 0)
    (register-struct-field-accessor! exts-fd-adders struct:exts 1)
    (void)))
(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$8 (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$8 sleep_0)
      (unsafe-place-local-set! cell.2$3 fd_0))))
(define effect591
  (begin
    (void
     (|#%app|
      current-sandman
      (let ((timeout-sandman_0 (|#%app| current-sandman)))
        (sandman1.1
         (letrec ((loop_0
                   (|#%name|
                    loop
                    (lambda (ps_0 fd-adders_0)
                      (begin
                        (if (not fd-adders_0)
                          (void)
                          (if (pair? fd-adders_0)
                            (begin
                              (loop_0 ps_0 (car fd-adders_0))
                              (loop_0 ps_0 (cdr fd-adders_0)))
                            (|#%app| fd-adders_0 ps_0))))))))
           (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
                     (loop_0 ps_0 fd-adders_0)
                     (let ((sleep-secs_0
                            (if timeout-at_0
                              (/
                               (- timeout-at_0 (current-inexact-milliseconds))
                               1000.0)
                              #f)))
                       (begin
                         (if (if sleep-secs_0 (<= sleep-secs_0 0.0) #f)
                           (void)
                           (if (unsafe-place-local-ref cell.1$8)
                             (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$3)
                                (unsafe-place-local-ref cell.2$3))
                               (|#%app| (unsafe-place-local-ref cell.1$8))
                               (|#%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$3))))
                         (|#%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 ()
                   (begin
                     (let ((v_0
                            (|#%app|
                             rktio_poll_os_signal
                             (unsafe-place-local-ref cell.1))))
                       (if (eqv? v_0 -1)
                         (void)
                         (begin
                           (let ((app_0 (|#%app| rktio_get_ctl_c_handler)))
                             (|#%app|
                              app_0
                              (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
       (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
            0
            max-end_0
            start-pos_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 struct:core-port
  (make-record-type-descriptor* 'core-port #f #f #f #f 7 127))
(define effect597
  (struct-type-install-properties!
   struct:core-port
   '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 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 effect598
  (begin
    (register-struct-constructor! create-core-port)
    (register-struct-predicate! core-port?)
    (register-struct-field-accessor! core-port-vtable struct:core-port 0)
    (register-struct-field-accessor! core-port-name struct:core-port 1)
    (register-struct-field-accessor! core-port-buffer struct:core-port 2)
    (register-struct-field-accessor! core-port-closed? struct:core-port 3)
    (register-struct-field-accessor! core-port-closed-sema struct:core-port 4)
    (register-struct-field-accessor! core-port-offset struct:core-port 5)
    (register-struct-field-accessor! core-port-count struct:core-port 6)
    (register-struct-field-mutator! set-core-port-buffer! struct:core-port 2)
    (register-struct-field-mutator! set-core-port-closed?! struct:core-port 3)
    (register-struct-field-mutator!
     set-core-port-closed-sema!
     struct:core-port
     4)
    (register-struct-field-mutator! set-core-port-offset! struct:core-port 5)
    (register-struct-field-mutator! set-core-port-count! struct:core-port 6)
    (void)))
(define struct:core-port-methods.1
  (make-record-type-descriptor* 'core-port-methods #f #f #f #f 5 31))
(define effect600
  (struct-type-install-properties!
   struct:core-port-methods.1
   'core-port-methods
   5
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1 2 3 4)
   #f
   'core-port-methods))
(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?.1599
  (|#%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?.1599 v)
       #t
       ($value
        (if (impersonator? v)
          (core-port-methods?.1599 (impersonator-val v))
          #f))))))
(define core-port-methods-close.1601
  (|#%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?.1599 s)
       (core-port-methods-close.1601 s)
       ($value
        (impersonate-ref
         core-port-methods-close.1601
         struct:core-port-methods.1
         0
         s
         'core-port-methods
         'close))))))
(define core-port-methods-count-lines!.1602
  (|#%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?.1599 s)
       (core-port-methods-count-lines!.1602 s)
       ($value
        (impersonate-ref
         core-port-methods-count-lines!.1602
         struct:core-port-methods.1
         1
         s
         'core-port-methods
         'count-lines!))))))
(define core-port-methods-get-location.1603
  (|#%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?.1599 s)
       (core-port-methods-get-location.1603 s)
       ($value
        (impersonate-ref
         core-port-methods-get-location.1603
         struct:core-port-methods.1
         2
         s
         'core-port-methods
         'get-location))))))
(define core-port-methods-file-position.1604
  (|#%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?.1599 s)
       (core-port-methods-file-position.1604 s)
       ($value
        (impersonate-ref
         core-port-methods-file-position.1604
         struct:core-port-methods.1
         3
         s
         'core-port-methods
         'file-position))))))
(define core-port-methods-buffer-mode.1605
  (|#%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?.1599 s)
       (core-port-methods-buffer-mode.1605 s)
       ($value
        (impersonate-ref
         core-port-methods-buffer-mode.1605
         struct:core-port-methods.1
         4
         s
         'core-port-methods
         'buffer-mode))))))
(define effect606
  (begin
    (register-struct-constructor! core-port-methods1.1)
    (register-struct-predicate! core-port-methods?.1)
    (register-struct-field-accessor!
     core-port-methods-close.1
     struct:core-port-methods.1
     0)
    (register-struct-field-accessor!
     core-port-methods-count-lines!.1
     struct:core-port-methods.1
     1)
    (register-struct-field-accessor!
     core-port-methods-get-location.1
     struct:core-port-methods.1
     2)
    (register-struct-field-accessor!
     core-port-methods-file-position.1
     struct:core-port-methods.1
     3)
    (register-struct-field-accessor!
     core-port-methods-buffer-mode.1
     struct:core-port-methods.1
     4)
    (void)))
(define core-port-vtable.1
  (core-port-methods1.1
   (|#%name| close (lambda (this-id_0) (begin (void))))
   #f
   #f
   #f
   #f))
(define struct:direct (make-record-type-descriptor* 'direct #f #f #f #f 3 7))
(define effect607
  (struct-type-install-properties!
   struct:direct
   'direct
   3
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   '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 effect608
  (begin
    (register-struct-constructor! direct2.1)
    (register-struct-predicate! direct?)
    (register-struct-field-accessor! direct-bstr struct:direct 0)
    (register-struct-field-accessor! direct-pos struct:direct 1)
    (register-struct-field-accessor! direct-end struct:direct 2)
    (register-struct-field-mutator! set-direct-bstr! struct:direct 0)
    (register-struct-field-mutator! set-direct-pos! struct:direct 1)
    (register-struct-field-mutator! set-direct-end! struct:direct 2)
    (void)))
(define struct:location
  (make-record-type-descriptor* 'location #f #f #f #f 5 31))
(define effect609
  (struct-type-install-properties!
   struct:location
   'location
   5
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   '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 effect610
  (begin
    (register-struct-constructor! location3.1)
    (register-struct-predicate! location?)
    (register-struct-field-accessor! location-state struct:location 0)
    (register-struct-field-accessor! location-cr-state struct:location 1)
    (register-struct-field-accessor! location-line struct:location 2)
    (register-struct-field-accessor! location-column struct:location 3)
    (register-struct-field-accessor! location-position struct:location 4)
    (register-struct-field-mutator! set-location-state! struct:location 0)
    (register-struct-field-mutator! set-location-cr-state! struct:location 1)
    (register-struct-field-mutator! set-location-line! struct:location 2)
    (register-struct-field-mutator! set-location-column! struct:location 3)
    (register-struct-field-mutator! set-location-position! struct:location 4)
    (void)))
(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 (|#%app| 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
       (|#%app| ->core-input-port.1 unsafe-undefined i_0 #f)))))))
(define 1/input-port?
  (|#%name|
   input-port?
   (lambda (p_0)
     (begin
       (let ((or-part_0 (|#%app| 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)
     (begin
       (let ((default_0
              (if (eq? default1_0 unsafe-undefined)
                empty-input-port
                default1_0)))
         (if (|#%app| 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 struct:core-input-port
  (make-record-type-descriptor*
   'core-input-port
   struct:core-port
   #f
   #f
   #f
   2
   3))
(define effect618
  (struct-type-install-properties!
   struct:core-input-port
   '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 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 effect622
  (begin
    (register-struct-constructor! create-core-input-port)
    (register-struct-predicate! core-input-port?)
    (register-struct-field-accessor!
     core-input-port-pending-eof?
     struct:core-input-port
     0)
    (register-struct-field-accessor!
     core-input-port-read-handler
     struct:core-input-port
     1)
    (register-struct-field-mutator!
     set-core-input-port-pending-eof?!
     struct:core-input-port
     0)
    (register-struct-field-mutator!
     set-core-input-port-read-handler!
     struct:core-input-port
     1)
    (void)))
(define struct:core-input-port-methods.1
  (make-record-type-descriptor*
   'core-input-port-methods
   struct:core-port-methods.1
   #f
   #f
   #f
   6
   63))
(define effect624
  (struct-type-install-properties!
   struct:core-input-port-methods.1
   '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 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?.1623
  (|#%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?.1623 v)
       #t
       ($value
        (if (impersonator? v)
          (core-input-port-methods?.1623 (impersonator-val v))
          #f))))))
(define core-input-port-methods-prepare-change.1625
  (|#%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?.1623 s)
       (core-input-port-methods-prepare-change.1625 s)
       ($value
        (impersonate-ref
         core-input-port-methods-prepare-change.1625
         struct:core-input-port-methods.1
         0
         s
         'core-input-port-methods
         'prepare-change))))))
(define core-input-port-methods-read-in.1626
  (|#%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?.1623 s)
       (core-input-port-methods-read-in.1626 s)
       ($value
        (impersonate-ref
         core-input-port-methods-read-in.1626
         struct:core-input-port-methods.1
         1
         s
         'core-input-port-methods
         'read-in))))))
(define core-input-port-methods-peek-in.1627
  (|#%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?.1623 s)
       (core-input-port-methods-peek-in.1627 s)
       ($value
        (impersonate-ref
         core-input-port-methods-peek-in.1627
         struct:core-input-port-methods.1
         2
         s
         'core-input-port-methods
         'peek-in))))))
(define core-input-port-methods-byte-ready.1628
  (|#%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?.1623 s)
       (core-input-port-methods-byte-ready.1628 s)
       ($value
        (impersonate-ref
         core-input-port-methods-byte-ready.1628
         struct:core-input-port-methods.1
         3
         s
         'core-input-port-methods
         'byte-ready))))))
(define core-input-port-methods-get-progress-evt.1629
  (|#%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?.1623 s)
       (core-input-port-methods-get-progress-evt.1629 s)
       ($value
        (impersonate-ref
         core-input-port-methods-get-progress-evt.1629
         struct:core-input-port-methods.1
         4
         s
         'core-input-port-methods
         'get-progress-evt))))))
(define core-input-port-methods-commit.1630
  (|#%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?.1623 s)
       (core-input-port-methods-commit.1630 s)
       ($value
        (impersonate-ref
         core-input-port-methods-commit.1630
         struct:core-input-port-methods.1
         5
         s
         'core-input-port-methods
         'commit))))))
(define effect631
  (begin
    (register-struct-constructor! core-input-port-methods6.1)
    (register-struct-predicate! core-input-port-methods?.1)
    (register-struct-field-accessor!
     core-input-port-methods-prepare-change.1
     struct:core-input-port-methods.1
     0)
    (register-struct-field-accessor!
     core-input-port-methods-read-in.1
     struct:core-input-port-methods.1
     1)
    (register-struct-field-accessor!
     core-input-port-methods-peek-in.1
     struct:core-input-port-methods.1
     2)
    (register-struct-field-accessor!
     core-input-port-methods-byte-ready.1
     struct:core-input-port-methods.1
     3)
    (register-struct-field-accessor!
     core-input-port-methods-get-progress-evt.1
     struct:core-input-port-methods.1
     4)
    (register-struct-field-accessor!
     core-input-port-methods-commit.1
     struct:core-input-port-methods.1
     5)
    (void)))
(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)
              (begin eof)))
           (|#%name|
            peek-in
            (lambda (this-id_0
                     bstr30_0
                     start31_0
                     end32_0
                     progress-evt33_0
                     copy?34_0)
              (begin eof)))
           (|#%name| byte-ready (lambda (this-id_0 work-done!49_0) (begin #t)))
           #f
           (|#%name|
            commit
            (lambda (this-id_0 amt60_0 progress-evt61_0 ext-evt62_0 finish63_0)
              (begin #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 (|#%app| 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
       (|#%app| ->core-output-port.1 unsafe-undefined o_0 #f)))))))
(define 1/output-port?
  (|#%name|
   output-port?
   (lambda (p_0)
     (begin
       (let ((or-part_0 (|#%app| 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)
     (begin
       (let ((default_0
              (if (eq? default1_0 unsafe-undefined)
                empty-output-port
                default1_0)))
         (if (|#%app| 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 struct:core-output-port
  (make-record-type-descriptor*
   'core-output-port
   struct:core-port
   #f
   #f
   #f
   4
   15))
(define effect643
  (struct-type-install-properties!
   struct:core-output-port
   '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 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 effect648
  (begin
    (register-struct-constructor! create-core-output-port)
    (register-struct-predicate! core-output-port?)
    (register-struct-field-accessor!
     core-output-port-evt
     struct:core-output-port
     0)
    (register-struct-field-accessor!
     core-output-port-write-handler
     struct:core-output-port
     1)
    (register-struct-field-accessor!
     core-output-port-print-handler
     struct:core-output-port
     2)
    (register-struct-field-accessor!
     core-output-port-display-handler
     struct:core-output-port
     3)
    (register-struct-field-mutator!
     set-core-output-port-evt!
     struct:core-output-port
     0)
    (register-struct-field-mutator!
     set-core-output-port-write-handler!
     struct:core-output-port
     1)
    (register-struct-field-mutator!
     set-core-output-port-print-handler!
     struct:core-output-port
     2)
    (register-struct-field-mutator!
     set-core-output-port-display-handler!
     struct:core-output-port
     3)
    (void)))
(define struct:core-output-port-methods.1
  (make-record-type-descriptor*
   'core-output-port-methods
   struct:core-port-methods.1
   #f
   #f
   #f
   4
   15))
(define effect650
  (struct-type-install-properties!
   struct:core-output-port-methods.1
   '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 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?.1649
  (|#%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?.1649 v)
       #t
       ($value
        (if (impersonator? v)
          (core-output-port-methods?.1649 (impersonator-val v))
          #f))))))
(define core-output-port-methods-write-out.1651
  (|#%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?.1649 s)
       (core-output-port-methods-write-out.1651 s)
       ($value
        (impersonate-ref
         core-output-port-methods-write-out.1651
         struct:core-output-port-methods.1
         0
         s
         'core-output-port-methods
         'write-out))))))
(define core-output-port-methods-write-out-special.1652
  (|#%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?.1649 s)
       (core-output-port-methods-write-out-special.1652 s)
       ($value
        (impersonate-ref
         core-output-port-methods-write-out-special.1652
         struct:core-output-port-methods.1
         1
         s
         'core-output-port-methods
         'write-out-special))))))
(define core-output-port-methods-get-write-evt.1653
  (|#%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?.1649 s)
       (core-output-port-methods-get-write-evt.1653 s)
       ($value
        (impersonate-ref
         core-output-port-methods-get-write-evt.1653
         struct:core-output-port-methods.1
         2
         s
         'core-output-port-methods
         'get-write-evt))))))
(define core-output-port-methods-get-write-special-evt.1654
  (|#%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?.1649 s)
       (core-output-port-methods-get-write-special-evt.1654 s)
       ($value
        (impersonate-ref
         core-output-port-methods-get-write-special-evt.1654
         struct:core-output-port-methods.1
         3
         s
         'core-output-port-methods
         'get-write-special-evt))))))
(define effect655
  (begin
    (register-struct-constructor! core-output-port-methods6.1)
    (register-struct-predicate! core-output-port-methods?.1)
    (register-struct-field-accessor!
     core-output-port-methods-write-out.1
     struct:core-output-port-methods.1
     0)
    (register-struct-field-accessor!
     core-output-port-methods-write-out-special.1
     struct:core-output-port-methods.1
     1)
    (register-struct-field-accessor!
     core-output-port-methods-get-write-evt.1
     struct:core-output-port-methods.1
     2)
    (register-struct-field-accessor!
     core-output-port-methods-get-write-special-evt.1
     struct:core-output-port-methods.1
     3)
    (void)))
(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)
              (begin (- end-k16_0 start-k15_0))))
           #f
           (|#%name|
            get-write-evt
            (lambda (this-id_0 bstr37_0 start-k38_0 end-k39_0)
              (begin 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
                 #f
                 #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 struct:write-evt
  (make-record-type-descriptor* 'write-evt #f #f #f #f 1 1))
(define effect665
  (struct-type-install-properties!
   struct:write-evt
   'write-evt
   1
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (self_0 sched-info_0)
        (|#%app| (|#%app| write-evt-proc self_0) self_0)))))
   (current-inspector)
   #f
   '(0)
   #f
   'write-evt))
(define write-evt7.1
  (|#%name|
   write-evt
   (record-constructor
    (make-record-constructor-descriptor struct:write-evt #f #f))))
(define write-evt?664
  (|#%name| write-evt? (record-predicate struct:write-evt)))
(define write-evt?
  (|#%name|
   write-evt?
   (lambda (v)
     (if (write-evt?664 v)
       #t
       ($value
        (if (impersonator? v) (write-evt?664 (impersonator-val v)) #f))))))
(define write-evt-proc670
  (|#%name| write-evt-proc (record-accessor struct:write-evt 0)))
(define write-evt-proc
  (|#%name|
   write-evt-proc
   (lambda (s)
     (if (write-evt?664 s)
       (write-evt-proc670 s)
       ($value
        (impersonate-ref
         write-evt-proc670
         struct:write-evt
         0
         s
         'write-evt
         'proc))))))
(define effect671
  (begin
    (register-struct-constructor! write-evt7.1)
    (register-struct-predicate! write-evt?)
    (register-struct-field-accessor! write-evt-proc struct:write-evt 0)
    (void)))
(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 struct:utf-8-state
  (make-record-type-descriptor* 'utf-8-state #f #f #f #f 3 7))
(define effect673
  (struct-type-install-properties!
   struct:utf-8-state
   'utf-8-state
   3
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1 2)
   #f
   '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?672
  (|#%name| utf-8-state? (record-predicate struct:utf-8-state)))
(define utf-8-state?
  (|#%name|
   utf-8-state?
   (lambda (v)
     (if (utf-8-state?672 v)
       #t
       ($value
        (if (impersonator? v) (utf-8-state?672 (impersonator-val v)) #f))))))
(define utf-8-state-accum674
  (|#%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?672 s)
       (utf-8-state-accum674 s)
       ($value
        (impersonate-ref
         utf-8-state-accum674
         struct:utf-8-state
         0
         s
         'utf-8-state
         'accum))))))
(define utf-8-state-remaining675
  (|#%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?672 s)
       (utf-8-state-remaining675 s)
       ($value
        (impersonate-ref
         utf-8-state-remaining675
         struct:utf-8-state
         1
         s
         'utf-8-state
         'remaining))))))
(define utf-8-state-pending-amt676
  (|#%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?672 s)
       (utf-8-state-pending-amt676 s)
       ($value
        (impersonate-ref
         utf-8-state-pending-amt676
         struct:utf-8-state
         2
         s
         'utf-8-state
         'pending-amt))))))
(define effect677
  (begin
    (register-struct-constructor! utf-8-state1.1)
    (register-struct-predicate! utf-8-state?)
    (register-struct-field-accessor! utf-8-state-accum struct:utf-8-state 0)
    (register-struct-field-accessor!
     utf-8-state-remaining
     struct:utf-8-state
     1)
    (register-struct-field-accessor!
     utf-8-state-pending-amt
     struct:utf-8-state
     2)
    (void)))
(define utf-8-decode!.1
  (letrec ((complete_0
            (|#%name|
             complete
             (lambda (abort-mode3_0
                      error-char2_0
                      i_0
                      in-bstr8_0
                      in-end10_0
                      in-start9_0
                      j_0
                      out-end13_0
                      out-start12_0
                      out-str11_0
                      accum_0)
               (begin
                 (begin
                   (if out-str11_0
                     (string-set! out-str11_0 j_0 (integer->char accum_0))
                     (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
                          abort-mode3_0
                          error-char2_0
                          in-bstr8_0
                          in-end10_0
                          in-start9_0
                          out-end13_0
                          out-start12_0
                          out-str11_0
                          next-i_0
                          next-j_0
                          next-i_0
                          0
                          0)))))))))
           (encoding-failure_0
            (|#%name|
             encoding-failure
             (lambda (abort-mode3_0
                      base-i_0
                      error-char2_0
                      in-bstr8_0
                      in-end10_0
                      in-start9_0
                      j_0
                      out-end13_0
                      out-start12_0
                      out-str11_0)
               (begin
                 (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_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)))
                             (values
                              app_0
                              (fx- next-j_0 out-start12_0)
                              'continues))
                           (loop_0
                            abort-mode3_0
                            error-char2_0
                            in-bstr8_0
                            in-end10_0
                            in-start9_0
                            out-end13_0
                            out-start12_0
                            out-str11_0
                            next-i_0
                            next-j_0
                            next-i_0
                            0
                            0)))))
                   (let ((app_0 (fx- base-i_0 in-start9_0)))
                     (values app_0 (fx- j_0 out-start12_0) 'error)))))))
           (loop_0
            (|#%name|
             loop
             (lambda (abort-mode3_0
                      error-char2_0
                      in-bstr8_0
                      in-end10_0
                      in-start9_0
                      out-end13_0
                      out-start12_0
                      out-str11_0
                      i_0
                      j_0
                      base-i_0
                      accum_0
                      remaining_0)
               (begin
                 (if (fx= i_0 in-end10_0)
                   (if (fx= remaining_0 0)
                     (let ((app_0 (fx- base-i_0 in-start9_0)))
                       (values app_0 (fx- j_0 out-start12_0) 'complete))
                     (if (eq? abort-mode3_0 'error)
                       (encoding-failure_0
                        abort-mode3_0
                        base-i_0
                        error-char2_0
                        in-bstr8_0
                        in-end10_0
                        in-start9_0
                        j_0
                        out-end13_0
                        out-start12_0
                        out-str11_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_0
                               remaining_0
                               (fx- i_0 base-i_0)))))
                         (let ((app_0 (fx- base-i_0 in-start9_0)))
                           (values app_0 (fx- j_0 out-start12_0) 'aborts)))))
                   (if (fx< i_0 in-start9_0)
                     (encoding-failure_0
                      abort-mode3_0
                      base-i_0
                      error-char2_0
                      in-bstr8_0
                      in-end10_0
                      in-start9_0
                      j_0
                      out-end13_0
                      out-start12_0
                      out-str11_0)
                     (let ((b_0 (unsafe-bytes-ref in-bstr8_0 i_0)))
                       (if (fx< b_0 128)
                         (if (fx= remaining_0 0)
                           (complete_0
                            abort-mode3_0
                            error-char2_0
                            i_0
                            in-bstr8_0
                            in-end10_0
                            in-start9_0
                            j_0
                            out-end13_0
                            out-start12_0
                            out-str11_0
                            b_0)
                           (encoding-failure_0
                            abort-mode3_0
                            base-i_0
                            error-char2_0
                            in-bstr8_0
                            in-end10_0
                            in-start9_0
                            j_0
                            out-end13_0
                            out-start12_0
                            out-str11_0))
                         (if (fx= 128 (fxand b_0 192))
                           (if (fx= remaining_0 0)
                             (encoding-failure_0
                              abort-mode3_0
                              base-i_0
                              error-char2_0
                              in-bstr8_0
                              in-end10_0
                              in-start9_0
                              j_0
                              out-end13_0
                              out-start12_0
                              out-str11_0)
                             (let ((next_0 (fxand b_0 63)))
                               (let ((next-accum_0
                                      (fxior (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)
                                     (complete_0
                                      abort-mode3_0
                                      error-char2_0
                                      i_0
                                      in-bstr8_0
                                      in-end10_0
                                      in-start9_0
                                      j_0
                                      out-end13_0
                                      out-start12_0
                                      out-str11_0
                                      next-accum_0)
                                     (encoding-failure_0
                                      abort-mode3_0
                                      base-i_0
                                      error-char2_0
                                      in-bstr8_0
                                      in-end10_0
                                      in-start9_0
                                      j_0
                                      out-end13_0
                                      out-start12_0
                                      out-str11_0))
                                   (if (if (fx= 2 remaining_0)
                                         (fx<= next-accum_0 31)
                                         #f)
                                     (encoding-failure_0
                                      abort-mode3_0
                                      base-i_0
                                      error-char2_0
                                      in-bstr8_0
                                      in-end10_0
                                      in-start9_0
                                      j_0
                                      out-end13_0
                                      out-start12_0
                                      out-str11_0)
                                     (if (if (fx= 3 remaining_0)
                                           (fx<= next-accum_0 15)
                                           #f)
                                       (encoding-failure_0
                                        abort-mode3_0
                                        base-i_0
                                        error-char2_0
                                        in-bstr8_0
                                        in-end10_0
                                        in-start9_0
                                        j_0
                                        out-end13_0
                                        out-start12_0
                                        out-str11_0)
                                       (let ((remaining_1 (fx- remaining_0 1)))
                                         (loop_0
                                          abort-mode3_0
                                          error-char2_0
                                          in-bstr8_0
                                          in-end10_0
                                          in-start9_0
                                          out-end13_0
                                          out-start12_0
                                          out-str11_0
                                          (fx+ i_0 1)
                                          j_0
                                          base-i_0
                                          next-accum_0
                                          remaining_1))))))))
                           (if (not (fx= remaining_0 0))
                             (encoding-failure_0
                              abort-mode3_0
                              base-i_0
                              error-char2_0
                              in-bstr8_0
                              in-end10_0
                              in-start9_0
                              j_0
                              out-end13_0
                              out-start12_0
                              out-str11_0)
                             (if (fx= 192 (fxand b_0 224))
                               (let ((accum_1 (fxand b_0 31)))
                                 (if (fx= accum_1 0)
                                   (encoding-failure_0
                                    abort-mode3_0
                                    base-i_0
                                    error-char2_0
                                    in-bstr8_0
                                    in-end10_0
                                    in-start9_0
                                    j_0
                                    out-end13_0
                                    out-start12_0
                                    out-str11_0)
                                   (loop_0
                                    abort-mode3_0
                                    error-char2_0
                                    in-bstr8_0
                                    in-end10_0
                                    in-start9_0
                                    out-end13_0
                                    out-start12_0
                                    out-str11_0
                                    (fx+ i_0 1)
                                    j_0
                                    i_0
                                    accum_1
                                    1)))
                               (if (fx= 224 (fxand b_0 240))
                                 (let ((accum_1 (fxand b_0 15)))
                                   (loop_0
                                    abort-mode3_0
                                    error-char2_0
                                    in-bstr8_0
                                    in-end10_0
                                    in-start9_0
                                    out-end13_0
                                    out-start12_0
                                    out-str11_0
                                    (fx+ i_0 1)
                                    j_0
                                    i_0
                                    accum_1
                                    2))
                                 (if (fx= 240 (fxand b_0 248))
                                   (let ((accum_1 (fxand b_0 7)))
                                     (loop_0
                                      abort-mode3_0
                                      error-char2_0
                                      in-bstr8_0
                                      in-end10_0
                                      in-start9_0
                                      out-end13_0
                                      out-start12_0
                                      out-str11_0
                                      (fx+ i_0 1)
                                      j_0
                                      i_0
                                      accum_1
                                      3))
                                   (encoding-failure_0
                                    abort-mode3_0
                                    base-i_0
                                    error-char2_0
                                    in-bstr8_0
                                    in-end10_0
                                    in-start9_0
                                    j_0
                                    out-end13_0
                                    out-start12_0
                                    out-str11_0)))))))))))))))
    (|#%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)
       (begin
         (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)))
               (loop_0
                abort-mode3_0
                error-char2_0
                in-bstr8_0
                in-end10_0
                in-start9_0
                out-end13_0
                out-start12_0
                out-str11_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 (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)
     (begin
       (if (begin
             (letrec*
              ((for-loop_0
                (|#%name|
                 for-loop
                 (lambda (result_0 pos_0)
                   (begin
                     (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
               (begin
                 (letrec*
                  ((for-loop_0
                    (|#%name|
                     for-loop
                     (lambda (pos_0)
                       (begin
                         (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))
          (case-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)))))
           (args (raise-binding-result-arity-error 3 args)))))))))
(define utf-8-encode!
  (letrec ((continue_0
            (|#%name|
             continue
             (lambda (i_0
                      in-end_0
                      in-start_0
                      in-str_0
                      out-bstr_0
                      out-end_0
                      out-start_0
                      next-j_0)
               (begin
                 (loop_0
                  in-end_0
                  in-start_0
                  in-str_0
                  out-bstr_0
                  out-end_0
                  out-start_0
                  (fx+ i_0 1)
                  next-j_0)))))
           (loop_0
            (|#%name|
             loop
             (lambda (in-end_0
                      in-start_0
                      in-str_0
                      out-bstr_0
                      out-end_0
                      out-start_0
                      i_0
                      j_0)
               (begin
                 (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))))
                     (if (<= b_0 127)
                       (if (if out-end_0 (= 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
                            i_0
                            in-end_0
                            in-start_0
                            in-str_0
                            out-bstr_0
                            out-end_0
                            out-start_0
                            (fx+ j_0 1))))
                       (if (<= 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
                                  (bitwise-ior 192 (arithmetic-shift b_0 -6)))
                                 (let ((app_0 (add1 j_0)))
                                   (unsafe-bytes-set!
                                    out-bstr_0
                                    app_0
                                    (bitwise-ior 128 (bitwise-and b_0 63)))))
                               (void))
                             (continue_0
                              i_0
                              in-end_0
                              in-start_0
                              in-str_0
                              out-bstr_0
                              out-end_0
                              out-start_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
                                    (bitwise-ior
                                     224
                                     (arithmetic-shift b_0 -12)))
                                   (let ((app_0 (fx+ j_0 1)))
                                     (unsafe-bytes-set!
                                      out-bstr_0
                                      app_0
                                      (bitwise-ior
                                       128
                                       (bitwise-and
                                        (arithmetic-shift b_0 -6)
                                        63))))
                                   (let ((app_0 (fx+ j_0 2)))
                                     (unsafe-bytes-set!
                                      out-bstr_0
                                      app_0
                                      (bitwise-ior 128 (bitwise-and b_0 63)))))
                                 (void))
                               (continue_0
                                i_0
                                in-end_0
                                in-start_0
                                in-str_0
                                out-bstr_0
                                out-end_0
                                out-start_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
                                    (bitwise-ior
                                     240
                                     (arithmetic-shift b_0 -18)))
                                   (let ((app_0 (fx+ j_0 1)))
                                     (unsafe-bytes-set!
                                      out-bstr_0
                                      app_0
                                      (bitwise-ior
                                       128
                                       (bitwise-and
                                        (arithmetic-shift b_0 -12)
                                        63))))
                                   (let ((app_0 (fx+ j_0 2)))
                                     (unsafe-bytes-set!
                                      out-bstr_0
                                      app_0
                                      (bitwise-ior
                                       128
                                       (bitwise-and
                                        (arithmetic-shift b_0 -6)
                                        63))))
                                   (let ((app_0 (fx+ j_0 3)))
                                     (unsafe-bytes-set!
                                      out-bstr_0
                                      app_0
                                      (bitwise-ior 128 (bitwise-and b_0 63)))))
                                 (void))
                               (continue_0
                                i_0
                                in-end_0
                                in-start_0
                                in-str_0
                                out-bstr_0
                                out-end_0
                                out-start_0
                                (fx+ j_0 4))))))))))))))
    (lambda (in-str_0 in-start_0 in-end_0 out-bstr_0 out-start_0 out-end_0)
      (loop_0
       in-end_0
       in-start_0
       in-str_0
       out-bstr_0
       out-end_0
       out-start_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)
            (begin
              (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)
                                      (begin
                                        (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) (begin (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
       (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)
            (begin
              (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) (begin (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)
            (begin
              (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) (begin (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
       (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)))
                    (case-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)))
                               (case-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)))
                                (args
                                 (raise-binding-result-arity-error 3 args))))))
                          #f)))
                     (args
                      (raise-binding-result-arity-error 3 args))))))))))))))
(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)
            (begin
              (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)
       (begin (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)
            (begin
              (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)
       (begin (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)
            (begin
              (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)
                                      (begin
                                        (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) (begin (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
       (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))
                  (case-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))))
                   (args (raise-binding-result-arity-error 3 args)))))))))))))
(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)
            (begin
              (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) (begin (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)
            (begin
              (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) (begin (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
       (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 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 ((app_0 (if who_0 (symbol->string who_0) "")))
      (let ((app_1 (if who_0 ": " "")))
        (string-append
         app_0
         app_1
         base-msg_0
         "\n  system error: "
         (format-rktio-system-error-message err_0))))))
(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 (format-rktio-message who_0 err_0 base-msg_0)))
       (|#%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 (format-rktio-message #f v_0 base-msg_0)))
           (|#%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)
               (if who_0
                 (string-append (symbol->string who_0) ": " base-msg_0)
                 base-msg_0)
               (format-rktio-message who_0 err_0 base-msg_0))))
        (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 1/port-closed?
  (|#%name|
   port-closed?
   (lambda (p_0)
     (begin
       (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
       (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
       (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)
     (begin
       (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) (check-not-unsafe-undefined self_0 'self_3))))
             self_0)))))))
(define check-not-closed
  (lambda (who_0 cp_0)
    (if (core-port-closed? cp_0)
      (begin
        (unsafe-end-atomic)
        (let ((input?_0 (|#%app| core-input-port? cp_0)))
          (let ((app_0
                 (if input?_0 "input port is closed" "output port is closed")))
            (raise-arguments-error
             who_0
             app_0
             (if input?_0 "input port" "output port")
             cp_0))))
      (void))))
(define 1/file-position
  (|#%name|
   file-position
   (case-lambda
    ((p_0)
     (begin
       (do-simple-file-position
        'file-position
        p_0
        (lambda ()
          (raise
           (let ((app_0
                  (string-append
                   "file-position: the port's current position is not known\n port: "
                   (let ((app_0 (error-value->string-handler)))
                     (|#%app| app_0 p_0 (error-print-width))))))
             (|#%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*
  (letrec ((procz1 (lambda () #f)))
    (|#%name|
     file-position*
     (lambda (p_0)
       (begin (do-simple-file-position 'file-position* p_0 procz1))))))
(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)
     (begin
       (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)
     (begin
       (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
  (letrec ((procz1 (lambda () #f)))
    (|#%name|
     port-next-location
     (lambda (p_0)
       (begin
         (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
                         procz1)))
                   (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
       (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!
  (letrec ((end-utf-8_0
            (|#%name|
             end-utf-8
             (lambda (bstr_0
                      column_0
                      end_0
                      i_0
                      line_0
                      loc_0
                      position_0
                      span_0
                      state_0)
               (begin
                 (finish-utf-8_0
                  bstr_0
                  column_0
                  end_0
                  line_0
                  loc_0
                  position_0
                  span_0
                  state_0
                  i_0
                  'error)))))
           (finish-utf-8_0
            (|#%name|
             finish-utf-8
             (lambda (bstr_0
                      column_0
                      end_0
                      line_0
                      loc_0
                      position_0
                      span_0
                      state_0
                      i_0
                      abort-mode_0)
               (begin
                 (call-with-values
                  (lambda ()
                    (let ((temp14_0 (- i_0 span_0)))
                      (utf-8-decode!.1
                       abort-mode_0
                       '#\x3f
                       state_0
                       bstr_0
                       temp14_0
                       i_0
                       #f
                       0
                       #f)))
                  (case-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 ((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
                           bstr_0
                           end_0
                           loc_0
                           i_0
                           0
                           line_0
                           app_0
                           app_1
                           (keep-aborts_0 new-state_0)
                           #f)))))
                   (args (raise-binding-result-arity-error 3 args))))))))
           (keep-aborts_0
            (|#%name|
             keep-aborts
             (lambda (s_0) (begin (if (eq? s_0 'complete) #f s_0)))))
           (loop_0
            (|#%name|
             loop
             (lambda (bstr_0
                      end_0
                      loc_0
                      i_0
                      span_0
                      line_0
                      column_0
                      position_0
                      state_0
                      cr-state_0)
               (begin
                 (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
                      bstr_0
                      column_0
                      end_0
                      line_0
                      loc_0
                      position_0
                      span_0
                      state_0
                      end_0
                      'state))
                   (let ((b_0 (unsafe-bytes-ref bstr_0 i_0)))
                     (if (eq? b_0 10)
                       (if (if state_0 state_0 (not (zero? span_0)))
                         (end-utf-8_0
                          bstr_0
                          column_0
                          end_0
                          i_0
                          line_0
                          loc_0
                          position_0
                          span_0
                          state_0)
                         (if cr-state_0
                           (loop_0
                            bstr_0
                            end_0
                            loc_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)))
                               (let ((app_2 (if column_0 0 #f)))
                                 (loop_0
                                  bstr_0
                                  end_0
                                  loc_0
                                  app_0
                                  0
                                  app_1
                                  app_2
                                  (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)))
                               (let ((app_2 (if column_0 0 #f)))
                                 (loop_0
                                  bstr_0
                                  end_0
                                  loc_0
                                  app_0
                                  0
                                  app_1
                                  app_2
                                  (if position_0 (add1 position_0) #f)
                                  #f
                                  #t))))
                           (end-utf-8_0
                            bstr_0
                            column_0
                            end_0
                            i_0
                            line_0
                            loc_0
                            position_0
                            span_0
                            state_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
                                  bstr_0
                                  end_0
                                  loc_0
                                  app_0
                                  0
                                  line_0
                                  app_1
                                  (if position_0 (add1 position_0) #f)
                                  #f
                                  #f)))
                             (end-utf-8_0
                              bstr_0
                              column_0
                              end_0
                              i_0
                              line_0
                              loc_0
                              position_0
                              span_0
                              state_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
                                    bstr_0
                                    end_0
                                    loc_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
                                      bstr_0
                                      end_0
                                      loc_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
                                    bstr_0
                                    end_0
                                    loc_0
                                    app_0
                                    app_1
                                    line_0
                                    app_2
                                    (if position_0 (add1 position_0) #f)
                                    state_0
                                    #f)))))))))))))))
    (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)))
              (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
                       bstr_0
                       end_0
                       loc_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)
      (begin
        (letrec*
         ((for-loop_0
           (|#%name|
            for-loop
            (lambda (lst_0)
              (begin
                (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)
      (begin
        (letrec*
         ((for-loop_0
           (|#%name|
            for-loop
            (lambda (lst_0)
              (begin
                (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 struct:commit-manager
  (make-record-type-descriptor* 'commit-manager #f #f #f #f 3 7))
(define effect893
  (struct-type-install-properties!
   struct:commit-manager
   'commit-manager
   3
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1 2)
   #f
   'commit-manager))
(define commit-manager1.1
  (|#%name|
   commit-manager
   (record-constructor
    (make-record-constructor-descriptor struct:commit-manager #f #f))))
(define commit-manager?892
  (|#%name| commit-manager? (record-predicate struct:commit-manager)))
(define commit-manager?
  (|#%name|
   commit-manager?
   (lambda (v)
     (if (commit-manager?892 v)
       #t
       ($value
        (if (impersonator? v)
          (commit-manager?892 (impersonator-val v))
          #f))))))
(define commit-manager-pause-channel894
  (|#%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?892 s)
       (commit-manager-pause-channel894 s)
       ($value
        (impersonate-ref
         commit-manager-pause-channel894
         struct:commit-manager
         0
         s
         'commit-manager
         'pause-channel))))))
(define commit-manager-commit-channel895
  (|#%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?892 s)
       (commit-manager-commit-channel895 s)
       ($value
        (impersonate-ref
         commit-manager-commit-channel895
         struct:commit-manager
         1
         s
         'commit-manager
         'commit-channel))))))
(define commit-manager-thread896
  (|#%name| commit-manager-thread (record-accessor struct:commit-manager 2)))
(define commit-manager-thread
  (|#%name|
   commit-manager-thread
   (lambda (s)
     (if (commit-manager?892 s)
       (commit-manager-thread896 s)
       ($value
        (impersonate-ref
         commit-manager-thread896
         struct:commit-manager
         2
         s
         'commit-manager
         'thread))))))
(define effect897
  (begin
    (register-struct-constructor! commit-manager1.1)
    (register-struct-predicate! commit-manager?)
    (register-struct-field-accessor!
     commit-manager-pause-channel
     struct:commit-manager
     0)
    (register-struct-field-accessor!
     commit-manager-commit-channel
     struct:commit-manager
     1)
    (register-struct-field-accessor!
     commit-manager-thread
     struct:commit-manager
     2)
    (void)))
(define struct:commit-request
  (make-record-type-descriptor* 'commit-request #f #f #f #f 5 31))
(define effect899
  (struct-type-install-properties!
   struct:commit-request
   'commit-request
   5
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1 2 3 4)
   #f
   'commit-request))
(define commit-request2.1
  (|#%name|
   commit-request
   (record-constructor
    (make-record-constructor-descriptor struct:commit-request #f #f))))
(define commit-request?898
  (|#%name| commit-request? (record-predicate struct:commit-request)))
(define commit-request?
  (|#%name|
   commit-request?
   (lambda (v)
     (if (commit-request?898 v)
       #t
       ($value
        (if (impersonator? v)
          (commit-request?898 (impersonator-val v))
          #f))))))
(define commit-request-ext-evt900
  (|#%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?898 s)
       (commit-request-ext-evt900 s)
       ($value
        (impersonate-ref
         commit-request-ext-evt900
         struct:commit-request
         0
         s
         'commit-request
         'ext-evt))))))
(define commit-request-progress-evt901
  (|#%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?898 s)
       (commit-request-progress-evt901 s)
       ($value
        (impersonate-ref
         commit-request-progress-evt901
         struct:commit-request
         1
         s
         'commit-request
         'progress-evt))))))
(define commit-request-abandon-evt902
  (|#%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?898 s)
       (commit-request-abandon-evt902 s)
       ($value
        (impersonate-ref
         commit-request-abandon-evt902
         struct:commit-request
         2
         s
         'commit-request
         'abandon-evt))))))
(define commit-request-finish903
  (|#%name| commit-request-finish (record-accessor struct:commit-request 3)))
(define commit-request-finish
  (|#%name|
   commit-request-finish
   (lambda (s)
     (if (commit-request?898 s)
       (commit-request-finish903 s)
       ($value
        (impersonate-ref
         commit-request-finish903
         struct:commit-request
         3
         s
         'commit-request
         'finish))))))
(define commit-request-result-ch904
  (|#%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?898 s)
       (commit-request-result-ch904 s)
       ($value
        (impersonate-ref
         commit-request-result-ch904
         struct:commit-request
         4
         s
         'commit-request
         'result-ch))))))
(define effect905
  (begin
    (register-struct-constructor! commit-request2.1)
    (register-struct-predicate! commit-request?)
    (register-struct-field-accessor!
     commit-request-ext-evt
     struct:commit-request
     0)
    (register-struct-field-accessor!
     commit-request-progress-evt
     struct:commit-request
     1)
    (register-struct-field-accessor!
     commit-request-abandon-evt
     struct:commit-request
     2)
    (register-struct-field-accessor!
     commit-request-finish
     struct:commit-request
     3)
    (register-struct-field-accessor!
     commit-request-result-ch
     struct:commit-request
     4)
    (void)))
(define struct:commit-response
  (make-record-type-descriptor* 'commit-response #f #f #f #f 2 3))
(define effect907
  (struct-type-install-properties!
   struct:commit-response
   'commit-response
   2
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1)
   #f
   'commit-response))
(define commit-response3.1
  (|#%name|
   commit-response
   (record-constructor
    (make-record-constructor-descriptor struct:commit-response #f #f))))
(define commit-response?906
  (|#%name| commit-response? (record-predicate struct:commit-response)))
(define commit-response?
  (|#%name|
   commit-response?
   (lambda (v)
     (if (commit-response?906 v)
       #t
       ($value
        (if (impersonator? v)
          (commit-response?906 (impersonator-val v))
          #f))))))
(define commit-response-abandon-evt908
  (|#%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?906 s)
       (commit-response-abandon-evt908 s)
       ($value
        (impersonate-ref
         commit-response-abandon-evt908
         struct:commit-response
         0
         s
         'commit-response
         'abandon-evt))))))
(define commit-response-result-put-evt909
  (|#%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?906 s)
       (commit-response-result-put-evt909 s)
       ($value
        (impersonate-ref
         commit-response-result-put-evt909
         struct:commit-response
         1
         s
         'commit-response
         'result-put-evt))))))
(define effect910
  (begin
    (register-struct-constructor! commit-response3.1)
    (register-struct-predicate! commit-response?)
    (register-struct-field-accessor!
     commit-response-abandon-evt
     struct:commit-response
     0)
    (register-struct-field-accessor!
     commit-response-result-put-evt
     struct:commit-response
     1)
    (void)))
(define make-commit-manager
  (letrec ((loop_0
            (|#%name|
             loop
             (lambda (commit-ch_0 pause-ch_0 reqs_0 resps_0)
               (begin
                 (call-with-values
                  (lambda () (poll-commit-liveness reqs_0 resps_0))
                  (case-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
                                   commit-ch_0
                                   pause-ch_0
                                   live-reqs_0
                                   live-resps_0))))))
                        (let ((app_1
                               (handle-evt
                                commit-ch_0
                                (lambda (req_0)
                                  (loop_0
                                   commit-ch_0
                                   pause-ch_0
                                   (cons req_0 live-reqs_0)
                                   live-resps_0)))))
                          (apply
                           sync
                           app_0
                           app_1
                           (let ((app_2
                                  (1/reverse
                                   (begin
                                     (letrec*
                                      ((for-loop_0
                                        (|#%name|
                                         for-loop
                                         (lambda (fold-var_0 lst_0)
                                           (begin
                                             (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
                                                                          commit-ch_0
                                                                          pause-ch_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
                               (begin
                                 (letrec*
                                  ((for-loop_0
                                    (|#%name|
                                     for-loop
                                     (lambda (fold-var_0 lst_0)
                                       (begin
                                         (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
                                                                  commit-ch_0
                                                                  pause-ch_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)))))))))))
                   (args (raise-binding-result-arity-error 2 args)))))))))
    (lambda ()
      (let ((pause-ch_0 (make-channel)))
        (let ((commit-ch_0 (make-channel)))
          (commit-manager1.1
           pause-ch_0
           commit-ch_0
           (thread (lambda () (loop_0 commit-ch_0 pause-ch_0 '() '())))))))))
(define poll-commit-liveness
  (lambda (reqs_0 resps_0)
    (letrec*
     ((loop_0
       (|#%name|
        loop
        (lambda (reqs_1 live-reqs_0 resps_1)
          (begin
            (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
     (begin
       (letrec*
        ((for-loop_0
          (|#%name|
           for-loop
           (lambda (fold-var_0 lst_0)
             (begin
               (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 struct:commit-input-port
  (make-record-type-descriptor*
   'commit-input-port
   struct:core-input-port
   #f
   #f
   #f
   2
   3))
(define effect969
  (struct-type-install-properties!
   struct:commit-input-port
   'commit-input-port
   2
   0
   struct:core-input-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-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 effect970
  (begin
    (register-struct-constructor! create-commit-input-port)
    (register-struct-predicate! commit-input-port?)
    (register-struct-field-accessor!
     commit-input-port-progress-sema
     struct:commit-input-port
     0)
    (register-struct-field-accessor!
     commit-input-port-commit-manager
     struct:commit-input-port
     1)
    (register-struct-field-mutator!
     set-commit-input-port-progress-sema!
     struct:commit-input-port
     0)
    (register-struct-field-mutator!
     set-commit-input-port-commit-manager!
     struct:commit-input-port
     1)
    (void)))
(define struct:commit-input-port-methods.1
  (make-record-type-descriptor*
   'commit-input-port-methods
   struct:core-input-port-methods.1
   #f
   #f
   #f
   0
   0))
(define effect972
  (struct-type-install-properties!
   struct:commit-input-port-methods.1
   'commit-input-port-methods
   0
   0
   struct:core-input-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'commit-input-port-methods))
(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?.1971
  (|#%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?.1971 v)
       #t
       ($value
        (if (impersonator? v)
          (commit-input-port-methods?.1971 (impersonator-val v))
          #f))))))
(define effect973
  (begin
    (register-struct-constructor! commit-input-port-methods5.1)
    (register-struct-predicate! commit-input-port-methods?.1)
    (void)))
(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)
     (begin
       (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)
     (begin
       (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)
     (begin
       (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
       (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)
     (begin
       (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)
     (begin
       (let ((cp_0 (->core-output-port.1 unsafe-undefined p_0 #f)))
         (pipe-output-port? p_0))))))
(define 1/pipe-content-length
  (|#%name|
   pipe-content-length
   (lambda (p_0)
     (begin
       (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-contact-length
                       "(or/c pipe-input-port? pipe-output-port?)"
                       p_0)))))))
         (begin
           (unsafe-start-atomic)
           (begin0
             (begin (temp3.1$3 d_0) (temp4.1$2 d_0))
             (unsafe-end-atomic))))))))
(define struct:pipe-data
  (make-record-type-descriptor* 'pipe-data #f #f #f #f 16 65535))
(define effect994
  (struct-type-install-properties!
   struct:pipe-data
   'pipe-data
   16
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '(0)
   #f
   'create-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 effect995
  (begin
    (register-struct-constructor! create-pipe-data)
    (register-struct-predicate! pipe-data?)
    (register-struct-field-accessor! pipe-data-vtable struct:pipe-data 0)
    (register-struct-field-accessor! pipe-data-bstr struct:pipe-data 1)
    (register-struct-field-accessor! pipe-data-len struct:pipe-data 2)
    (register-struct-field-accessor! pipe-data-limit struct:pipe-data 3)
    (register-struct-field-accessor! pipe-data-peeked-amt struct:pipe-data 4)
    (register-struct-field-accessor! pipe-data-start struct:pipe-data 5)
    (register-struct-field-accessor! pipe-data-end struct:pipe-data 6)
    (register-struct-field-accessor! pipe-data-input-ref struct:pipe-data 7)
    (register-struct-field-accessor! pipe-data-output-ref struct:pipe-data 8)
    (register-struct-field-accessor! pipe-data-input-buffer struct:pipe-data 9)
    (register-struct-field-accessor!
     pipe-data-output-buffer
     struct:pipe-data
     10)
    (register-struct-field-accessor!
     pipe-data-read-ready-sema
     struct:pipe-data
     11)
    (register-struct-field-accessor!
     pipe-data-write-ready-sema
     struct:pipe-data
     12)
    (register-struct-field-accessor!
     pipe-data-more-read-ready-sema
     struct:pipe-data
     13)
    (register-struct-field-accessor!
     pipe-data-read-ready-evt
     struct:pipe-data
     14)
    (register-struct-field-accessor!
     pipe-data-write-ready-evt
     struct:pipe-data
     15)
    (register-struct-field-mutator! set-pipe-data-bstr! struct:pipe-data 1)
    (register-struct-field-mutator! set-pipe-data-len! struct:pipe-data 2)
    (register-struct-field-mutator! set-pipe-data-limit! struct:pipe-data 3)
    (register-struct-field-mutator!
     set-pipe-data-peeked-amt!
     struct:pipe-data
     4)
    (register-struct-field-mutator! set-pipe-data-start! struct:pipe-data 5)
    (register-struct-field-mutator! set-pipe-data-end! struct:pipe-data 6)
    (register-struct-field-mutator!
     set-pipe-data-input-ref!
     struct:pipe-data
     7)
    (register-struct-field-mutator!
     set-pipe-data-output-ref!
     struct:pipe-data
     8)
    (register-struct-field-mutator!
     set-pipe-data-input-buffer!
     struct:pipe-data
     9)
    (register-struct-field-mutator!
     set-pipe-data-output-buffer!
     struct:pipe-data
     10)
    (register-struct-field-mutator!
     set-pipe-data-read-ready-sema!
     struct:pipe-data
     11)
    (register-struct-field-mutator!
     set-pipe-data-write-ready-sema!
     struct:pipe-data
     12)
    (register-struct-field-mutator!
     set-pipe-data-more-read-ready-sema!
     struct:pipe-data
     13)
    (register-struct-field-mutator!
     set-pipe-data-read-ready-evt!
     struct:pipe-data
     14)
    (register-struct-field-mutator!
     set-pipe-data-write-ready-evt!
     struct:pipe-data
     15)
    (void)))
(define struct:pipe-data-methods.1
  (make-record-type-descriptor* 'pipe-data-methods #f #f #f #f 0 0))
(define effect997
  (struct-type-install-properties!
   struct:pipe-data-methods.1
   'pipe-data-methods
   0
   0
   #f
   null
   (current-inspector)
   #f
   '()
   #f
   'pipe-data-methods))
(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?.1996
  (|#%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?.1996 v)
       #t
       ($value
        (if (impersonator? v)
          (pipe-data-methods?.1996 (impersonator-val v))
          #f))))))
(define effect998
  (begin
    (register-struct-constructor! pipe-data-methods10.1)
    (register-struct-predicate! pipe-data-methods?.1)
    (void)))
(define pipe-data-vtable.1 (pipe-data-methods10.1))
(define temp1.1$2
  (|#%name|
   sync-input
   (lambda (this-id_0)
     (begin
       (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)
     (begin
       (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 (begin (temp1.1$2 this-id_0) (temp2.1$2 this-id_0))))))
(define temp4.1$2
  (|#%name|
   content-length
   (lambda (this-id_0)
     (begin
       (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)
     (begin
       (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)
     (begin
       (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)
     (begin
       (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
       (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)
     (begin
       (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 struct:pipe-input-port
  (make-record-type-descriptor*
   'pipe-input-port
   struct:commit-input-port
   #f
   #f
   #f
   1
   1))
(define effect1014
  (struct-type-install-properties!
   struct:pipe-input-port
   'pipe-input-port
   1
   0
   struct:commit-input-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-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 effect1015
  (begin
    (register-struct-constructor! create-pipe-input-port)
    (register-struct-predicate! pipe-input-port?)
    (register-struct-field-accessor!
     pipe-input-port-d
     struct:pipe-input-port
     0)
    (register-struct-field-mutator!
     set-pipe-input-port-d!
     struct:pipe-input-port
     0)
    (void)))
(define struct:pipe-input-port-methods.1
  (make-record-type-descriptor*
   'pipe-input-port-methods
   struct:commit-input-port-methods.1
   #f
   #f
   #f
   0
   0))
(define effect1017
  (struct-type-install-properties!
   struct:pipe-input-port-methods.1
   'pipe-input-port-methods
   0
   0
   struct:commit-input-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'pipe-input-port-methods))
(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?.11016
  (|#%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?.11016 v)
       #t
       ($value
        (if (impersonator? v)
          (pipe-input-port-methods?.11016 (impersonator-val v))
          #f))))))
(define effect1018
  (begin
    (register-struct-constructor! pipe-input-port-methods15.1)
    (register-struct-predicate! pipe-input-port-methods?.1)
    (void)))
(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)
          (begin
            (let ((o_0 (pipe-input-port-d this-id_0)))
              (if (pipe-data-input-ref o_0)
                (begin
                  (|#%app| 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) (begin (|#%app| 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)
          (begin
            (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
            (begin
              (|#%app| 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)
                            (|#%app| temp11.1 this-id_0 amt_0)
                            amt_0)))))))))))
       (letrec ((procz1 (lambda (v_0) 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)
            (begin
              (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
                                    (|#%app| 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))
                                      procz1))))
                              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)
          (begin
            (begin
              (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
            (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 (|#%app| 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)
          (begin
            (begin
              (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
                       (|#%app| 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)
                                   (|#%app| temp11.1 this-id_0 amt_0)
                                   (|#%app|
                                    finish597_0
                                    dest-bstr_0))))))))))))))))))))
(define temp13.1
  (|#%name| on-resize (lambda (this-id_0) (begin (temp12.1 this-id_0)))))
(define temp14.1
  (|#%name| on-output-full (lambda (this-id_0) (begin (temp12.1 this-id_0)))))
(define temp11.1
  (|#%name|
   fast-mode!
   (lambda (this-id_0 amt686_0)
     (begin
       (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)
     (begin
       (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 struct:pipe-output-port
  (make-record-type-descriptor*
   'pipe-output-port
   struct:core-output-port
   #f
   #f
   #f
   1
   1))
(define effect1094
  (struct-type-install-properties!
   struct:pipe-output-port
   'pipe-output-port
   1
   0
   struct:core-output-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-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 effect1095
  (begin
    (register-struct-constructor! create-pipe-output-port)
    (register-struct-predicate! pipe-output-port?)
    (register-struct-field-accessor!
     pipe-output-port-d
     struct:pipe-output-port
     0)
    (register-struct-field-mutator!
     set-pipe-output-port-d!
     struct:pipe-output-port
     0)
    (void)))
(define struct:pipe-output-port-methods.1
  (make-record-type-descriptor*
   'pipe-output-port-methods
   struct:core-output-port-methods.1
   #f
   #f
   #f
   0
   0))
(define effect1097
  (struct-type-install-properties!
   struct:pipe-output-port-methods.1
   'pipe-output-port-methods
   0
   0
   struct:core-output-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'pipe-output-port-methods))
(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?.11096
  (|#%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?.11096 v)
       #t
       ($value
        (if (impersonator? v)
          (pipe-output-port-methods?.11096 (impersonator-val v))
          #f))))))
(define effect1098
  (begin
    (register-struct-constructor! pipe-output-port-methods20.1)
    (register-struct-predicate! pipe-output-port-methods?.1)
    (void)))
(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)
                  (begin
                    (let ((o_0 (pipe-output-port-d this-id_0)))
                      (if (pipe-data-output-ref o_0)
                        (begin
                          (|#%app| 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
               (letrec ((procz1 (lambda (v_0) #f))
                        (apply-limit_0
                         (|#%name|
                          apply-limit
                          (lambda (o_0 amt_0)
                            (begin
                              (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)))))
                        (maybe-grow_0
                         (|#%name|
                          maybe-grow
                          (lambda (o_0
                                   src-bstr818_0
                                   src-end820_0
                                   src-start819_0
                                   this-id_0)
                            (begin
                              (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
                                               (* (pipe-data-len o_0) 2))))))
                                      (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
                                         o_0
                                         src-bstr818_0
                                         src-end820_0
                                         src-start819_0
                                         this-id_0)))))
                                (pipe-is-full_0 o_0))))))
                        (pipe-is-full_0
                         (|#%name|
                          pipe-is-full
                          (lambda (o_0)
                            (begin
                              (wrap-evt
                               (pipe-data-write-ready-evt o_0)
                               procz1)))))
                        (try-again_0
                         (|#%name|
                          try-again
                          (lambda (o_0
                                   src-bstr818_0
                                   src-end820_0
                                   src-start819_0
                                   this-id_0)
                            (begin
                              (let ((top-pos_0
                                     (if (fx= (pipe-data-start o_0) 0)
                                       (fx- (pipe-data-len o_0) 1)
                                       (pipe-data-len o_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
                                              o_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 o_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)))
                                            (|#%app| 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
                                           o_0
                                           src-bstr818_0
                                           src-end820_0
                                           src-start819_0
                                           this-id_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 o_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)
                                                (|#%app|
                                                 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
                                                  o_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 o_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))
                                                (|#%app|
                                                 temp16.1
                                                 this-id_0
                                                 amt_0)
                                                amt_0)))
                                          (maybe-grow_0
                                           o_0
                                           src-bstr818_0
                                           src-end820_0
                                           src-start819_0
                                           this-id_0))))))))))))
                 (|#%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
                      (begin
                        (|#%app| temp17.1 this-id_0)
                        (let ((o_0 (pipe-output-port-d this-id_0)))
                          (try-again_0
                           o_0
                           src-bstr818_0
                           src-end820_0
                           src-start819_0
                           this-id_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) (begin (temp17.1 this-id_0)))))
(define temp19.1$1
  (|#%name|
   on-need-more-ready
   (lambda (this-id_0) (begin (temp17.1 this-id_0)))))
(define temp16.1
  (|#%name|
   fast-mode!
   (lambda (this-id_0 amt902_0)
     (begin
       (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)
     (begin
       (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)
            (begin
              (let ((len_0 (min+1 limit21_0 16)))
                (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
              (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))
                 (case-lambda
                  ((ip_0 op_0)
                   (let ((app_0 (finish-port/count ip_0)))
                     (values app_0 (finish-port/count op_0))))
                  (args (raise-binding-result-arity-error 2 args))))))))))
    (|#%name|
     make-pipe
     (case-lambda
      (() (begin (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 struct:pipe-write-poller
  (make-record-type-descriptor* 'pipe-write-poller #f #f #f #f 1 1))
(define effect1200
  (struct-type-install-properties!
   struct:pipe-write-poller
   'pipe-write-poller
   1
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (pwp_0 ctx_0)
        (let ((o_0 (|#%app| 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 pipe-write-poller27.1
  (|#%name|
   pipe-write-poller
   (record-constructor
    (make-record-constructor-descriptor struct:pipe-write-poller #f #f))))
(define pipe-write-poller?1199
  (|#%name| pipe-write-poller? (record-predicate struct:pipe-write-poller)))
(define pipe-write-poller?
  (|#%name|
   pipe-write-poller?
   (lambda (v)
     (if (pipe-write-poller?1199 v)
       #t
       ($value
        (if (impersonator? v)
          (pipe-write-poller?1199 (impersonator-val v))
          #f))))))
(define pipe-write-poller-d1212
  (|#%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?1199 s)
       (pipe-write-poller-d1212 s)
       ($value
        (impersonate-ref
         pipe-write-poller-d1212
         struct:pipe-write-poller
         0
         s
         'pipe-write-poller
         'd))))))
(define effect1213
  (begin
    (register-struct-constructor! pipe-write-poller27.1)
    (register-struct-predicate! pipe-write-poller?)
    (register-struct-field-accessor!
     pipe-write-poller-d
     struct:pipe-write-poller
     0)
    (void)))
(define struct:pipe-read-poller
  (make-record-type-descriptor* 'pipe-read-poller #f #f #f #f 1 1))
(define effect1215
  (struct-type-install-properties!
   struct:pipe-read-poller
   'pipe-read-poller
   1
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (letrec ((procz1 (lambda (v_0) 0)))
        (lambda (prp_0 ctx_0)
          (let ((o_0 (|#%app| 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))
                        procz1)))))))))))))
   (current-inspector)
   #f
   '(0)
   #f
   '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?1214
  (|#%name| pipe-read-poller? (record-predicate struct:pipe-read-poller)))
(define pipe-read-poller?
  (|#%name|
   pipe-read-poller?
   (lambda (v)
     (if (pipe-read-poller?1214 v)
       #t
       ($value
        (if (impersonator? v)
          (pipe-read-poller?1214 (impersonator-val v))
          #f))))))
(define pipe-read-poller-d1227
  (|#%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?1214 s)
       (pipe-read-poller-d1227 s)
       ($value
        (impersonate-ref
         pipe-read-poller-d1227
         struct:pipe-read-poller
         0
         s
         'pipe-read-poller
         'd))))))
(define effect1228
  (begin
    (register-struct-constructor! pipe-read-poller28.1)
    (register-struct-predicate! pipe-read-poller?)
    (register-struct-field-accessor!
     pipe-read-poller-d
     struct:pipe-read-poller
     0)
    (void)))
(define struct:peek-via-read-input-port
  (make-record-type-descriptor*
   'peek-via-read-input-port
   struct:commit-input-port
   #f
   #f
   #f
   5
   31))
(define effect1229
  (struct-type-install-properties!
   struct:peek-via-read-input-port
   '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 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 effect1230
  (begin
    (register-struct-constructor! create-peek-via-read-input-port)
    (register-struct-predicate! peek-via-read-input-port?)
    (register-struct-field-accessor!
     peek-via-read-input-port-bstr
     struct:peek-via-read-input-port
     0)
    (register-struct-field-accessor!
     peek-via-read-input-port-pos
     struct:peek-via-read-input-port
     1)
    (register-struct-field-accessor!
     peek-via-read-input-port-end-pos
     struct:peek-via-read-input-port
     2)
    (register-struct-field-accessor!
     peek-via-read-input-port-peeked-eof?
     struct:peek-via-read-input-port
     3)
    (register-struct-field-accessor!
     peek-via-read-input-port-buffer-mode
     struct:peek-via-read-input-port
     4)
    (register-struct-field-mutator!
     set-peek-via-read-input-port-bstr!
     struct:peek-via-read-input-port
     0)
    (register-struct-field-mutator!
     set-peek-via-read-input-port-pos!
     struct:peek-via-read-input-port
     1)
    (register-struct-field-mutator!
     set-peek-via-read-input-port-end-pos!
     struct:peek-via-read-input-port
     2)
    (register-struct-field-mutator!
     set-peek-via-read-input-port-peeked-eof?!
     struct:peek-via-read-input-port
     3)
    (register-struct-field-mutator!
     set-peek-via-read-input-port-buffer-mode!
     struct:peek-via-read-input-port
     4)
    (void)))
(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
   #f
   #f
   #f
   1
   1))
(define effect1232
  (struct-type-install-properties!
   struct:peek-via-read-input-port-methods.1
   'peek-via-read-input-port-methods
   1
   0
   struct:commit-input-port-methods.1
   null
   (current-inspector)
   #f
   '(0)
   #f
   'peek-via-read-input-port-methods))
(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?.11231
  (|#%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?.11231 v)
       #t
       ($value
        (if (impersonator? v)
          (peek-via-read-input-port-methods?.11231 (impersonator-val v))
          #f))))))
(define peek-via-read-input-port-methods-read-in/inner.11233
  (|#%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?.11231 s)
       (peek-via-read-input-port-methods-read-in/inner.11233 s)
       ($value
        (impersonate-ref
         peek-via-read-input-port-methods-read-in/inner.11233
         struct:peek-via-read-input-port-methods.1
         0
         s
         'peek-via-read-input-port-methods
         'read-in/inner))))))
(define effect1234
  (begin
    (register-struct-constructor! peek-via-read-input-port-methods10.1)
    (register-struct-predicate! peek-via-read-input-port-methods?.1)
    (register-struct-field-accessor!
     peek-via-read-input-port-methods-read-in/inner.1
     struct:peek-via-read-input-port-methods.1
     0)
    (void)))
(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) (begin (|#%app| 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) (begin (|#%app| temp9.1 this-id_0)))
         ((this-id_0 mode42_0) (|#%app| temp9.1 this-id_0 mode42_0))))
       (|#%name|
        prepare-change
        (lambda (this-id_0) (begin (temp2.1 this-id_0))))
       (|#%name|
        read-in
        (lambda (this-id_0 dest-bstr131_0 start132_0 end133_0 copy?134_0)
          (begin
            (begin
              (|#%app| temp5.1$1 this-id_0)
              (letrec*
               ((try-again_0
                 (|#%name|
                  try-again
                  (lambda ()
                    (begin
                      (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)
                            (|#%app| 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
                                   (fxrshift
                                    (unsafe-bytes-length
                                     (peek-via-read-input-port-bstr this-id_0))
                                    1)))
                                #f)
                            (let ((v_0 (|#%app| 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)))
                              (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)
          (begin
            (letrec*
             ((try-again_0
               (|#%name|
                try-again
                (lambda ()
                  (begin
                    (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)
                                      (|#%app| temp4.1$1 this-id_0 0))
                                    amt_0)))
                              (if (peek-via-read-input-port-peeked-eof?
                                   this-id_0)
                                eof
                                (begin
                                  (|#%app| temp5.1$1 this-id_0)
                                  (let ((v_0
                                         (let ((app_2 temp2.1$1))
                                           (|#%app|
                                            app_2
                                            this-id_0
                                            (let ((app_3
                                                   (- skip171_0 peeked-amt_0)))
                                              (+
                                               app_3
                                               (fx- end170_0 start169_0)))))))
                                    (if (|#%app| 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)
          (begin
            (letrec*
             ((loop_0
               (|#%name|
                loop
                (lambda ()
                  (begin
                    (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
                            (begin
                              (|#%app| temp5.1$1 this-id_0)
                              (let ((v_0 (|#%app| temp1.1$1 this-id_0)))
                                (begin
                                  (|#%app| work-done!209_0)
                                  (if (|#%app| 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
            (begin
              (unsafe-start-atomic)
              (begin0
                (begin (|#%app| 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
            (begin
              (|#%app| 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)
          (begin 0)))))))
(define temp6.1$1
  (|#%name|
   purge-buffer
   (lambda (this-id_0)
     (begin
       (begin
         (|#%app| 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
       (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 i401_0)
     (begin
       (let ((b_0 (core-port-buffer this-id_0)))
         (-
          i401_0
          (let ((app_0 (peek-via-read-input-port-end-pos this-id_0)))
            (fx-
             app_0
             (if (direct-bstr b_0)
               (direct-pos b_0)
               (peek-via-read-input-port-pos this-id_0))))))))))
(define temp9.1
  (|#%name|
   default-buffer-mode
   (case-lambda
    ((this-id_0) (begin (peek-via-read-input-port-buffer-mode this-id_0)))
    ((this-id_0 mode432_0)
     (set-peek-via-read-input-port-buffer-mode! this-id_0 mode432_0)))))
(define temp1.1$1
  (let ((pull-some-bytes_0
         (|#%name|
          pull-some-bytes
          (lambda (this-id498_0 amt492495_0 offset493496_0 init-pos494497_0)
            (begin
              (let ((amt492_0
                     (if (eq? amt492495_0 unsafe-undefined)
                       (if (eq?
                            'block
                            (peek-via-read-input-port-buffer-mode
                             this-id498_0))
                         (unsafe-bytes-length
                          (peek-via-read-input-port-bstr this-id498_0))
                         1)
                       amt492495_0)))
                (let ((offset493_0
                       (if (eq? offset493496_0 unsafe-undefined)
                         0
                         offset493496_0)))
                  (let ((init-pos494_0
                         (if (eq? init-pos494497_0 unsafe-undefined)
                           0
                           init-pos494497_0)))
                    (let ((get-end_0
                           (let ((app_0 (+ amt492_0 offset493_0)))
                             (min
                              app_0
                              (unsafe-bytes-length
                               (peek-via-read-input-port-bstr
                                this-id498_0))))))
                      (let ((v_0
                             (let ((app_0
                                    (peek-via-read-input-port-methods-read-in/inner.1
                                     (core-port-vtable this-id498_0))))
                               (|#%app|
                                app_0
                                this-id498_0
                                (peek-via-read-input-port-bstr this-id498_0)
                                offset493_0
                                get-end_0
                                #f))))
                        (if (eof-object? v_0)
                          (begin
                            (set-peek-via-read-input-port-peeked-eof?!
                             this-id498_0
                             #t)
                            eof)
                          (if (evt? v_0)
                            v_0
                            (if (eqv? v_0 0)
                              0
                              (begin
                                (set-peek-via-read-input-port-pos!
                                 this-id498_0
                                 init-pos494_0)
                                (set-peek-via-read-input-port-end-pos!
                                 this-id498_0
                                 (fx+ offset493_0 v_0))
                                v_0))))))))))))))
    (|#%name|
     pull-some-bytes
     (case-lambda
      ((this-id_0)
       (begin
         (pull-some-bytes_0
          this-id_0
          unsafe-undefined
          unsafe-undefined
          unsafe-undefined)))
      ((this-id_0 amt492_0 offset493_0 init-pos494497_0)
       (pull-some-bytes_0 this-id_0 amt492_0 offset493_0 init-pos494497_0))
      ((this-id_0 amt492_0 offset493496_0)
       (pull-some-bytes_0 this-id_0 amt492_0 offset493496_0 unsafe-undefined))
      ((this-id_0 amt492495_0)
       (pull-some-bytes_0
        this-id_0
        amt492495_0
        unsafe-undefined
        unsafe-undefined))))))
(define temp2.1$1
  (|#%name|
   pull-more-bytes
   (lambda (this-id_0 amt621_0)
     (begin
       (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)))
                  amt621_0)))
           (let ((app_0 temp1.1$1))
             (let ((app_1 (peek-via-read-input-port-end-pos this-id_0)))
               (|#%app|
                app_0
                this-id_0
                pull-amt_0
                app_1
                (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)
               (let ((app_0 temp1.1$1))
                 (|#%app|
                  app_0
                  this-id_0
                  amt621_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 amt621_0))))))))
(define temp3.1$2
  (|#%name|
   retry-pull?
   (lambda (this-id_0 v652_0)
     (begin (if (integer? v652_0) (not (eqv? v652_0 0)) #f)))))
(define temp4.1$1
  (|#%name|
   fast-mode!
   (lambda (this-id_0 amt683_0)
     (begin
       (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 amt683_0) s_0))
                     (void))))))))))))
(define temp5.1$1
  (|#%name|
   slow-mode!
   (lambda (this-id_0)
     (begin
       (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)
     (begin
       (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
       (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
   (letrec ((set-buffer-mode_0
             (|#%name|
              set-buffer-mode
              (lambda (mode_0 p_0)
                (begin
                  (begin
                    (unsafe-start-atomic)
                    (begin0
                      (begin
                        (check-not-closed 'file-stream-buffer-mode p_0)
                        (let ((buffer-mode_0
                               (core-port-methods-buffer-mode.1
                                (core-port-vtable p_0))))
                          (if buffer-mode_0
                            (begin (|#%app| buffer-mode_0 p_0 mode_0) #t)
                            #f)))
                      (unsafe-end-atomic))))))))
     (case-lambda
      ((p_0)
       (begin
         (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))
             (begin
               (if (1/input-port? p_0)
                 (let ((or-part_0
                        (set-buffer-mode_0
                         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
                         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
       (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 (format-rktio-message #f v_0 base-msg_0)))
                        (|#%app|
                         exn:fail
                         app_0
                         (current-continuation-marks))))))
                 (void))))
           (void)))))))
(define struct:fd-input-port
  (make-record-type-descriptor*
   'fd-input-port
   struct:peek-via-read-input-port
   #f
   #f
   #f
   3
   7))
(define effect1350
  (struct-type-install-properties!
   struct:fd-input-port
   'fd-input-port
   3
   0
   struct:peek-via-read-input-port
   (list
    (cons prop:authentic #t)
    (cons
     prop:place-message
     (lambda (port_0) (lambda () (|#%app| fd-port->place-message port_0))))
    (cons prop:file-stream (lambda (p_0) (|#%app| fd-input-port-fd p_0))))
   (current-inspector)
   #f
   '()
   #f
   'create-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 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 effect1353
  (begin
    (register-struct-constructor! create-fd-input-port)
    (register-struct-predicate! fd-input-port?)
    (register-struct-field-accessor! fd-input-port-fd struct:fd-input-port 0)
    (register-struct-field-accessor!
     fd-input-port-fd-refcount
     struct:fd-input-port
     1)
    (register-struct-field-accessor!
     fd-input-port-custodian-reference
     struct:fd-input-port
     2)
    (register-struct-field-mutator!
     set-fd-input-port-fd!
     struct:fd-input-port
     0)
    (register-struct-field-mutator!
     set-fd-input-port-fd-refcount!
     struct:fd-input-port
     1)
    (register-struct-field-mutator!
     set-fd-input-port-custodian-reference!
     struct:fd-input-port
     2)
    (void)))
(define struct:fd-input-port-methods.1
  (make-record-type-descriptor*
   'fd-input-port-methods
   struct:peek-via-read-input-port-methods.1
   #f
   #f
   #f
   2
   3))
(define effect1355
  (struct-type-install-properties!
   struct:fd-input-port-methods.1
   '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 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?.11354
  (|#%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?.11354 v)
       #t
       ($value
        (if (impersonator? v)
          (fd-input-port-methods?.11354 (impersonator-val v))
          #f))))))
(define fd-input-port-methods-on-close.11356
  (|#%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?.11354 s)
       (fd-input-port-methods-on-close.11356 s)
       ($value
        (impersonate-ref
         fd-input-port-methods-on-close.11356
         struct:fd-input-port-methods.1
         0
         s
         'fd-input-port-methods
         'on-close))))))
(define fd-input-port-methods-raise-read-error.11357
  (|#%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?.11354 s)
       (fd-input-port-methods-raise-read-error.11357 s)
       ($value
        (impersonate-ref
         fd-input-port-methods-raise-read-error.11357
         struct:fd-input-port-methods.1
         1
         s
         'fd-input-port-methods
         'raise-read-error))))))
(define effect1358
  (begin
    (register-struct-constructor! fd-input-port-methods6.1)
    (register-struct-predicate! fd-input-port-methods?.1)
    (register-struct-field-accessor!
     fd-input-port-methods-on-close.1
     struct:fd-input-port-methods.1
     0)
    (register-struct-field-accessor!
     fd-input-port-methods-raise-read-error.1
     struct:fd-input-port-methods.1
     1)
    (void)))
(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
                        (begin
                          (|#%app|
                           (fd-input-port-methods-on-close.1
                            (core-port-vtable this-id_0))
                           this-id_0)
                          (let ((fd75_0 (|#%app| fd-input-port-fd this-id_0)))
                            (let ((fd-refcount76_0
                                   (fd-input-port-fd-refcount this-id_0)))
                              (let ((fd75_1 fd75_0))
                                (fd-close.1 #f fd75_1 fd-refcount76_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)
                      (begin
                        (let ((pos_0
                               (let ((app_8 get-file-position))
                                 (|#%app|
                                  app_8
                                  (|#%app| fd-input-port-fd this-id_0)))))
                          (if pos_0 (temp8.1 this-id_0 pos_0) #f))))
                     ((this-id_0 pos77_0)
                      (begin
                        (temp6.1$1 this-id_0)
                        (let ((app_8 set-file-position))
                          (|#%app|
                           app_8
                           (|#%app| fd-input-port-fd this-id_0)
                           pos77_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-bstr133_0
                             start134_0
                             end135_0
                             copy?136_0)
                      (begin
                        (let ((n_0
                               (|#%app|
                                rktio_read_in
                                (unsafe-place-local-ref cell.1)
                                (|#%app| fd-input-port-fd this-id_0)
                                dest-bstr133_0
                                start134_0
                                end135_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!
                                        (|#%app| fd-input-port-fd this-id_0)
                                        'read)))
                                  (if or-part_0
                                    or-part_0
                                    (let ((app_8 fd-evt44.1))
                                      (|#%app|
                                       app_8
                                       (|#%app| fd-input-port-fd this-id_0)
                                       1
                                       this-id_0))))
                                n_0)))))))
                   (|#%name| on-close (lambda (this-id_0) (begin (void))))
                   (|#%name|
                    raise-read-error
                    (lambda (this-id_0 n195_0)
                      (begin
                        (raise-filesystem-error
                         #f
                         n195_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)
     (begin
       (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 ((temp224_0
                  (create-fd-input-port
                   fd-input-port-vtable.1
                   name12_0
                   (direct2.1 #f 0 0)
                   #f
                   #f
                   0
                   #f
                   #f
                   #f
                   #f
                   #f
                   (make-bytes 4096)
                   0
                   0
                   #f
                   'block
                   fd11_0
                   fd-refcount_0
                   #f)))
             (finish-fd-input-port.1 cust_0 temp224_0))))))))
(define finish-fd-input-port.1
  (|#%name|
   finish-fd-input-port
   (lambda (custodian14_0 p16_0)
     (begin
       (let ((cust_0
              (if (eq? custodian14_0 unsafe-undefined)
                (current-custodian)
                custodian14_0)))
         (let ((fd_0 (|#%app| 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 struct:fd-output-port
  (make-record-type-descriptor*
   'fd-output-port
   struct:core-output-port
   #f
   #f
   #f
   8
   255))
(define effect1390
  (struct-type-install-properties!
   struct:fd-output-port
   'fd-output-port
   8
   0
   struct:core-output-port
   (list
    (cons prop:authentic #t)
    (cons
     prop:place-message
     (lambda (port_0) (lambda () (|#%app| fd-port->place-message port_0))))
    (cons
     prop:file-truncate
     (lambda (p_0 pos_0)
       (begin
         (|#%app| temp24.1 p_0)
         (let ((result_0
                (|#%app|
                 rktio_set_file_size
                 (unsafe-place-local-ref cell.1)
                 (|#%app| 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
                         (format-rktio-message
                          'file-truncate
                          result_0
                          base-msg_0)))
                    (|#%app| exn:fail app_0 (current-continuation-marks))))))
             (void))))))
    (cons prop:file-stream (lambda (p_0) (|#%app| fd-output-port-fd p_0))))
   (current-inspector)
   #f
   '()
   #f
   'create-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 effect1402
  (begin
    (register-struct-constructor! create-fd-output-port)
    (register-struct-predicate! fd-output-port?)
    (register-struct-field-accessor! fd-output-port-fd struct:fd-output-port 0)
    (register-struct-field-accessor!
     fd-output-port-fd-refcount
     struct:fd-output-port
     1)
    (register-struct-field-accessor!
     fd-output-port-bstr
     struct:fd-output-port
     2)
    (register-struct-field-accessor!
     fd-output-port-start-pos
     struct:fd-output-port
     3)
    (register-struct-field-accessor!
     fd-output-port-end-pos
     struct:fd-output-port
     4)
    (register-struct-field-accessor!
     fd-output-port-flush-handle
     struct:fd-output-port
     5)
    (register-struct-field-accessor!
     fd-output-port-buffer-mode
     struct:fd-output-port
     6)
    (register-struct-field-accessor!
     fd-output-port-custodian-reference
     struct:fd-output-port
     7)
    (register-struct-field-mutator!
     set-fd-output-port-fd!
     struct:fd-output-port
     0)
    (register-struct-field-mutator!
     set-fd-output-port-fd-refcount!
     struct:fd-output-port
     1)
    (register-struct-field-mutator!
     set-fd-output-port-bstr!
     struct:fd-output-port
     2)
    (register-struct-field-mutator!
     set-fd-output-port-start-pos!
     struct:fd-output-port
     3)
    (register-struct-field-mutator!
     set-fd-output-port-end-pos!
     struct:fd-output-port
     4)
    (register-struct-field-mutator!
     set-fd-output-port-flush-handle!
     struct:fd-output-port
     5)
    (register-struct-field-mutator!
     set-fd-output-port-buffer-mode!
     struct:fd-output-port
     6)
    (register-struct-field-mutator!
     set-fd-output-port-custodian-reference!
     struct:fd-output-port
     7)
    (void)))
(define struct:fd-output-port-methods.1
  (make-record-type-descriptor*
   'fd-output-port-methods
   struct:core-output-port-methods.1
   #f
   #f
   #f
   2
   3))
(define effect1404
  (struct-type-install-properties!
   struct:fd-output-port-methods.1
   'fd-output-port-methods
   2
   0
   struct:core-output-port-methods.1
   null
   (current-inspector)
   #f
   '(0 1)
   #f
   'fd-output-port-methods))
(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?.11403
  (|#%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?.11403 v)
       #t
       ($value
        (if (impersonator? v)
          (fd-output-port-methods?.11403 (impersonator-val v))
          #f))))))
(define fd-output-port-methods-on-close.11405
  (|#%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?.11403 s)
       (fd-output-port-methods-on-close.11405 s)
       ($value
        (impersonate-ref
         fd-output-port-methods-on-close.11405
         struct:fd-output-port-methods.1
         0
         s
         'fd-output-port-methods
         'on-close))))))
(define fd-output-port-methods-raise-write-error.11406
  (|#%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?.11403 s)
       (fd-output-port-methods-raise-write-error.11406 s)
       ($value
        (impersonate-ref
         fd-output-port-methods-raise-write-error.11406
         struct:fd-output-port-methods.1
         1
         s
         'fd-output-port-methods
         'raise-write-error))))))
(define effect1407
  (begin
    (register-struct-constructor! fd-output-port-methods26.1)
    (register-struct-predicate! fd-output-port-methods?.1)
    (register-struct-field-accessor!
     fd-output-port-methods-on-close.1
     struct:fd-output-port-methods.1
     0)
    (register-struct-field-accessor!
     fd-output-port-methods-raise-write-error.1
     struct:fd-output-port-methods.1
     1)
    (void)))
(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
                (begin
                  (|#%app| temp19.1 this-id_0 #f)
                  (|#%app| 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 ((fd255_0 (|#%app| fd-output-port-fd this-id_0)))
                        (let ((fd-refcount256_0
                               (fd-output-port-fd-refcount this-id_0)))
                          (let ((fd255_1 fd255_0))
                            (fd-close.1 #f fd255_1 fd-refcount256_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)
              (begin
                (let ((pos_0
                       (let ((app_4 get-file-position))
                         (|#%app|
                          app_4
                          (|#%app| 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 pos257_0)
              (begin
                (|#%app| temp19.1 this-id_0 #f)
                (if (fd-output-port-bstr this-id_0)
                  (void)
                  (check-not-closed 'file-position this-id_0))
                (let ((app_4 set-file-position))
                  (|#%app|
                   app_4
                   (|#%app| fd-output-port-fd this-id_0)
                   pos257_0))))))
           (|#%name|
            buffer-mode
            (case-lambda
             ((this-id_0) (begin (fd-output-port-buffer-mode this-id_0)))
             ((this-id_0 mode313_0)
              (set-fd-output-port-buffer-mode! this-id_0 mode313_0))))
           (letrec ((procz3 (lambda (v_0) #f))
                    (procz2 (lambda (v_0) #f))
                    (procz1 (lambda (v_0) #f)))
             (|#%name|
              write-out
              (lambda (this-id_0
                       src-bstr369_0
                       src-start370_0
                       src-end371_0
                       nonbuffer/nonblock?372_0
                       enable-break?373_0
                       copy?374_0)
                (begin
                  (begin
                    (|#%app| temp23.1 this-id_0)
                    (if (fx= src-start370_0 src-end371_0)
                      (let ((or-part_0 (if (|#%app| temp18.1 this-id_0) 0 #f)))
                        (if or-part_0
                          or-part_0
                          (wrap-evt (core-output-port-evt this-id_0) procz1)))
                      (if (if (not
                               (eq?
                                (fd-output-port-buffer-mode this-id_0)
                                'none))
                            (if (not nonbuffer/nonblock?372_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-end371_0 src-start370_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-bstr369_0
                                 src-start370_0
                                 (fx+ src-start370_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)
                              (|#%app|
                               temp20.1
                               this-id_0
                               src-bstr369_0
                               src-start370_0
                               src-end371_0
                               enable-break?373_0)
                              (void))
                            (|#%app| temp22.1 this-id_0 amt_0)
                            amt_0))
                        (if (not (|#%app| temp18.1 this-id_0))
                          (wrap-evt (core-output-port-evt this-id_0) procz2)
                          (let ((n_0
                                 (|#%app|
                                  rktio_write_in
                                  (unsafe-place-local-ref cell.1)
                                  (|#%app| fd-output-port-fd this-id_0)
                                  src-bstr369_0
                                  src-start370_0
                                  src-end371_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)
                                 procz3)
                                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) (begin (void))))
           (|#%name|
            raise-write-error
            (lambda (this-id_0 n435_0)
              (begin
                (raise-filesystem-error
                 #f
                 n435_0
                 "error writing to stream port"))))))))))
(define temp22.1
  (|#%name|
   fast-mode!
   (lambda (this-id_0 amt464_0)
     (begin
       (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 amt464_0) e_0))
                       (void))))))))
         (void))))))
(define temp23.1
  (|#%name|
   slow-mode!
   (lambda (this-id_0)
     (begin
       (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) (begin (temp19.1 this-id_0 #f)))))
(define temp25.1
  (|#%name|
   rktio-flushed?
   (lambda (this-id_0)
     (begin
       (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)
            (|#%app| fd-output-port-fd this-id_0))))))))
(define temp18.1
  (|#%name|
   flush-buffer
   (lambda (this-id_0)
     (begin
       (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 (|#%app| 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?601_0)
     (begin
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda ()
             (begin
               (if (temp18.1 this-id_0)
                 (void)
                 (begin
                   (unsafe-end-atomic)
                   (if enable-break?601_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
  (letrec ((procz2 (lambda (x_0) (unsafe-bytes-length x_0)))
           (procz1 (lambda (x_0) (bytes? x_0)))
           (for-loop_0
            (|#%name|
             for-loop
             (lambda (enable-break?633_0 stop*_0 this-id_0 v*_0 idx_0)
               (begin
                 (if (unsafe-fx< idx_0 stop*_0)
                   (let ((b_0 (unsafe-bytes-ref v*_0 idx_0)))
                     (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?633_0)
                             (void))
                           (if newline?_0
                             (values)
                             (next-k-proc_0
                              enable-break?633_0
                              idx_0
                              stop*_0
                              this-id_0
                              v*_0))))))
                   (values))))))
           (next-k-proc_0
            (|#%name|
             next-k-proc
             (lambda (enable-break?633_0 idx_0 stop*_0 this-id_0 v*_0)
               (begin
                 (for-loop_0
                  enable-break?633_0
                  stop*_0
                  this-id_0
                  v*_0
                  (unsafe-fx+ idx_0 1)))))))
    (|#%name|
     flush-buffer-fully-if-newline
     (lambda (this-id_0
              src-bstr630_0
              src-start631_0
              src-end632_0
              enable-break?633_0)
       (begin
         (begin
           (call-with-values
            (lambda ()
              (normalise-inputs
               'in-bytes
               "bytes"
               procz1
               procz2
               src-bstr630_0
               src-start631_0
               src-end632_0
               1))
            (case-lambda
             ((v*_0 start*_0 stop*_0 step*_0)
              (begin
                #t
                (for-loop_0
                 enable-break?633_0
                 stop*_0
                 this-id_0
                 v*_0
                 start*_0)))
             (args (raise-binding-result-arity-error 4 args))))
           (void)))))))
(define temp21.1
  (|#%name|
   flush-rktio-buffer-fully
   (lambda (this-id_0)
     (begin
       (if (temp25.1 this-id_0)
         (void)
         (begin
           (unsafe-end-atomic)
           (sync (|#%app| 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)
     (begin
       (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 ((temp692_0
                    (let ((app_0 (make-bytes 4096)))
                      (create-fd-output-port
                       fd-output-port-vtable.1
                       name36_0
                       (direct2.1 #f 0 0)
                       #f
                       #f
                       0
                       #f
                       always-evt
                       #f
                       #f
                       #f
                       fd35_0
                       fd-refcount_0
                       app_0
                       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 temp692_0)))))))))
(define finish-fd-output-port.1
  (|#%name|
   finish-fd-output-port
   (lambda (custodian39_0 plumber38_0 p42_0)
     (begin
       (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 (|#%app| fd-output-port-fd p42_0)))
             (let ((fd-refcount_0 (fd-output-port-fd-refcount p42_0)))
               (let ((evt_0 (|#%app| 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)
     (begin
       (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)
        (|#%app| fd-input-port-fd cp_0)
        (if (fd-output-port? cp_0) (|#%app| fd-output-port-fd cp_0) #f)))))
(define 1/port-waiting-peer?
  (|#%name|
   port-waiting-peer?
   (lambda (p_0)
     (begin
       (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
           (let ((app_0 (if (eof-object? pos_0) 0 pos_0)))
             (|#%app|
              rktio_set_file_position
              (unsafe-place-local-ref cell.1)
              fd_0
              app_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
                    (format-rktio-message 'file-position r_0 base-msg_0)))
               (|#%app| exn:fail app_0 (current-continuation-marks))))))
        (void)))))
(define struct:fd-evt (make-record-type-descriptor* 'fd-evt #f #f #f #f 3 7))
(define effect1501
  (struct-type-install-properties!
   struct:fd-evt
   'fd-evt
   3
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (letrec ((procz1 (lambda (s_0) 0)))
        (lambda (fde_0 ctx_0)
          (if (core-port-closed? (|#%app| fd-evt-closed fde_0))
            (values '(0) #f)
            (let ((mode_0 (|#%app| 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)
                                (|#%app| 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)
                             (|#%app| 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 (|#%app| 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 procz1))
                      (begin
                        (sandman-poll-ctx-add-poll-set-adder!
                         ctx_0
                         (lambda (ps_0)
                           (|#%app|
                            rktio_poll_add
                            (unsafe-place-local-ref cell.1)
                            (|#%app| fd-evt-fd fde_0)
                            ps_0
                            mode_0)))
                        (values #f fde_0)))))))))))))
   (current-inspector)
   #f
   '(0 1)
   #f
   'fd-evt))
(define fd-evt44.1
  (|#%name|
   fd-evt
   (record-constructor
    (make-record-constructor-descriptor struct:fd-evt #f #f))))
(define fd-evt?1500 (|#%name| fd-evt? (record-predicate struct:fd-evt)))
(define fd-evt?
  (|#%name|
   fd-evt?
   (lambda (v)
     (if (fd-evt?1500 v)
       #t
       ($value
        (if (impersonator? v) (fd-evt?1500 (impersonator-val v)) #f))))))
(define fd-evt-fd1524 (|#%name| fd-evt-fd (record-accessor struct:fd-evt 0)))
(define fd-evt-fd
  (|#%name|
   fd-evt-fd
   (lambda (s)
     (if (fd-evt?1500 s)
       (fd-evt-fd1524 s)
       ($value
        (impersonate-ref fd-evt-fd1524 struct:fd-evt 0 s 'fd-evt 'fd))))))
(define fd-evt-mode1525
  (|#%name| fd-evt-mode (record-accessor struct:fd-evt 1)))
(define fd-evt-mode
  (|#%name|
   fd-evt-mode
   (lambda (s)
     (if (fd-evt?1500 s)
       (fd-evt-mode1525 s)
       ($value
        (impersonate-ref fd-evt-mode1525 struct:fd-evt 1 s 'fd-evt 'mode))))))
(define fd-evt-closed1526
  (|#%name| fd-evt-closed (record-accessor struct:fd-evt 2)))
(define fd-evt-closed
  (|#%name|
   fd-evt-closed
   (lambda (s)
     (if (fd-evt?1500 s)
       (fd-evt-closed1526 s)
       ($value
        (impersonate-ref
         fd-evt-closed1526
         struct:fd-evt
         2
         s
         'fd-evt
         'closed))))))
(define set-fd-evt-closed!1527
  (|#%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?1500 s)
       (set-fd-evt-closed!1527 s v)
       ($value
        (impersonate-set!
         set-fd-evt-closed!1527
         struct:fd-evt
         2
         2
         s
         v
         'fd-evt
         'closed))))))
(define effect1528
  (begin
    (register-struct-constructor! fd-evt44.1)
    (register-struct-predicate! fd-evt?)
    (register-struct-field-accessor! fd-evt-fd struct:fd-evt 0)
    (register-struct-field-accessor! fd-evt-mode struct:fd-evt 1)
    (register-struct-field-accessor! fd-evt-closed struct:fd-evt 2)
    (register-struct-field-mutator! set-fd-evt-closed! struct:fd-evt 2)
    (void)))
(define struct:rktio-fd-flushed-evt
  (make-record-type-descriptor* 'rktio-fd-flushed-evt #f #f #f #f 1 1))
(define effect1530
  (struct-type-install-properties!
   struct:rktio-fd-flushed-evt
   'rktio-fd-flushed-evt
   1
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (ffe_0 ctx_0)
        (let ((p_0 (|#%app| 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)
                    (|#%app| fd-output-port-fd p_0)
                    ps_0
                    8))))
              (values #f (list ffe_0)))))))))
   (current-inspector)
   #f
   '(0)
   #f
   '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?1529
  (|#%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?1529 v)
       #t
       ($value
        (if (impersonator? v)
          (rktio-fd-flushed-evt?1529 (impersonator-val v))
          #f))))))
(define rktio-fd-flushed-evt-p1536
  (|#%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?1529 s)
       (rktio-fd-flushed-evt-p1536 s)
       ($value
        (impersonate-ref
         rktio-fd-flushed-evt-p1536
         struct:rktio-fd-flushed-evt
         0
         s
         'rktio-fd-flushed-evt
         'p))))))
(define effect1537
  (begin
    (register-struct-constructor! rktio-fd-flushed-evt45.1)
    (register-struct-predicate! rktio-fd-flushed-evt?)
    (register-struct-field-accessor!
     rktio-fd-flushed-evt-p
     struct:rktio-fd-flushed-evt
     0)
    (void)))
(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
  (letrec ((procz2
            (|#%name|
             opener
             (lambda (port_0 name_0)
               (begin
                 (open-output-fd.1
                  'infer
                  unsafe-undefined
                  unsafe-undefined
                  unsafe-undefined
                  port_0
                  name_0)))))
           (procz1
            (|#%name|
             opener
             (lambda (port_0 name_0)
               (begin
                 (open-input-fd.1
                  unsafe-undefined
                  unsafe-undefined
                  port_0
                  name_0))))))
    (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 procz1 procz2)))))
                  (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
                        (format-rktio-message
                         'place-channel-put
                         new-fd_0
                         base-msg_0)))
                   (|#%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$7 (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$7)
   (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$7
       (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$7))
      (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
  (letrec ((procz1 (|#%name| timeout (lambda () (begin 0)))))
    (|#%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)
       (begin
         (letrec*
          ((loop_0
            (|#%name|
             loop
             (lambda (in_0 extra-count-ins_0)
               (begin
                 (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
                                               (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
                                                                  procz1
                                                                  #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)
                                       (loop_0
                                        (->core-input-port.1
                                         unsafe-undefined
                                         read-in_0
                                         #f)
                                        (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)
     (begin
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda (in_0)
             (begin
               (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)
                                               (begin
                                                 (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
                                                           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
       (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)
     (begin
       (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
       (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)
     (begin
       (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
  (letrec ((finish_0
            (|#%name|
             finish
             (lambda (as-string?_0 bstr_0 buffer_0 in_0 pos_0 end_0 read-end_0)
               (begin
                 (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_0
                               '#\xfffd)
                              (subbytes bstr_0 pos_0 end_0))))
                       (begin (unsafe-end-atomic) result_0)))))))))
    (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)))))
                (letrec*
                 ((loop_0
                   (|#%name|
                    loop
                    (lambda (i_0)
                      (begin
                        (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
                               as-string?_0
                               bstr_0
                               buffer_0
                               in_0
                               pos_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
                                   as-string?_0
                                   bstr_0
                                   buffer_0
                                   in_0
                                   pos_0
                                   i_0
                                   (fx+ i_0 2))
                                  (if cr?_0
                                    (finish_0
                                     as-string?_0
                                     bstr_0
                                     buffer_0
                                     in_0
                                     pos_0
                                     i_0
                                     (fx+ i_0 1))
                                    (loop_0 (fx+ i_0 1))))
                                (loop_0 (fx+ i_0 1)))))))))))
                 (loop_0 pos_0))))))))))
(define struct:progress-evt
  (make-record-type-descriptor* 'progress-evt #f #f #f #f 2 3))
(define effect1596
  (struct-type-install-properties!
   struct:progress-evt
   'progress-evt
   2
   0
   #f
   (list
    (cons
     prop:evt
     (lambda (pe_0)
       (wrap-evt (|#%app| progress-evt-evt pe_0) (lambda args_0 pe_0)))))
   (current-inspector)
   #f
   '(0 1)
   #f
   'progress-evt))
(define progress-evt1.1
  (|#%name|
   progress-evt
   (record-constructor
    (make-record-constructor-descriptor struct:progress-evt #f #f))))
(define 1/progress-evt?1595
  (|#%name| progress-evt? (record-predicate struct:progress-evt)))
(define 1/progress-evt?
  (|#%name|
   progress-evt?
   (lambda (v)
     (if (1/progress-evt?1595 v)
       #t
       ($value
        (if (impersonator? v)
          (1/progress-evt?1595 (impersonator-val v))
          #f))))))
(define progress-evt-port1599
  (|#%name| progress-evt-port (record-accessor struct:progress-evt 0)))
(define progress-evt-port
  (|#%name|
   progress-evt-port
   (lambda (s)
     (if (1/progress-evt?1595 s)
       (progress-evt-port1599 s)
       ($value
        (impersonate-ref
         progress-evt-port1599
         struct:progress-evt
         0
         s
         'progress-evt
         'port))))))
(define progress-evt-evt1600
  (|#%name| progress-evt-evt (record-accessor struct:progress-evt 1)))
(define progress-evt-evt
  (|#%name|
   progress-evt-evt
   (lambda (s)
     (if (1/progress-evt?1595 s)
       (progress-evt-evt1600 s)
       ($value
        (impersonate-ref
         progress-evt-evt1600
         struct:progress-evt
         1
         s
         'progress-evt
         'evt))))))
(define effect1601
  (begin
    (register-struct-constructor! progress-evt1.1)
    (register-struct-predicate! 1/progress-evt?)
    (register-struct-field-accessor! progress-evt-port struct:progress-evt 0)
    (register-struct-field-accessor! progress-evt-evt struct:progress-evt 1)
    (void)))
(define progress-evt?*
  (|#%name|
   progress-evt?
   (case-lambda
    ((v_0) (begin (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
       (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)
            (begin
              (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
      (() (begin (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)
            (begin
              (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
                           (|#%app| 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)
       (begin
         (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 (|#%app| progress-evt-evt progress-evt_0) #f)))
(define 1/flush-output
  (let ((flush-output_0
         (|#%name|
          flush-output
          (lambda (p1_0)
            (begin
              (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)
                        (begin
                          (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
                                        (let ((r_0
                                               (begin
                                                 (unsafe-start-atomic)
                                                 (begin0
                                                   (|#%app|
                                                    write-out_0
                                                    out_0
                                                    #vu8()
                                                    0
                                                    0
                                                    #f
                                                    #f
                                                    #f)
                                                   (unsafe-end-atomic)))))
                                          (letrec*
                                           ((r-loop_0
                                             (|#%name|
                                              r-loop
                                              (lambda (r_1)
                                                (begin
                                                  (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))
                                (wo-loop_0 write-out_0)))))))))
                   (wo-loop_0 p_0)))))))))
    (|#%name|
     flush-output
     (case-lambda
      (() (begin (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$7))
      (begin
        (1/flush-output (unsafe-place-local-ref cell.2$2))
        (1/flush-output (unsafe-place-local-ref cell.3)))
      (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)
                  (begin
                    (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)
            (begin
              (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
      (() (begin (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)
            (begin
              (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) (begin (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)
            (begin
              (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)
       (begin (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
       (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)
            (begin
              (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)
       (begin
         (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)
            (begin
              (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)
       (begin
         (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)
            (begin
              (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)
       (begin
         (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)
                  (begin
                    (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)
            (begin
              (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
      (() (begin (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)
            (begin
              (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) (begin (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)
            (begin
              (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)
       (begin
         (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
       (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)
            (begin
              (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)
       (begin
         (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)
            (begin
              (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)
       (begin
         (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)
            (begin
              (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)
       (begin
         (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
  (letrec ((loop_0
            (|#%name|
             loop
             (lambda (bstr_0
                      consumed-v_0
                      just-peek?4_0
                      orig-in14_0
                      special-ok?6_0
                      str15_0
                      who13_0
                      zero-ok?1_0
                      skip-k_0
                      total-used-bytes_0
                      state_0
                      total-chars_0
                      start_0
                      amt_0)
               (begin
                 (let ((v_0
                        (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_0 0) (zero? consumed-v_0) #f)
                     (values 0 0)
                     (call-with-values
                      (lambda ()
                        (if (eq? v_0 0)
                          (values 0 0 state_0)
                          (let ((temp108_0 (if (integer? v_0) v_0 0)))
                            (let ((temp111_0 (+ start_0 amt_0)))
                              (let ((temp113_0
                                     (if (utf-8-state? state_0) state_0 #f)))
                                (let ((temp114_0
                                       (if (integer? v_0) '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))))))))
                      (case-lambda
                       ((used-bytes_0 got-chars_0 new-state_0)
                        (if (zero? got-chars_0)
                          (let ((app_0 (+ skip-k_0 v_0)))
                            (loop_0
                             bstr_0
                             consumed-v_0
                             just-peek?4_0
                             orig-in14_0
                             special-ok?6_0
                             str15_0
                             who13_0
                             zero-ok?1_0
                             app_0
                             (+ total-used-bytes_0 used-bytes_0)
                             new-state_0
                             total-chars_0
                             start_0
                             amt_0))
                          (let ((actually-used-bytes_0
                                 (let ((app_0
                                        (+ total-used-bytes_0 used-bytes_0)))
                                   (-
                                    app_0
                                    (if (utf-8-state? new-state_0)
                                      (utf-8-state-pending-amt new-state_0)
                                      0)))))
                            (if (< actually-used-bytes_0 consumed-v_0)
                              (let ((app_0 (+ skip-k_0 v_0)))
                                (let ((app_1
                                       (+ total-used-bytes_0 used-bytes_0)))
                                  (let ((app_2 (+ total-chars_0 got-chars_0)))
                                    (let ((app_3 (+ start_0 got-chars_0)))
                                      (loop_0
                                       bstr_0
                                       consumed-v_0
                                       just-peek?4_0
                                       orig-in14_0
                                       special-ok?6_0
                                       str15_0
                                       who13_0
                                       zero-ok?1_0
                                       app_0
                                       app_1
                                       new-state_0
                                       app_2
                                       app_3
                                       (- amt_0 got-chars_0))))))
                              (begin
                                (if just-peek?4_0
                                  (void)
                                  (let ((discard-bytes_0
                                         (-
                                          actually-used-bytes_0
                                          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_0)
                                 actually-used-bytes_0))))))
                       (args
                        (raise-binding-result-arity-error 3 args)))))))))))
    (|#%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)
       (begin
         (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)))
                      (case-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)))
                            (let ((app_0 (+ skip5_0 (- v_0 consumed-v_0))))
                              (let ((app_1 (+ start16_0 got-chars_0)))
                                (loop_0
                                 bstr_0
                                 consumed-v_0
                                 just-peek?4_0
                                 orig-in14_0
                                 special-ok?6_0
                                 str15_0
                                 who13_0
                                 zero-ok?1_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)))))
                       (args
                        (raise-binding-result-arity-error 3 args)))))))))))))))
(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)
     (begin
       (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))
          (case-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)
                      (begin
                        (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)))))
                         (case-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))))))
                          (args
                           (raise-binding-result-arity-error 2 args)))))))))
                 (loop_0 v_0 used-bytes_0)))))
           (args (raise-binding-result-arity-error 2 args)))))))))
(define read-char-via-read-byte.1
  (|#%name|
   read-char-via-read-byte
   (lambda (special-ok?31_0 who33_0 in34_0)
     (begin
       (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))
                (case-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)
                          (begin
                            (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))
                                 (case-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
                                               (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))))
                                  (args
                                   (raise-binding-result-arity-error
                                    3
                                    args)))))))))))
                     (loop_0 0 accum_0 remaining_0))))
                 (args (raise-binding-result-arity-error 3 args))))))))))))
(define read-a-char.1
  (|#%name|
   read-a-char
   (lambda (special-ok?36_0 who38_0 in39_0)
     (begin (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)
            (begin
              (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
      (() (begin (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)
            (begin
              (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) (begin (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)
            (begin
              (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)
       (begin (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)
     (begin
       (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)
     (begin
       (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)
            (begin
              (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
      (() (begin (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)
            (begin
              (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)
       (begin (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)
            (begin
              (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!
                       str71_0
                       in_1
                       start-pos69_0
                       end-pos_0
                       skip-k72_0))))))))))
    (|#%name|
     peek-string!
     (case-lambda
      ((str_0 skip-k_0)
       (begin
         (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)
            (begin
              (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
      (() (begin (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)
            (begin
              (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
      (() (begin (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)
            (begin
              (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
      (() (begin (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)
            (begin
              (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
      (() (begin (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))
                (case-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))))
                 (args (raise-binding-result-arity-error 3 args))))))
          (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)
     (begin
       (letrec*
        ((try-again_0
          (|#%name|
           try-again
           (lambda (out_0 extra-count-outs_0)
             (begin
               (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)
                                         (begin
                                           (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)
                                   (try-again_0
                                    (->core-output-port.1
                                     unsafe-undefined
                                     write-out_0
                                     #f)
                                    (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)
            (begin
              (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) (begin (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)
          (begin
            (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
       (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
       (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)
            (begin
              (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)
       (begin
         (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)
            (begin
              (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)
       (begin
         (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)
            (begin
              (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)
       (begin
         (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)
            (begin
              (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)
       (begin
         (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
       (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)
            (begin
              (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) (begin (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)
            (begin
              (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)
       (begin (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)
          (begin
            (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
       (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
       (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)
               (begin
                 (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
                                 (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)
                                           (begin
                                             (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)
            (begin
              (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) (begin (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)
            (begin
              (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) (begin (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)
            (begin
              (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) (begin (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
         (letrec ((keep-char_0
                   (|#%name|
                    keep-char
                    (lambda (ch_0 cr?_0 crlf?_0 in_0 len_0 lf?_0 pos_0 str_0)
                      (begin
                        (if (fx< pos_0 len_0)
                          (begin
                            (string-set! str_0 pos_0 ch_0)
                            (loop_0
                             cr?_0
                             crlf?_0
                             in_0
                             lf?_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
                                 cr?_0
                                 crlf?_0
                                 in_0
                                 lf?_0
                                 new-str_0
                                 new-len_0
                                 (fx+ pos_0 1))))))))))
                  (loop_0
                   (|#%name|
                    loop
                    (lambda (cr?_0 crlf?_0 in_0 lf?_0 str_0 len_0 pos_0)
                      (begin
                        (let ((ch_0 (read-a-char.1 #f 'read-line in_0)))
                          (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
                                   ch_0
                                   cr?_0
                                   crlf?_0
                                   in_0
                                   len_0
                                   lf?_0
                                   pos_0
                                   str_0)))
                              (if (if lf?_0 (eqv? ch_0 (values '#\xa)) #f)
                                (substring str_0 0 pos_0)
                                (keep-char_0
                                 ch_0
                                 cr?_0
                                 crlf?_0
                                 in_0
                                 len_0
                                 lf?_0
                                 pos_0
                                 str_0))))))))))
           (|#%name|
            read-line
            (lambda (orig-in1_0 mode2_0)
              (begin
                (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
                                  (loop_0
                                   cr?_0
                                   crlf?_0
                                   in_0
                                   lf?_0
                                   (make-string 32)
                                   32
                                   0))))))))))))))))
    (|#%name|
     read-line
     (case-lambda
      (() (begin (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
         (letrec ((keep-char_0
                   (|#%name|
                    keep-char
                    (lambda (ch_0 cr?_0 crlf?_0 in_0 len_0 lf?_0 pos_0 str_0)
                      (begin
                        (if (fx< pos_0 len_0)
                          (begin
                            (unsafe-bytes-set! str_0 pos_0 ch_0)
                            (loop_0
                             cr?_0
                             crlf?_0
                             in_0
                             lf?_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
                                 cr?_0
                                 crlf?_0
                                 in_0
                                 lf?_0
                                 new-str_0
                                 new-len_0
                                 (fx+ pos_0 1))))))))))
                  (loop_0
                   (|#%name|
                    loop
                    (lambda (cr?_0 crlf?_0 in_0 lf?_0 str_0 len_0 pos_0)
                      (begin
                        (let ((ch_0 (read-a-byte.1 #f 'read-bytes-line in_0)))
                          (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
                                   ch_0
                                   cr?_0
                                   crlf?_0
                                   in_0
                                   len_0
                                   lf?_0
                                   pos_0
                                   str_0)))
                              (if (if lf?_0 (eqv? ch_0 10) #f)
                                (subbytes str_0 0 pos_0)
                                (keep-char_0
                                 ch_0
                                 cr?_0
                                 crlf?_0
                                 in_0
                                 len_0
                                 lf?_0
                                 pos_0
                                 str_0))))))))))
           (|#%name|
            read-bytes-line
            (lambda (orig-in3_0 mode4_0)
              (begin
                (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
                                  (loop_0
                                   cr?_0
                                   crlf?_0
                                   in_0
                                   lf?_0
                                   (make-bytes 32)
                                   32
                                   0))))))))))))))))
    (|#%name|
     read-bytes-line
     (case-lambda
      (() (begin (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$6 (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$6) loc_0)))
        (void)
        (begin
          (unsafe-place-local-set! cell.1$6 (1/current-locale))
          (|#%app|
           rktio_set_locale
           (unsafe-place-local-ref cell.1)
           (1/string->bytes/utf-8 (unsafe-place-local-ref cell.1$6))))))))
(define effect1674 (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 ()
    (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
                      (format-rktio-message
                       'locale-string-encoding
                       e_0
                       base-msg_0)))
                 (|#%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 ()
     (begin
       (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
       (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
                         (format-rktio-message
                          'system-language+country
                          c_0
                          base-msg_0)))
                    (|#%app| exn:fail app_0 (current-continuation-marks))))))
             (begin0
               (|#%app| rktio_to_bytes c_0)
               (|#%app| rktio_free c_0)
               (unsafe-end-atomic)))))))))
(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 struct:utf-8-converter
  (make-record-type-descriptor* 'utf-8-converter #f #f #f #f 2 3))
(define effect1691
  (struct-type-install-properties!
   struct:utf-8-converter
   'utf-8-converter
   2
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1)
   #f
   '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?1690
  (|#%name| utf-8-converter? (record-predicate struct:utf-8-converter)))
(define utf-8-converter?
  (|#%name|
   utf-8-converter?
   (lambda (v)
     (if (utf-8-converter?1690 v)
       #t
       ($value
        (if (impersonator? v)
          (utf-8-converter?1690 (impersonator-val v))
          #f))))))
(define utf-8-converter-from1692
  (|#%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?1690 s)
       (utf-8-converter-from1692 s)
       ($value
        (impersonate-ref
         utf-8-converter-from1692
         struct:utf-8-converter
         0
         s
         'utf-8-converter
         'from))))))
(define utf-8-converter-to1693
  (|#%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?1690 s)
       (utf-8-converter-to1693 s)
       ($value
        (impersonate-ref
         utf-8-converter-to1693
         struct:utf-8-converter
         1
         s
         'utf-8-converter
         'to))))))
(define effect1694
  (begin
    (register-struct-constructor! utf-8-converter1.1)
    (register-struct-predicate! utf-8-converter?)
    (register-struct-field-accessor!
     utf-8-converter-from
     struct:utf-8-converter
     0)
    (register-struct-field-accessor!
     utf-8-converter-to
     struct:utf-8-converter
     1)
    (void)))
(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 'utf-16-ish)))
                     (if or-part_1 or-part_1 (eq? from_0 'utf-16-assume)))))
             (let ((temp33_0 (eq? from_0 'utf-16-ish)))
               (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 'utf-8-ish-permissive))))
                 (let ((temp42_0
                        (let ((or-part_1 (eq? from_0 'utf-8-ish)))
                          (if or-part_1
                            or-part_1
                            (eq? from_0 'utf-8-ish-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 'utf-16-ish)))
                                (if or-part_2
                                  or-part_2
                                  (eq? to_0 'utf-16-assume)))))))
                     (let ((temp42_1 temp42_0) (temp41_1 temp41_0))
                       (utf-8-ish-reencode!.1
                        temp42_1
                        temp41_1
                        temp43_0
                        src_0
                        src-start_0
                        src-end_0
                        dest_0
                        dest-start_0
                        dest-end_0))))))))
         (case-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)))))
          (args (raise-binding-result-arity-error 3 args))))))))
(define utf-8-ish-reencode!.1
  (letrec ((continue-after-permissive_0
            (|#%name|
             continue-after-permissive
             (lambda (base-i_0
                      from-utf-8-ish?3_0
                      in-bstr8_0
                      in-end10_0
                      in-start9_0
                      out-bstr11_0
                      out-end13_0
                      out-start12_0
                      permissive?2_0
                      to-utf-16?4_0
                      next-j_0)
               (begin
                 (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
                      from-utf-8-ish?3_0
                      in-bstr8_0
                      in-end10_0
                      in-start9_0
                      out-bstr11_0
                      out-end13_0
                      out-start12_0
                      permissive?2_0
                      to-utf-16?4_0
                      next-i_0
                      next-j_0
                      next-i_0
                      0
                      0)))))))
           (continue_0
            (|#%name|
             continue
             (lambda (from-utf-8-ish?3_0
                      i_0
                      in-bstr8_0
                      in-end10_0
                      in-start9_0
                      out-bstr11_0
                      out-end13_0
                      out-start12_0
                      permissive?2_0
                      to-utf-16?4_0
                      next-j_0)
               (begin
                 (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
                      from-utf-8-ish?3_0
                      in-bstr8_0
                      in-end10_0
                      in-start9_0
                      out-bstr11_0
                      out-end13_0
                      out-start12_0
                      permissive?2_0
                      to-utf-16?4_0
                      next-i_0
                      next-j_0
                      next-i_0
                      0
                      0)))))))
           (encoding-failure_0
            (|#%name|
             encoding-failure
             (lambda (base-i_0
                      from-utf-8-ish?3_0
                      in-bstr8_0
                      in-end10_0
                      in-start9_0
                      j_0
                      out-bstr11_0
                      out-end13_0
                      out-start12_0
                      permissive?2_0
                      to-utf-16?4_0)
               (begin
                 (if permissive?2_0
                   (if (if (not to-utf-16?4_0) (<= (+ j_0 3) out-end13_0) #f)
                     (begin
                       (unsafe-bytes-set! out-bstr11_0 j_0 239)
                       (unsafe-bytes-set! out-bstr11_0 (+ j_0 1) 191)
                       (unsafe-bytes-set! out-bstr11_0 (+ j_0 2) 189)
                       (continue-after-permissive_0
                        base-i_0
                        from-utf-8-ish?3_0
                        in-bstr8_0
                        in-end10_0
                        in-start9_0
                        out-bstr11_0
                        out-end13_0
                        out-start12_0
                        permissive?2_0
                        to-utf-16?4_0
                        (+ j_0 3)))
                     (if (if to-utf-16?4_0 (<= (+ j_0 2) out-end13_0) #f)
                       (begin
                         (bytes-set-two! out-bstr11_0 j_0 255 253)
                         (continue-after-permissive_0
                          base-i_0
                          from-utf-8-ish?3_0
                          in-bstr8_0
                          in-end10_0
                          in-start9_0
                          out-bstr11_0
                          out-end13_0
                          out-start12_0
                          permissive?2_0
                          to-utf-16?4_0
                          (+ j_0 2)))
                       (let ((app_0 (- base-i_0 in-start9_0)))
                         (values app_0 (- j_0 out-start12_0) 'continues))))
                   (let ((app_0 (- base-i_0 in-start9_0)))
                     (values app_0 (- j_0 out-start12_0) 'error)))))))
           (loop_0
            (|#%name|
             loop
             (lambda (from-utf-8-ish?3_0
                      in-bstr8_0
                      in-end10_0
                      in-start9_0
                      out-bstr11_0
                      out-end13_0
                      out-start12_0
                      permissive?2_0
                      to-utf-16?4_0
                      i_0
                      j_0
                      base-i_0
                      accum_0
                      remaining_0)
               (begin
                 (if (= i_0 in-end10_0)
                   (if (zero? remaining_0)
                     (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 (not to-utf-16?4_0) (< j_0 out-end13_0) #f)
                           (begin
                             (unsafe-bytes-set! out-bstr11_0 j_0 b_0)
                             (continue_0
                              from-utf-8-ish?3_0
                              i_0
                              in-bstr8_0
                              in-end10_0
                              in-start9_0
                              out-bstr11_0
                              out-end13_0
                              out-start12_0
                              permissive?2_0
                              to-utf-16?4_0
                              (add1 j_0)))
                           (if (< (add1 j_0) out-end13_0)
                             (begin
                               (bytes-set-two! out-bstr11_0 j_0 0 b_0)
                               (continue_0
                                from-utf-8-ish?3_0
                                i_0
                                in-bstr8_0
                                in-end10_0
                                in-start9_0
                                out-bstr11_0
                                out-end13_0
                                out-start12_0
                                permissive?2_0
                                to-utf-16?4_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
                          base-i_0
                          from-utf-8-ish?3_0
                          in-bstr8_0
                          in-end10_0
                          in-start9_0
                          j_0
                          out-bstr11_0
                          out-end13_0
                          out-start12_0
                          permissive?2_0
                          to-utf-16?4_0))
                       (if (= 128 (bitwise-and b_0 192))
                         (if (zero? remaining_0)
                           (encoding-failure_0
                            base-i_0
                            from-utf-8-ish?3_0
                            in-bstr8_0
                            in-end10_0
                            in-start9_0
                            j_0
                            out-bstr11_0
                            out-end13_0
                            out-start12_0
                            permissive?2_0
                            to-utf-16?4_0)
                           (let ((next_0 (bitwise-and b_0 63)))
                             (let ((next-accum_0
                                    (+ (arithmetic-shift accum_0 6) next_0)))
                               (if (= 1 remaining_0)
                                 (let ((next-i_0 (add1 i_0)))
                                   (if (< next-accum_0 128)
                                     (encoding-failure_0
                                      base-i_0
                                      from-utf-8-ish?3_0
                                      in-bstr8_0
                                      in-end10_0
                                      in-start9_0
                                      j_0
                                      out-bstr11_0
                                      out-end13_0
                                      out-start12_0
                                      permissive?2_0
                                      to-utf-16?4_0)
                                     (if (if from-utf-8-ish?3_0
                                           from-utf-8-ish?3_0
                                           (not
                                            (let ((or-part_0
                                                   (> next-accum_0 1114111)))
                                              (if or-part_0
                                                or-part_0
                                                (if (>= next-accum_0 55296)
                                                  (<= next-accum_0 57343)
                                                  #f)))))
                                       (if to-utf-16?4_0
                                         (if (if (< next-accum_0 65536)
                                               (<= (+ j_0 2) out-end13_0)
                                               #f)
                                           (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
                                              from-utf-8-ish?3_0
                                              i_0
                                              in-bstr8_0
                                              in-end10_0
                                              in-start9_0
                                              out-bstr11_0
                                              out-end13_0
                                              out-start12_0
                                              permissive?2_0
                                              to-utf-16?4_0
                                              (+ j_0 2)))
                                           (if (<= (+ j_0 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_0
                                                        app_0
                                                        (bitwise-and
                                                         hi_0
                                                         255)))
                                                     (let ((app_0 (+ j_0 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
                                                      from-utf-8-ish?3_0
                                                      i_0
                                                      in-bstr8_0
                                                      in-end10_0
                                                      in-start9_0
                                                      out-bstr11_0
                                                      out-end13_0
                                                      out-start12_0
                                                      permissive?2_0
                                                      to-utf-16?4_0
                                                      (+ j_0 4))))))
                                             (let ((app_0
                                                    (- base-i_0 in-start9_0)))
                                               (values
                                                app_0
                                                (- j_0 out-start12_0)
                                                'continues))))
                                         (letrec*
                                          ((loop_1
                                            (|#%name|
                                             loop
                                             (lambda (from-i_0 to-j_0)
                                               (begin
                                                 (if (= from-i_0 next-i_0)
                                                   (continue_0
                                                    from-utf-8-ish?3_0
                                                    i_0
                                                    in-bstr8_0
                                                    in-end10_0
                                                    in-start9_0
                                                    out-bstr11_0
                                                    out-end13_0
                                                    out-start12_0
                                                    permissive?2_0
                                                    to-utf-16?4_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)))
                                       (encoding-failure_0
                                        base-i_0
                                        from-utf-8-ish?3_0
                                        in-bstr8_0
                                        in-end10_0
                                        in-start9_0
                                        j_0
                                        out-bstr11_0
                                        out-end13_0
                                        out-start12_0
                                        permissive?2_0
                                        to-utf-16?4_0))))
                                 (if (if (= 2 remaining_0)
                                       (<= next-accum_0 31)
                                       #f)
                                   (encoding-failure_0
                                    base-i_0
                                    from-utf-8-ish?3_0
                                    in-bstr8_0
                                    in-end10_0
                                    in-start9_0
                                    j_0
                                    out-bstr11_0
                                    out-end13_0
                                    out-start12_0
                                    permissive?2_0
                                    to-utf-16?4_0)
                                   (if (if (= 3 remaining_0)
                                         (<= next-accum_0 15)
                                         #f)
                                     (encoding-failure_0
                                      base-i_0
                                      from-utf-8-ish?3_0
                                      in-bstr8_0
                                      in-end10_0
                                      in-start9_0
                                      j_0
                                      out-bstr11_0
                                      out-end13_0
                                      out-start12_0
                                      permissive?2_0
                                      to-utf-16?4_0)
                                     (let ((app_0 (add1 i_0)))
                                       (loop_0
                                        from-utf-8-ish?3_0
                                        in-bstr8_0
                                        in-end10_0
                                        in-start9_0
                                        out-bstr11_0
                                        out-end13_0
                                        out-start12_0
                                        permissive?2_0
                                        to-utf-16?4_0
                                        app_0
                                        j_0
                                        base-i_0
                                        next-accum_0
                                        (sub1 remaining_0)))))))))
                         (if (not (zero? remaining_0))
                           (encoding-failure_0
                            base-i_0
                            from-utf-8-ish?3_0
                            in-bstr8_0
                            in-end10_0
                            in-start9_0
                            j_0
                            out-bstr11_0
                            out-end13_0
                            out-start12_0
                            permissive?2_0
                            to-utf-16?4_0)
                           (if (= 192 (bitwise-and b_0 224))
                             (let ((accum_1 (bitwise-and b_0 31)))
                               (if (zero? accum_1)
                                 (encoding-failure_0
                                  base-i_0
                                  from-utf-8-ish?3_0
                                  in-bstr8_0
                                  in-end10_0
                                  in-start9_0
                                  j_0
                                  out-bstr11_0
                                  out-end13_0
                                  out-start12_0
                                  permissive?2_0
                                  to-utf-16?4_0)
                                 (loop_0
                                  from-utf-8-ish?3_0
                                  in-bstr8_0
                                  in-end10_0
                                  in-start9_0
                                  out-bstr11_0
                                  out-end13_0
                                  out-start12_0
                                  permissive?2_0
                                  to-utf-16?4_0
                                  (add1 i_0)
                                  j_0
                                  i_0
                                  accum_1
                                  1)))
                             (if (= 224 (bitwise-and b_0 240))
                               (let ((accum_1 (bitwise-and b_0 15)))
                                 (loop_0
                                  from-utf-8-ish?3_0
                                  in-bstr8_0
                                  in-end10_0
                                  in-start9_0
                                  out-bstr11_0
                                  out-end13_0
                                  out-start12_0
                                  permissive?2_0
                                  to-utf-16?4_0
                                  (add1 i_0)
                                  j_0
                                  i_0
                                  accum_1
                                  2))
                               (if (= 240 (bitwise-and b_0 248))
                                 (let ((accum_1 (bitwise-and b_0 7)))
                                   (if (> accum_1 4)
                                     (encoding-failure_0
                                      base-i_0
                                      from-utf-8-ish?3_0
                                      in-bstr8_0
                                      in-end10_0
                                      in-start9_0
                                      j_0
                                      out-bstr11_0
                                      out-end13_0
                                      out-start12_0
                                      permissive?2_0
                                      to-utf-16?4_0)
                                     (loop_0
                                      from-utf-8-ish?3_0
                                      in-bstr8_0
                                      in-end10_0
                                      in-start9_0
                                      out-bstr11_0
                                      out-end13_0
                                      out-start12_0
                                      permissive?2_0
                                      to-utf-16?4_0
                                      (add1 i_0)
                                      j_0
                                      i_0
                                      accum_1
                                      3)))
                                 (encoding-failure_0
                                  base-i_0
                                  from-utf-8-ish?3_0
                                  in-bstr8_0
                                  in-end10_0
                                  in-start9_0
                                  j_0
                                  out-bstr11_0
                                  out-end13_0
                                  out-start12_0
                                  permissive?2_0
                                  to-utf-16?4_0))))))))))))))
    (|#%name|
     utf-8-ish-reencode!
     (lambda (from-utf-8-ish?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)
       (begin
         (loop_0
          from-utf-8-ish?3_0
          in-bstr8_0
          in-end10_0
          in-start9_0
          out-bstr11_0
          out-end13_0
          out-start12_0
          permissive?2_0
          to-utf-16?4_0
          in-start9_0
          out-start12_0
          in-start9_0
          0
          0))))))
(define utf-16-ish-reencode!.1
  (letrec ((continue_0
            (|#%name|
             continue
             (lambda (assume-paired-surrogates?16_0
                      from-utf-16-ish?15_0
                      i_0
                      in-bstr19_0
                      in-end21_0
                      in-start20_0
                      j_0
                      out-bstr22_0
                      out-end24_0
                      out-start23_0
                      v_0
                      next-i_0)
               (begin
                 (if (<= v_0 127)
                   (if (if out-end24_0 (= 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_0)
                         (void))
                       (let ((next-j_0 (fx+ j_0 1)))
                         (begin
                           (loop_0
                            assume-paired-surrogates?16_0
                            from-utf-16-ish?15_0
                            in-bstr19_0
                            in-end21_0
                            in-start20_0
                            out-bstr22_0
                            out-end24_0
                            out-start23_0
                            next-i_0
                            next-j_0)))))
                   (if (<= v_0 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
                              (bitwise-ior 192 (arithmetic-shift v_0 -6)))
                             (let ((app_0 (add1 j_0)))
                               (unsafe-bytes-set!
                                out-bstr22_0
                                app_0
                                (bitwise-ior 128 (bitwise-and v_0 63)))))
                           (void))
                         (let ((next-j_0 (+ j_0 2)))
                           (begin
                             (loop_0
                              assume-paired-surrogates?16_0
                              from-utf-16-ish?15_0
                              in-bstr19_0
                              in-end21_0
                              in-start20_0
                              out-bstr22_0
                              out-end24_0
                              out-start23_0
                              next-i_0
                              next-j_0)))))
                     (if (fx<= v_0 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
                                (bitwise-ior 224 (arithmetic-shift v_0 -12)))
                               (let ((app_0 (fx+ j_0 1)))
                                 (unsafe-bytes-set!
                                  out-bstr22_0
                                  app_0
                                  (bitwise-ior
                                   128
                                   (bitwise-and
                                    (arithmetic-shift v_0 -6)
                                    63))))
                               (let ((app_0 (fx+ j_0 2)))
                                 (unsafe-bytes-set!
                                  out-bstr22_0
                                  app_0
                                  (bitwise-ior 128 (bitwise-and v_0 63)))))
                             (void))
                           (let ((next-j_0 (fx+ j_0 3)))
                             (begin
                               (loop_0
                                assume-paired-surrogates?16_0
                                from-utf-16-ish?15_0
                                in-bstr19_0
                                in-end21_0
                                in-start20_0
                                out-bstr22_0
                                out-end24_0
                                out-start23_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
                                (bitwise-ior 240 (arithmetic-shift v_0 -18)))
                               (let ((app_0 (fx+ j_0 1)))
                                 (unsafe-bytes-set!
                                  out-bstr22_0
                                  app_0
                                  (bitwise-ior
                                   128
                                   (bitwise-and
                                    (arithmetic-shift v_0 -12)
                                    63))))
                               (let ((app_0 (fx+ j_0 2)))
                                 (unsafe-bytes-set!
                                  out-bstr22_0
                                  app_0
                                  (bitwise-ior
                                   128
                                   (bitwise-and
                                    (arithmetic-shift v_0 -6)
                                    63))))
                               (let ((app_0 (fx+ j_0 3)))
                                 (unsafe-bytes-set!
                                  out-bstr22_0
                                  app_0
                                  (bitwise-ior 128 (bitwise-and v_0 63)))))
                             (void))
                           (let ((next-j_0 (fx+ j_0 4)))
                             (begin
                               (loop_0
                                assume-paired-surrogates?16_0
                                from-utf-16-ish?15_0
                                in-bstr19_0
                                in-end21_0
                                in-start20_0
                                out-bstr22_0
                                out-end24_0
                                out-start23_0
                                next-i_0
                                next-j_0))))))))))))
           (continue_1
            (|#%name|
             continue
             (lambda (assume-paired-surrogates?16_0
                      from-utf-16-ish?15_0
                      in-bstr19_0
                      in-end21_0
                      in-start20_0
                      next-i_0
                      out-bstr22_0
                      out-end24_0
                      out-start23_0
                      next-j_0)
               (begin
                 (loop_0
                  assume-paired-surrogates?16_0
                  from-utf-16-ish?15_0
                  in-bstr19_0
                  in-end21_0
                  in-start20_0
                  out-bstr22_0
                  out-end24_0
                  out-start23_0
                  next-i_0
                  next-j_0)))))
           (done_0
            (|#%name|
             done
             (lambda (i_0 in-start20_0 j_0 out-start23_0 status_0)
               (begin
                 (let ((app_0 (- i_0 in-start20_0)))
                   (values app_0 (- j_0 out-start23_0) status_0))))))
           (loop_0
            (|#%name|
             loop
             (lambda (assume-paired-surrogates?16_0
                      from-utf-16-ish?15_0
                      in-bstr19_0
                      in-end21_0
                      in-start20_0
                      out-bstr22_0
                      out-end24_0
                      out-start23_0
                      i_0
                      j_0)
               (begin
                 (if (= i_0 in-end21_0)
                   (done_0 i_0 in-start20_0 j_0 out-start23_0 'complete)
                   (if (> (+ i_0 2) in-end21_0)
                     (done_0 i_0 in-start20_0 j_0 out-start23_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))))
                           (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
                                  i_0
                                  in-start20_0
                                  j_0
                                  out-start23_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
                                            assume-paired-surrogates?16_0
                                            from-utf-16-ish?15_0
                                            i_0
                                            in-bstr19_0
                                            in-end21_0
                                            in-start20_0
                                            j_0
                                            out-bstr22_0
                                            out-end24_0
                                            out-start23_0
                                            v3_0
                                            (+ i_0 4)))
                                         (if from-utf-16-ish?15_0
                                           (continue_0
                                            assume-paired-surrogates?16_0
                                            from-utf-16-ish?15_0
                                            i_0
                                            in-bstr19_0
                                            in-end21_0
                                            in-start20_0
                                            j_0
                                            out-bstr22_0
                                            out-end24_0
                                            out-start23_0
                                            v_0
                                            (+ i_0 2))
                                           (done_0
                                            i_0
                                            in-start20_0
                                            j_0
                                            out-start23_0
                                            'error)))))))
                               (if from-utf-16-ish?15_0
                                 (continue_0
                                  assume-paired-surrogates?16_0
                                  from-utf-16-ish?15_0
                                  i_0
                                  in-bstr19_0
                                  in-end21_0
                                  in-start20_0
                                  j_0
                                  out-bstr22_0
                                  out-end24_0
                                  out-start23_0
                                  v_0
                                  (+ i_0 2))
                                 (done_0
                                  i_0
                                  in-start20_0
                                  j_0
                                  out-start23_0
                                  'error)))
                             (continue_0
                              assume-paired-surrogates?16_0
                              from-utf-16-ish?15_0
                              i_0
                              in-bstr19_0
                              in-end21_0
                              in-start20_0
                              j_0
                              out-bstr22_0
                              out-end24_0
                              out-start23_0
                              v_0
                              (+ i_0 2)))))))))))))
    (|#%name|
     utf-16-ish-reencode!
     (lambda (assume-paired-surrogates?16_0
              from-utf-16-ish?15_0
              in-bstr19_0
              in-start20_0
              in-end21_0
              out-bstr22_0
              out-start23_0
              out-end24_0)
       (begin
         (loop_0
          assume-paired-surrogates?16_0
          from-utf-16-ish?15_0
          in-bstr19_0
          in-end21_0
          in-start20_0
          out-bstr22_0
          out-end24_0
          out-start23_0
          in-start20_0
          out-start23_0))))))
(define struct:bytes-converter
  (make-record-type-descriptor* 'bytes-converter #f #f #f #f 2 3))
(define effect1815
  (struct-type-install-properties!
   struct:bytes-converter
   'bytes-converter
   2
   0
   #f
   null
   (current-inspector)
   #f
   '()
   #f
   'bytes-converter))
(define bytes-converter1.1
  (|#%name|
   bytes-converter
   (record-constructor
    (make-record-constructor-descriptor struct:bytes-converter #f #f))))
(define 1/bytes-converter?1814
  (|#%name| bytes-converter? (record-predicate struct:bytes-converter)))
(define 1/bytes-converter?
  (|#%name|
   bytes-converter?
   (lambda (v)
     (if (1/bytes-converter?1814 v)
       #t
       ($value
        (if (impersonator? v)
          (1/bytes-converter?1814 (impersonator-val v))
          #f))))))
(define bytes-converter-c1816
  (|#%name| bytes-converter-c (record-accessor struct:bytes-converter 0)))
(define bytes-converter-c
  (|#%name|
   bytes-converter-c
   (lambda (s)
     (if (1/bytes-converter?1814 s)
       (bytes-converter-c1816 s)
       ($value
        (impersonate-ref
         bytes-converter-c1816
         struct:bytes-converter
         0
         s
         'bytes-converter
         'c))))))
(define bytes-converter-custodian-reference1817
  (|#%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?1814 s)
       (bytes-converter-custodian-reference1817 s)
       ($value
        (impersonate-ref
         bytes-converter-custodian-reference1817
         struct:bytes-converter
         1
         s
         'bytes-converter
         'custodian-reference))))))
(define set-bytes-converter-c!1818
  (|#%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?1814 s)
       (set-bytes-converter-c!1818 s v)
       ($value
        (impersonate-set!
         set-bytes-converter-c!1818
         struct:bytes-converter
         0
         0
         s
         v
         'bytes-converter
         'c))))))
(define set-bytes-converter-custodian-reference!1819
  (|#%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?1814 s)
       (set-bytes-converter-custodian-reference!1819 s v)
       ($value
        (impersonate-set!
         set-bytes-converter-custodian-reference!1819
         struct:bytes-converter
         1
         1
         s
         v
         'bytes-converter
         'custodian-reference))))))
(define effect1820
  (begin
    (register-struct-constructor! bytes-converter1.1)
    (register-struct-predicate! 1/bytes-converter?)
    (register-struct-field-accessor!
     bytes-converter-c
     struct:bytes-converter
     0)
    (register-struct-field-accessor!
     bytes-converter-custodian-reference
     struct:bytes-converter
     1)
    (register-struct-field-mutator!
     set-bytes-converter-c!
     struct:bytes-converter
     0)
    (register-struct-field-mutator!
     set-bytes-converter-custodian-reference!
     struct:bytes-converter
     1)
    (void)))
(define windows? (eq? 'windows (system-type)))
(define platform-utf-8 (if windows? 'utf-8-ish 'utf-8))
(define platform-utf-8-permissive
  (if windows? 'utf-8-ish-permissive 'utf-8-permissive))
(define platform-utf-16 (if windows? 'utf-16-ish '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 "UTF-8-ish")
                      (string=? to-str_0 "UTF-16-ish")
                      #f)
                  (bytes-converter1.1
                   (utf-8-converter1.1 'utf-8-ish 'utf-16-ish)
                   #f)
                  (if (if (string=? from-str_0 "UTF-8-ish-permissive")
                        (string=? to-str_0 "UTF-16-ish")
                        #f)
                    (bytes-converter1.1
                     (utf-8-converter1.1 'utf-8-ish-permissive 'utf-16-ish)
                     #f)
                    (if (if (string=? from-str_0 "UTF-16-ish")
                          (string=? to-str_0 "UTF-8-ish")
                          #f)
                      (bytes-converter1.1
                       (utf-8-converter1.1 'utf-16-ish 'utf-8-ish)
                       #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)
     (begin
       (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
       (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)
            (begin
              (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)
       (begin
         (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)
            (begin
              (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))
                           (case-lambda
                            ((bstr_0 used_0 status_0) (values bstr_0 status_0))
                            (args
                             (raise-binding-result-arity-error
                              3
                              args)))))))))))))))
    (|#%name|
     bytes-convert-end
     (case-lambda
      ((converter_0)
       (begin (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
  (letrec ((loop_0
            (|#%name|
             loop
             (lambda (c_0
                      dest-bstr_0
                      dest-end-pos_0
                      src-bstr_0
                      src-end-pos_0
                      use-dest-bstr_0
                      src-start-pos_0
                      use-dest-start-pos_0
                      use-dest-end-pos_0
                      in-already-consumed_0
                      out-already-produced_0)
               (begin
                 (call-with-values
                  (lambda ()
                    (convert-in
                     c_0
                     src-bstr_0
                     src-start-pos_0
                     src-end-pos_0
                     use-dest-bstr_0
                     use-dest-start-pos_0
                     use-dest-end-pos_0))
                  (case-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_0)))))
                          (begin
                            (unsafe-bytes-copy!
                             new-dest-bstr_0
                             0
                             use-dest-bstr_0
                             0
                             all-out-produced_0)
                            (let ((app_0 (+ src-start-pos_0 in-consumed_0)))
                              (loop_0
                               c_0
                               dest-bstr_0
                               dest-end-pos_0
                               src-bstr_0
                               src-end-pos_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_0
                                    0
                                    all-out-produced_0))))
                            (let ((app_1
                                   (+ in-already-consumed_0 in-consumed_0)))
                              (values
                               app_0
                               app_1
                               (if (eqv? err_0 29)
                                 'error
                                 (if (eqv? err_0 30)
                                   'aborts
                                   (if (eqv? err_0 28)
                                     'continues
                                     'complete))))))))))
                   (args (raise-binding-result-arity-error 3 args)))))))))
    (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)))))
              (let ((app_0 (if dest-bstr_0 dest-start-pos_0 0)))
                (loop_0
                 c_0
                 dest-bstr_0
                 dest-end-pos_0
                 src-bstr_0
                 src-end-pos_0
                 use-dest-bstr_0
                 src-start-pos_0
                 app_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
  (letrec ((procz4 (lambda (x_0) (unsafe-string-length x_0)))
           (procz3 (lambda (x_0) (string? x_0)))
           (procz2 (lambda (x_0) (unsafe-string-length x_0)))
           (procz1 (lambda (x_0) (string? x_0))))
    (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 ()
                   (normalise-inputs
                    'in-string
                    "string"
                    procz1
                    procz2
                    str_0
                    start_0
                    end_0
                    1))
                 (case-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))
                           (begin
                             #t
                             (void)
                             (letrec*
                              ((for-loop_0
                                (|#%name|
                                 for-loop
                                 (lambda (idx_0 pos_0)
                                   (begin
                                     (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
                                                      (check-not-unsafe-undefined
                                                       bstr_0
                                                       'bstr_119)))
                                                 (unsafe-bytes-set!
                                                  app_0
                                                  pos_0
                                                  (arithmetic-shift n_0 -24)))
                                               (let ((app_0
                                                      (check-not-unsafe-undefined
                                                       bstr_0
                                                       'bstr_119)))
                                                 (let ((app_1 (+ pos_0 1)))
                                                   (unsafe-bytes-set!
                                                    app_0
                                                    app_1
                                                    (bitwise-and
                                                     255
                                                     (arithmetic-shift
                                                      n_0
                                                      -16)))))
                                               (let ((app_0
                                                      (check-not-unsafe-undefined
                                                       bstr_0
                                                       'bstr_119)))
                                                 (let ((app_1 (+ pos_0 2)))
                                                   (unsafe-bytes-set!
                                                    app_0
                                                    app_1
                                                    (bitwise-and
                                                     255
                                                     (arithmetic-shift
                                                      n_0
                                                      -8)))))
                                               (let ((app_0
                                                      (check-not-unsafe-undefined
                                                       bstr_0
                                                       'bstr_119)))
                                                 (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))))))))
                  (args (raise-binding-result-arity-error 4 args))))
                (void))
              (begin
                (call-with-values
                 (lambda ()
                   (normalise-inputs
                    'in-string
                    "string"
                    procz3
                    procz4
                    str_0
                    start_0
                    end_0
                    1))
                 (case-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))
                           (begin
                             #t
                             (void)
                             (letrec*
                              ((for-loop_0
                                (|#%name|
                                 for-loop
                                 (lambda (idx_0 pos_0)
                                   (begin
                                     (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
                                                      (check-not-unsafe-undefined
                                                       bstr_0
                                                       'bstr_119)))
                                                 (let ((app_1 (+ pos_0 3)))
                                                   (unsafe-bytes-set!
                                                    app_0
                                                    app_1
                                                    (arithmetic-shift
                                                     n_0
                                                     -24))))
                                               (let ((app_0
                                                      (check-not-unsafe-undefined
                                                       bstr_0
                                                       'bstr_119)))
                                                 (let ((app_1 (+ pos_0 2)))
                                                   (unsafe-bytes-set!
                                                    app_0
                                                    app_1
                                                    (bitwise-and
                                                     255
                                                     (arithmetic-shift
                                                      n_0
                                                      -16)))))
                                               (let ((app_0
                                                      (check-not-unsafe-undefined
                                                       bstr_0
                                                       'bstr_119)))
                                                 (let ((app_1 (+ pos_0 1)))
                                                   (unsafe-bytes-set!
                                                    app_0
                                                    app_1
                                                    (bitwise-and
                                                     255
                                                     (arithmetic-shift
                                                      n_0
                                                      -8)))))
                                               (let ((app_0
                                                      (check-not-unsafe-undefined
                                                       bstr_0
                                                       'bstr_119)))
                                                 (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))))))))
                  (args (raise-binding-result-arity-error 4 args))))
                (void)))
            (check-not-unsafe-undefined bstr_0 'bstr_119)))))))
(define struct:cache (make-record-type-descriptor* 'cache #f #f #f #f 4 15))
(define effect1870
  (struct-type-install-properties!
   struct:cache
   'cache
   4
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   '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-to2 (|#%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 effect1871
  (begin
    (register-struct-constructor! cache1.1)
    (register-struct-predicate! cache?)
    (register-struct-field-accessor! cache-enc struct:cache 0)
    (register-struct-field-accessor! cache-to struct:cache 1)
    (register-struct-field-accessor! cache-to2 struct:cache 2)
    (register-struct-field-accessor! cache-from struct:cache 3)
    (register-struct-field-mutator! set-cache-enc! struct:cache 0)
    (register-struct-field-mutator! set-cache-to! struct:cache 1)
    (register-struct-field-mutator! set-cache-to2! struct:cache 2)
    (register-struct-field-mutator! set-cache-from! struct:cache 3)
    (void)))
(define new-cache (lambda () (cache1.1 #f #f #f #f)))
(define cell.1$5 (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$5 (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$5))))
      (begin
        (|#%app| update!_0 (unsafe-place-local-ref cell.1$5) #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$5)))
          (let ((c_0 (|#%app| get_0 (unsafe-place-local-ref cell.1$5))))
            (begin
              (if c_0
                (|#%app| update!_0 (unsafe-place-local-ref cell.1$5) #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$5)))
              (void)
              (begin
                (cache-clear! cache-to set-cache-to!)
                (cache-clear! cache-to2 set-cache-to2!)
                (cache-clear! cache-from set-cache-from!)
                (set-cache-enc! (unsafe-place-local-ref cell.1$5) enc_0)))
            (if (|#%app| get_0 (unsafe-place-local-ref cell.1$5))
              (1/bytes-close-converter c_0)
              (begin
                (bytes-reset-converter c_0)
                (|#%app| update!_0 (unsafe-place-local-ref cell.1$5) 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-to2 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-to2
  (lambda (c_0 enc_0) (cache-save! c_0 enc_0 cache-to2 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
         (letrec ((loop_0
                   (|#%name|
                    loop
                    (lambda (c_0 err-byte1_0 in-bstr_0 str4_0 pos_0)
                      (begin
                        (call-with-values
                         (lambda ()
                           (1/bytes-convert
                            (unsafe-unbox* c_0)
                            in-bstr_0
                            pos_0))
                         (case-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
                                           c_0
                                           err-byte1_0
                                           in-bstr_0
                                           str4_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)))))))))
                          (args
                           (raise-binding-result-arity-error 3 args)))))))))
           (|#%name|
            string->bytes/locale
            (lambda (str4_0 err-byte1_0 start2_0 end3_0)
              (begin
                (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 (box #f)))
                        (let ((enc_0 (1/locale-string-encoding)))
                          (dynamic-wind
                           (lambda ()
                             (unsafe-set-box*!
                              c_0
                              (bytes-open-converter/cached-to enc_0)))
                           (lambda ()
                             (let ((in-bstr_0
                                    (string->bytes/ucs-4
                                     str4_0
                                     start2_0
                                     end_0)))
                               (loop_0 c_0 err-byte1_0 in-bstr_0 str4_0 0)))
                           (lambda ()
                             (let ((c_1 (unsafe-unbox* c_0)))
                               (cache-save!
                                c_1
                                enc_0
                                cache-to
                                set-cache-to!)))))))))))))))
    (|#%name|
     string->bytes/locale
     (case-lambda
      ((str_0) (begin (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
         (letrec ((loop_0
                   (|#%name|
                    loop
                    (lambda (c_0 err-char5_0 in-bstr8_0 pos_0)
                      (begin
                        (call-with-values
                         (lambda ()
                           (1/bytes-convert
                            (unsafe-unbox* c_0)
                            in-bstr8_0
                            pos_0))
                         (case-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
                                           c_0
                                           err-char5_0
                                           in-bstr8_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)))))))))
                          (args
                           (raise-binding-result-arity-error 3 args)))))))))
           (|#%name|
            bytes->string/locale
            (lambda (in-bstr8_0 err-char5_0 start6_0 end7_0)
              (begin
                (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 (box #f)))
                        (let ((enc_0 (1/locale-string-encoding)))
                          (dynamic-wind
                           (lambda ()
                             (unsafe-set-box*!
                              c_0
                              (bytes-open-converter/cached-from enc_0)))
                           (lambda () (loop_0 c_0 err-char5_0 in-bstr8_0 0))
                           (lambda ()
                             (let ((c_1 (unsafe-unbox* c_0)))
                               (cache-save!
                                c_1
                                enc_0
                                cache-from
                                set-cache-from!)))))))))))))))
    (|#%name|
     bytes->string/locale
     (case-lambda
      ((in-bstr_0)
       (begin (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 struct:path (make-record-type-descriptor* 'path #f #f #f #f 2 3))
(define effect1891
  (struct-type-install-properties!
   struct:path
   '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)
        (let ((app_0 (|#%app| path-bytes p1_0)))
          (|#%app| eql?_0 app_0 (|#%app| path-bytes p2_0))))
      (lambda (p_0 hc_0) (|#%app| hc_0 (|#%app| path-bytes p_0)))
      (lambda (p_0 hc_0) (|#%app| hc_0 (|#%app| path-bytes p_0)))))
    (cons
     1/prop:custom-write
     (lambda (p_0 port_0 mode_0)
       (begin
         (if mode_0
           (if (eq?
                (|#%app| 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 (|#%app| path-convention p_0))
                port_0)
               (1/write-string "-path:" port_0)))
           (void))
         (1/write-string
          (1/bytes->string/locale (|#%app| path-bytes p_0) '#\x3f)
          port_0)
         (if mode_0 (1/write-string ">" port_0) (void))))))
   (current-inspector)
   #f
   '(0 1)
   #f
   'path))
(define path1.1
  (|#%name|
   path
   (record-constructor
    (make-record-constructor-descriptor struct:path #f #f))))
(define 1/path?1890 (|#%name| path? (record-predicate struct:path)))
(define 1/path?
  (|#%name|
   path?
   (lambda (v)
     (if (1/path?1890 v)
       #t
       ($value
        (if (impersonator? v) (1/path?1890 (impersonator-val v)) #f))))))
(define path-bytes1908 (|#%name| path-bytes (record-accessor struct:path 0)))
(define path-bytes
  (|#%name|
   path-bytes
   (lambda (s)
     (if (1/path?1890 s)
       (path-bytes1908 s)
       ($value
        (impersonate-ref path-bytes1908 struct:path 0 s 'path 'bytes))))))
(define path-convention1909
  (|#%name| path-convention (record-accessor struct:path 1)))
(define path-convention
  (|#%name|
   path-convention
   (lambda (s)
     (if (1/path?1890 s)
       (path-convention1909 s)
       ($value
        (impersonate-ref
         path-convention1909
         struct:path
         1
         s
         'path
         'convention))))))
(define effect1910
  (begin
    (register-struct-constructor! path1.1)
    (register-struct-predicate! 1/path?)
    (register-struct-field-accessor! path-bytes struct:path 0)
    (register-struct-field-accessor! path-convention struct:path 1)
    (void)))
(define is-path?
  (|#%name|
   path?
   (lambda (p_0)
     (begin
       (if (1/path? p_0)
         (eq? (|#%app| path-convention p_0) (system-path-convention-type))
         #f)))))
(define 1/path-for-some-system?
  (|#%name| path-for-some-system? (lambda (p_0) (begin (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 ()
         (begin (check-string s_0) (values s_0 (unsafe-string-length s_0))))
       (case-lambda
        ((vec_0 len_0)
         (begin
           #f
           (letrec*
            ((for-loop_0
              (|#%name|
               for-loop
               (lambda (result_0 pos_0)
                 (begin
                   (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))))
        (args (raise-binding-result-arity-error 2 args))))
      #f)))
(define string->path$1
  (|#%name|
   string->path
   (lambda (s_0)
     (begin
       (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 ()
         (begin (check-string s_0) (values s_0 (unsafe-string-length s_0))))
       (case-lambda
        ((vec_0 len_0)
         (begin
           #f
           (letrec*
            ((for-loop_0
              (|#%name|
               for-loop
               (lambda (pos_0)
                 (begin
                   (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))))
        (args (raise-binding-result-arity-error 2 args))))
      (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 ()
         (begin (check-bytes s_0) (values s_0 (unsafe-bytes-length s_0))))
       (case-lambda
        ((vec_0 len_0)
         (begin
           #f
           (letrec*
            ((for-loop_0
              (|#%name|
               for-loop
               (lambda (pos_0)
                 (begin
                   (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))))
        (args (raise-binding-result-arity-error 2 args))))
      (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
  (letrec ((procz2 (lambda (x_0) (unsafe-bytes-length x_0)))
           (procz1 (lambda (x_0) (bytes? x_0))))
    (|#%name|
     special-filename?
     (lambda (immediate?1_0 in-bstr3_0)
       (begin
         (let ((bstr_0 (box unsafe-undefined)))
           (unsafe-set-box*!
            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)
                        (begin
                          (if (zero? i+1_0)
                            (if (letter-drive-start?
                                 (check-not-unsafe-undefined
                                  (unsafe-unbox* bstr_0)
                                  'bstr_119)
                                 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 (unsafe-unbox* bstr_0))))
             (if (zero? len_0)
               #f
               (if (backslash-backslash-questionmark? (unsafe-unbox* bstr_0))
                 #f
                 (begin
                   (letrec*
                    ((for-loop_0
                      (|#%name|
                       for-loop
                       (lambda (result_0 lst_0)
                         (begin
                           (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 ()
                                                          (begin
                                                            (check-string fn_0)
                                                            (values
                                                             fn_0
                                                             (unsafe-string-length
                                                              fn_0))))
                                                        (case-lambda
                                                         ((vec_0 len_1)
                                                          (call-with-values
                                                           (lambda ()
                                                             (let ((vec_1
                                                                    (unsafe-unbox*
                                                                     bstr_0)))
                                                               (begin
                                                                 (check-bytes
                                                                  vec_1)
                                                                 (values
                                                                  vec_1
                                                                  (unsafe-bytes-length
                                                                   vec_1)))))
                                                           (case-lambda
                                                            ((vec_1 len_2)
                                                             (let ((vec_2
                                                                    vec_0)
                                                                   (len_3
                                                                    len_1))
                                                               (begin
                                                                 #f
                                                                 #f
                                                                 (letrec*
                                                                  ((for-loop_1
                                                                    (|#%name|
                                                                     for-loop
                                                                     (lambda (result_1
                                                                              pos_0
                                                                              pos_1)
                                                                       (begin
                                                                         (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)))))
                                                            (args
                                                             (raise-binding-result-arity-error
                                                              2
                                                              args)))))
                                                         (args
                                                          (raise-binding-result-arity-error
                                                           2
                                                           args))))
                                                     (let ((or-part_0
                                                            (=
                                                             len_0
                                                             fn-len_0)))
                                                       (if or-part_0
                                                         or-part_0
                                                         (let ((or-part_1
                                                                (eqv?
                                                                 (unsafe-bytes-ref
                                                                  (unsafe-unbox*
                                                                   bstr_0)
                                                                  fn-len_0)
                                                                 46)))
                                                           (if or-part_1
                                                             or-part_1
                                                             (let ((or-part_2
                                                                    (eqv?
                                                                     (unsafe-bytes-ref
                                                                      (unsafe-unbox*
                                                                       bstr_0)
                                                                      fn-len_0)
                                                                     58)))
                                                               (if or-part_2
                                                                 or-part_2
                                                                 (call-with-values
                                                                  (lambda ()
                                                                    (normalise-inputs
                                                                     'in-bytes
                                                                     "bytes"
                                                                     procz1
                                                                     procz2
                                                                     (unsafe-unbox*
                                                                      bstr_0)
                                                                     fn-len_0
                                                                     #f
                                                                     1))
                                                                  (case-lambda
                                                                   ((v*_0
                                                                     start*_0
                                                                     stop*_0
                                                                     step*_0)
                                                                    (begin
                                                                      #t
                                                                      (letrec*
                                                                       ((for-loop_1
                                                                         (|#%name|
                                                                          for-loop
                                                                          (lambda (result_1
                                                                                   idx_0)
                                                                            (begin
                                                                              (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))))
                                                                   (args
                                                                    (raise-binding-result-arity-error
                                                                     4
                                                                     args))))))))))
                                                     #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))
     (case-lambda
      ((kind_0
        drive-end-pos_0
        orig-drive-end-pos_0
        clean-start-pos_0
        add-sep-pos_0)
       kind_0)
      (args (raise-binding-result-arity-error 5 args))))))
(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)
                               (begin
                                 (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
  (letrec ((procz2 (lambda (x_0) (unsafe-bytes-length x_0)))
           (procz1 (lambda (x_0) (bytes? x_0)))
           (is-a-sep?_0
            (|#%name|
             is-a-sep?
             (lambda (no-forward-slash?6_0 c_0)
               (begin
                 (if no-forward-slash?6_0
                   (eqv? c_0 92)
                   (is-sep? c_0 'windows)))))))
    (|#%name|
     parse-unc
     (lambda (exact?5_0 no-forward-slash?6_0 bstr9_0 delta10_0)
       (begin
         (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 ((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
                         no-forward-slash?6_0
                         (unsafe-bytes-ref bstr9_0 j_0))
                        #f))
                   (letrec*
                    ((loop_0
                      (|#%name|
                       loop
                       (lambda (j_1)
                         (begin
                           (if (= j_1 len_0)
                             #f
                             (if (not
                                  (is-a-sep?_0
                                   no-forward-slash?6_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
                                                 no-forward-slash?6_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
                                              no-forward-slash?6_0
                                              (unsafe-bytes-ref bstr9_0 j_3))
                                             #f)
                                           #f)
                                       #f
                                       (letrec*
                                        ((loop_1
                                          (|#%name|
                                           loop
                                           (lambda (j_4)
                                             (begin
                                               (if (= j_4 len_0)
                                                 #f
                                                 (if (is-a-sep?_0
                                                      no-forward-slash?6_0
                                                      (unsafe-bytes-ref
                                                       bstr9_0
                                                       j_4))
                                                   (loop_1 (add1 j_4))
                                                   (letrec*
                                                    ((loop_2
                                                      (|#%name|
                                                       loop
                                                       (lambda (j_5)
                                                         (begin
                                                           (if (= j_5 len_0)
                                                             len_0
                                                             (if (is-a-sep?_0
                                                                  no-forward-slash?6_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 ()
                                                                          (normalise-inputs
                                                                           'in-bytes
                                                                           "bytes"
                                                                           procz1
                                                                           procz2
                                                                           bstr9_0
                                                                           (add1
                                                                            j_5)
                                                                           #f
                                                                           1))
                                                                        (case-lambda
                                                                         ((v*_0
                                                                           start*_0
                                                                           stop*_0
                                                                           step*_0)
                                                                          (begin
                                                                            #t
                                                                            (letrec*
                                                                             ((for-loop_0
                                                                               (|#%name|
                                                                                for-loop
                                                                                (lambda (result_0
                                                                                         idx_0)
                                                                                  (begin
                                                                                    (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
                                                                                                        no-forward-slash?6_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))))
                                                                         (args
                                                                          (raise-binding-result-arity-error
                                                                           4
                                                                           args))))))
                                                                 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)
                   (begin
                     (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))
       (case-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))
        (args (raise-binding-result-arity-error 5 args))))
      (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)
                     (begin
                       (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)
                (begin
                  (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))
     (case-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))
      (args (raise-binding-result-arity-error 5 args))))))
(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
       (begin
         (check-path-test-argument 'relative-path? p_0)
         (if (1/path? p_0)
           (let ((tmp_0 (|#%app| path-convention p_0)))
             (if (eq? tmp_0 'unix)
               (let ((bstr_0 (|#%app| path-bytes p_0)))
                 (not (is-sep? (unsafe-bytes-ref bstr_0 0) 'unix)))
               (if (eq? tmp_0 'windows)
                 (let ((p_1 (|#%app| 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
       (begin
         (check-path-test-argument 'absolute-path? p_0)
         (if (1/path? p_0)
           (let ((tmp_0 (|#%app| path-convention p_0)))
             (if (eq? tmp_0 'unix)
               (let ((bstr_0 (|#%app| path-bytes p_0)))
                 (is-sep? (unsafe-bytes-ref bstr_0 0) 'unix))
               (if (eq? tmp_0 'windows)
                 (let ((p_1 (|#%app| 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
       (begin
         (check-path-test-argument 'complete-path? p_0)
         (if (1/path? p_0)
           (let ((tmp_0 (|#%app| path-convention p_0)))
             (if (eq? tmp_0 'unix)
               (let ((bstr_0 (|#%app| path-bytes p_0)))
                 (is-sep? (unsafe-bytes-ref bstr_0 0) 'unix))
               (if (eq? tmp_0 'windows)
                 (let ((p_1 (|#%app| 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
   #t
   (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
   32
   (lambda (v_0)
     (begin
       (if (let ((or-part_0 (eqv? v_0 +inf.0)))
             (if or-part_0 or-part_0 (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
              (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) (begin (open-input-bytes_0 bstr_0 'string)))
      ((bstr_0 name1_0) (open-input-bytes_0 bstr_0 name1_0))))))
(define struct:bytes-input-port
  (make-record-type-descriptor*
   'bytes-input-port
   struct:commit-input-port
   #f
   #f
   #f
   3
   7))
(define effect2069
  (struct-type-install-properties!
   struct:bytes-input-port
   'bytes-input-port
   3
   0
   struct:commit-input-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-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 effect2070
  (begin
    (register-struct-constructor! create-bytes-input-port)
    (register-struct-predicate! bytes-input-port?)
    (register-struct-field-accessor!
     bytes-input-port-bstr
     struct:bytes-input-port
     0)
    (register-struct-field-accessor!
     bytes-input-port-pos
     struct:bytes-input-port
     1)
    (register-struct-field-accessor!
     bytes-input-port-alt-pos
     struct:bytes-input-port
     2)
    (register-struct-field-mutator!
     set-bytes-input-port-bstr!
     struct:bytes-input-port
     0)
    (register-struct-field-mutator!
     set-bytes-input-port-pos!
     struct:bytes-input-port
     1)
    (register-struct-field-mutator!
     set-bytes-input-port-alt-pos!
     struct:bytes-input-port
     2)
    (void)))
(define struct:bytes-input-port-methods.1
  (make-record-type-descriptor*
   'bytes-input-port-methods
   struct:commit-input-port-methods.1
   #f
   #f
   #f
   0
   0))
(define effect2072
  (struct-type-install-properties!
   struct:bytes-input-port-methods.1
   'bytes-input-port-methods
   0
   0
   struct:commit-input-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'bytes-input-port-methods))
(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?.12071
  (|#%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?.12071 v)
       #t
       ($value
        (if (impersonator? v)
          (bytes-input-port-methods?.12071 (impersonator-val v))
          #f))))))
(define effect2073
  (begin
    (register-struct-constructor! bytes-input-port-methods4.1)
    (register-struct-predicate! bytes-input-port-methods?.1)
    (void)))
(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
            (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)
                      (begin
                        (set-core-port-offset! this-id_0 (direct-pos b_0))
                        (set-direct-bstr! b_0 #f))
                      (void)))))))))
       app_0
       app_1
       (|#%name|
        file-position
        (case-lambda
         ((this-id_0)
          (begin
            (let ((or-part_0 (bytes-input-port-alt-pos this-id_0)))
              (if or-part_0 or-part_0 (|#%app| 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) (begin (temp2.1 this-id_0))))
       (|#%name|
        read-in
        (lambda (this-id_0 dest-bstr95_0 start96_0 end97_0 copy?98_0)
          (begin
            (let ((b_0 (core-port-buffer this-id_0)))
              (let ((len_0 (direct-end b_0)))
                (let ((i_0 (|#%app| 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)
          (begin
            (let ((b_0 (core-port-buffer this-id_0)))
              (let ((len_0 (direct-end b_0)))
                (let ((i_0 (|#%app| 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) (begin #t)))
       (|#%name|
        get-progress-evt
        (lambda (this-id_0)
          (begin
            (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)
          (begin
            (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 (|#%app| 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)
     (begin
       (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 struct:bytes-output-port
  (make-record-type-descriptor*
   'bytes-output-port
   struct:core-output-port
   #f
   #f
   #f
   3
   7))
(define effect2097
  (struct-type-install-properties!
   struct:bytes-output-port
   'bytes-output-port
   3
   0
   struct:core-output-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-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 effect2098
  (begin
    (register-struct-constructor! create-bytes-output-port)
    (register-struct-predicate! bytes-output-port?)
    (register-struct-field-accessor!
     bytes-output-port-bstr
     struct:bytes-output-port
     0)
    (register-struct-field-accessor!
     bytes-output-port-pos
     struct:bytes-output-port
     1)
    (register-struct-field-accessor!
     bytes-output-port-max-pos
     struct:bytes-output-port
     2)
    (register-struct-field-mutator!
     set-bytes-output-port-bstr!
     struct:bytes-output-port
     0)
    (register-struct-field-mutator!
     set-bytes-output-port-pos!
     struct:bytes-output-port
     1)
    (register-struct-field-mutator!
     set-bytes-output-port-max-pos!
     struct:bytes-output-port
     2)
    (void)))
(define struct:bytes-output-port-methods.1
  (make-record-type-descriptor*
   'bytes-output-port-methods
   struct:core-output-port-methods.1
   #f
   #f
   #f
   2
   3))
(define effect2100
  (struct-type-install-properties!
   struct:bytes-output-port-methods.1
   'bytes-output-port-methods
   2
   0
   struct:core-output-port-methods.1
   null
   (current-inspector)
   #f
   '(0 1)
   #f
   'bytes-output-port-methods))
(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?.12099
  (|#%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?.12099 v)
       #t
       ($value
        (if (impersonator? v)
          (bytes-output-port-methods?.12099 (impersonator-val v))
          #f))))))
(define bytes-output-port-methods-get-length.12101
  (|#%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?.12099 s)
       (bytes-output-port-methods-get-length.12101 s)
       ($value
        (impersonate-ref
         bytes-output-port-methods-get-length.12101
         struct:bytes-output-port-methods.1
         0
         s
         'bytes-output-port-methods
         'get-length))))))
(define bytes-output-port-methods-get-bytes.12102
  (|#%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?.12099 s)
       (bytes-output-port-methods-get-bytes.12102 s)
       ($value
        (impersonate-ref
         bytes-output-port-methods-get-bytes.12102
         struct:bytes-output-port-methods.1
         1
         s
         'bytes-output-port-methods
         'get-bytes))))))
(define effect2103
  (begin
    (register-struct-constructor! bytes-output-port-methods8.1)
    (register-struct-predicate! bytes-output-port-methods?.1)
    (register-struct-field-accessor!
     bytes-output-port-methods-get-length.1
     struct:bytes-output-port-methods.1
     0)
    (register-struct-field-accessor!
     bytes-output-port-methods-get-bytes.1
     struct:bytes-output-port-methods.1
     1)
    (void)))
(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)
                  (begin
                    (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
                    (|#%app| 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))
                            (|#%app| 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
                    (begin
                      (|#%app| 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)
                                (|#%app| 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))))
                              (|#%app| 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
                    (begin
                      (unsafe-start-atomic)
                      (|#%app| 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
                    (begin
                      (unsafe-start-atomic)
                      (|#%app| 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)
     (begin
       (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)
     (begin
       (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)
     (begin
       (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)
            (begin
              (finish-port/count
               (create-bytes-output-port
                bytes-output-port-vtable.1
                name9_0
                (direct2.1 #f 0 0)
                #f
                #f
                0
                #f
                always-evt
                #f
                #f
                #f
                (make-bytes 16)
                0
                0)))))))
    (|#%name|
     open-output-bytes
     (case-lambda
      (() (begin (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
              (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) (begin (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)
     (begin
       (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
              (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) (begin (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) (begin (1/open-output-bytes name3_0))))))
    (|#%name|
     open-output-string
     (case-lambda
      (() (begin (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
       (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 struct:max-output-port
  (make-record-type-descriptor*
   'max-output-port
   struct:core-output-port
   #f
   #f
   #f
   2
   3))
(define effect2155
  (struct-type-install-properties!
   struct:max-output-port
   'max-output-port
   2
   0
   struct:core-output-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-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 effect2156
  (begin
    (register-struct-constructor! create-max-output-port)
    (register-struct-predicate! max-output-port?)
    (register-struct-field-accessor!
     max-output-port-o
     struct:max-output-port
     0)
    (register-struct-field-accessor!
     max-output-port-max-length
     struct:max-output-port
     1)
    (register-struct-field-mutator!
     set-max-output-port-o!
     struct:max-output-port
     0)
    (register-struct-field-mutator!
     set-max-output-port-max-length!
     struct:max-output-port
     1)
    (void)))
(define struct:max-output-port-methods.1
  (make-record-type-descriptor*
   'max-output-port-methods
   struct:core-output-port-methods.1
   #f
   #f
   #f
   0
   0))
(define effect2158
  (struct-type-install-properties!
   struct:max-output-port-methods.1
   'max-output-port-methods
   0
   0
   struct:core-output-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'max-output-port-methods))
(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?.12157
  (|#%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?.12157 v)
       #t
       ($value
        (if (impersonator? v)
          (max-output-port-methods?.12157 (impersonator-val v))
          #f))))))
(define effect2159
  (begin
    (register-struct-constructor! max-output-port-methods1.1)
    (register-struct-predicate! max-output-port-methods?.1)
    (void)))
(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)
                    (begin
                      (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)
    (create-max-output-port
     max-output-port-vtable.1
     (object-name o_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)
            (begin
              (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)
            (begin
              (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
  (letrec ((pad_0
            (|#%name|
             pad
             (lambda (n_0 s_0)
               (begin
                 (let ((len_0 (string-length s_0)))
                   (if (< len_0 n_0)
                     (string-append (make-string (- n_0 len_0) '#\x30) s_0)
                     s_0)))))))
    (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)
                (begin
                  (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 (let ((or-part_0 (char-graphic? c_0)))
                                    (if or-part_0 or-part_0 (char-blank? c_0)))
                                (loop_0 start-i_0 (add1 i_0) max-length_2)
                                (let ((n_0 (char->integer c_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)
              (begin
                (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)
     (begin
       (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
  (letrec ((is-simple?_0
            (|#%name|
             is-simple?
             (lambda (case-sensitive?_0 config8_0 for-type?9_0 str_0 ch_0 i_0)
               (begin
                 (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
                                                                 (if (char=?
                                                                      ch_0
                                                                      '#\x7c)
                                                                   (let ((or-part_10
                                                                          (not
                                                                           config8_0)))
                                                                     (if or-part_10
                                                                       or-part_10
                                                                       (config-get
                                                                        config8_0
                                                                        1/read-accept-bar-quote)))
                                                                   #f)))
                                                            (if or-part_10
                                                              or-part_10
                                                              (let ((or-part_11
                                                                     (if for-type?9_0
                                                                       (let ((or-part_11
                                                                              (char=?
                                                                               ch_0
                                                                               '#\x3c)))
                                                                         (if or-part_11
                                                                           or-part_11
                                                                           (char=?
                                                                            ch_0
                                                                            '#\x3e)))
                                                                       #f)))
                                                                (if or-part_11
                                                                  or-part_11
                                                                  (let ((or-part_12
                                                                         (if (char-whitespace?
                                                                              ch_0)
                                                                           (let ((or-part_12
                                                                                  (not
                                                                                   for-type?9_0)))
                                                                             (if or-part_12
                                                                               or-part_12
                                                                               (not
                                                                                (char=?
                                                                                 ch_0
                                                                                 '#\x20))))
                                                                           #f)))
                                                                    (if or-part_12
                                                                      or-part_12
                                                                      (let ((or-part_13
                                                                             (if (char=?
                                                                                  ch_0
                                                                                  '#\x23)
                                                                               (if (zero?
                                                                                    i_0)
                                                                                 (let ((or-part_13
                                                                                        (<
                                                                                         (string-length
                                                                                          str_0)
                                                                                         2)))
                                                                                   (if or-part_13
                                                                                     or-part_13
                                                                                     (not
                                                                                      (char=?
                                                                                       (string-ref
                                                                                        str_0
                                                                                        1)
                                                                                       '#\x25))))
                                                                                 #f)
                                                                               #f)))
                                                                        (if or-part_13
                                                                          or-part_13
                                                                          (let ((or-part_14
                                                                                 (if (char=?
                                                                                      ch_0
                                                                                      '#\x2e)
                                                                                   (if (zero?
                                                                                        i_0)
                                                                                     (=
                                                                                      (string-length
                                                                                       str_0)
                                                                                      1)
                                                                                     #f)
                                                                                   #f)))
                                                                            (if or-part_14
                                                                              or-part_14
                                                                              (if (not
                                                                                   case-sensitive?_0)
                                                                                (not
                                                                                 (char=?
                                                                                  ch_0
                                                                                  (char-foldcase
                                                                                   ch_0)))
                                                                                #f))))))))))))))))))))))))))))))))))))
           (loop_0
            (|#%name|
             loop
             (lambda (case-sensitive?_0
                      config8_0
                      for-type?9_0
                      len_0
                      str_0
                      start_0
                      i_0)
               (begin
                 (if (= i_0 len_0)
                   (list (substring str_0 start_0 len_0))
                   (if (is-simple?_0
                        case-sensitive?_0
                        config8_0
                        for-type?9_0
                        str_0
                        (string-ref str_0 i_0)
                        i_0)
                     (loop_0
                      case-sensitive?_0
                      config8_0
                      for-type?9_0
                      len_0
                      str_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
                             case-sensitive?_0
                             config8_0
                             for-type?9_0
                             len_0
                             str_0
                             app_2
                             (add1 i_0)))))))))))))
    (|#%name|
     symbol->print-string
     (lambda (case-sensitive?10_0
              config8_0
              for-keyword?11_0
              for-type?9_0
              sym16_0)
       (begin
         (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)))
             (if (call-with-values
                  (lambda ()
                    (begin
                      (check-string str_0)
                      (values str_0 (unsafe-string-length str_0))))
                  (case-lambda
                   ((vec_0 len_0)
                    (let ((start_0 0))
                      (let ((vec_1 vec_0) (len_1 len_0))
                        (begin
                          #f
                          (void)
                          (letrec*
                           ((for-loop_0
                             (|#%name|
                              for-loop
                              (lambda (result_0 pos_0 pos_1)
                                (begin
                                  (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
                                                     case-sensitive?_0
                                                     config8_0
                                                     for-type?9_0
                                                     str_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))))))
                   (args (raise-binding-result-arity-error 2 args))))
               (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 ()
                          (begin
                            (check-string str_0)
                            (values str_0 (unsafe-string-length str_0))))
                        (case-lambda
                         ((vec_0 len_0)
                          (begin
                            #f
                            (letrec*
                             ((for-loop_0
                               (|#%name|
                                for-loop
                                (lambda (result_0 pos_0)
                                  (begin
                                    (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))))
                         (args (raise-binding-result-arity-error 2 args))))))
                 (let ((len_0 (string-length str_0)))
                   (apply
                    string-append
                    (loop_0
                     case-sensitive?_0
                     config8_0
                     for-type?9_0
                     len_0
                     str_0
                     0
                     0)))
                 (string-append "|" str_0 "|"))))))))))
(define print-char
  (letrec ((pad_0
            (|#%name|
             pad
             (lambda (n_0 s_0)
               (begin
                 (let ((len_0 (string-length s_0)))
                   (if (< len_0 n_0)
                     (string-append (make-string (- n_0 len_0) '#\x30) s_0)
                     s_0)))))))
    (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)))
              (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 struct:nowhere-output-port
  (make-record-type-descriptor*
   'nowhere-output-port
   struct:core-output-port
   #f
   #f
   #f
   0
   0))
(define effect2253
  (struct-type-install-properties!
   struct:nowhere-output-port
   'nowhere-output-port
   0
   0
   struct:core-output-port
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   'create-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 effect2254
  (begin
    (register-struct-constructor! create-nowhere-output-port)
    (register-struct-predicate! nowhere-output-port?)
    (void)))
(define struct:nowhere-output-port-methods.1
  (make-record-type-descriptor*
   'nowhere-output-port-methods
   struct:core-output-port-methods.1
   #f
   #f
   #f
   0
   0))
(define effect2256
  (struct-type-install-properties!
   struct:nowhere-output-port-methods.1
   'nowhere-output-port-methods
   0
   0
   struct:core-output-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'nowhere-output-port-methods))
(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?.12255
  (|#%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?.12255 v)
       #t
       ($value
        (if (impersonator? v)
          (nowhere-output-port-methods?.12255 (impersonator-val v))
          #f))))))
(define effect2257
  (begin
    (register-struct-constructor! nowhere-output-port-methods1.1)
    (register-struct-predicate! nowhere-output-port-methods?.1)
    (void)))
(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)
                    (begin #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!
  (letrec ((...nt/recur-handler.rkt:9:39_0
            (|#%name|
             ...nt/recur-handler.rkt:9:39
             (lambda (handle_0 e2_0 p3_0 mode1_0)
               (begin (|#%app| handle_0 e2_0 p3_0 mode1_0))))))
    (lambda (port_0 handle_0)
      (begin
        (set-core-output-port-print-handler!
         port_0
         (|#%name|
          ...nt/recur-handler.rkt:9:39
          (case-lambda
           ((e_0 p_0)
            (begin (...nt/recur-handler.rkt:9:39_0 handle_0 e_0 p_0 0)))
           ((e_0 p_0 mode1_0)
            (...nt/recur-handler.rkt:9:39_0 handle_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?
  (letrec ((for-loop_0
            (|#%name|
             for-loop
             (lambda (config_0 len_0 mode_0 print-graph?_0 vec_0 fuel_0 pos_0)
               (begin
                 (if (unsafe-fx< pos_0 len_0)
                   (let ((e_0 (unsafe-vector-ref vec_0 pos_0)))
                     (if (not fuel_0)
                       fuel_0
                       (let ((fuel_1
                              (quick-no-graph?_0
                               config_0
                               mode_0
                               print-graph?_0
                               e_0
                               fuel_0)))
                         (next-k-proc_0
                          config_0
                          len_0
                          mode_0
                          pos_0
                          print-graph?_0
                          vec_0
                          fuel_1))))
                   fuel_0)))))
           (for-loop_1
            (|#%name|
             for-loop
             (lambda (config_0 mode_0 print-graph?_0 v_0 fuel_0 i_0)
               (begin
                 (if i_0
                   (let ((k_0 (hash-iterate-key v_0 i_0 #f)))
                     (if (not fuel_0)
                       fuel_0
                       (let ((fuel_1
                              (let ((val_0 (hash-ref v_0 k_0 #f)))
                                (quick-no-graph?_0
                                 config_0
                                 mode_0
                                 print-graph?_0
                                 val_0
                                 (quick-no-graph?_0
                                  config_0
                                  mode_0
                                  print-graph?_0
                                  k_0
                                  fuel_0)))))
                         (next-k-proc_1
                          config_0
                          i_0
                          mode_0
                          print-graph?_0
                          v_0
                          fuel_1))))
                   fuel_0)))))
           (next-k-proc_0
            (|#%name|
             next-k-proc
             (lambda (config_0 len_0 mode_0 pos_0 print-graph?_0 vec_0 fuel_0)
               (begin
                 (for-loop_0
                  config_0
                  len_0
                  mode_0
                  print-graph?_0
                  vec_0
                  fuel_0
                  (unsafe-fx+ 1 pos_0))))))
           (next-k-proc_1
            (|#%name|
             next-k-proc
             (lambda (config_0 i_0 mode_0 print-graph?_0 v_0 fuel_0)
               (begin
                 (for-loop_1
                  config_0
                  mode_0
                  print-graph?_0
                  v_0
                  fuel_0
                  (hash-iterate-next v_0 i_0))))))
           (quick-no-graph?_0
            (|#%name|
             quick-no-graph?
             (lambda (config_0 mode_0 print-graph?_0 v_0 fuel_0)
               (begin
                 (if (let ((or-part_0 (not fuel_0)))
                       (if or-part_0 or-part_0 (zero? fuel_0)))
                   #f
                   (if (pair? v_0)
                     (if (not print-graph?_0)
                       (let ((app_0 (cdr v_0)))
                         (quick-no-graph?_0
                          config_0
                          mode_0
                          print-graph?_0
                          app_0
                          (let ((app_1 (car v_0)))
                            (quick-no-graph?_0
                             config_0
                             mode_0
                             print-graph?_0
                             app_1
                             (sub1 fuel_0)))))
                       #f)
                     (if (vector? v_0)
                       (if (not print-graph?_0)
                         (call-with-values
                          (lambda ()
                            (begin
                              (check-vector v_0)
                              (values v_0 (unsafe-vector-length v_0))))
                          (case-lambda
                           ((vec_0 len_0)
                            (begin
                              #f
                              (for-loop_0
                               config_0
                               len_0
                               mode_0
                               print-graph?_0
                               vec_0
                               (sub1 fuel_0)
                               0)))
                           (args (raise-binding-result-arity-error 2 args))))
                         #f)
                       (if (if (box? v_0) (config-get config_0 1/print-box) #f)
                         (if (not print-graph?_0)
                           (let ((app_0 (unbox v_0)))
                             (quick-no-graph?_0
                              config_0
                              mode_0
                              print-graph?_0
                              app_0
                              (sub1 fuel_0)))
                           #f)
                         (if (if (hash? v_0)
                               (if (not (hash-weak? v_0))
                                 (config-get config_0 1/print-hash-table)
                                 #f)
                               #f)
                           (if (not print-graph?_0)
                             (begin
                               (let ((app_0 (sub1 fuel_0)))
                                 (for-loop_1
                                  config_0
                                  mode_0
                                  print-graph?_0
                                  v_0
                                  app_0
                                  (hash-iterate-first v_0))))
                             #f)
                           (if (mpair? v_0)
                             (if (not print-graph?_0)
                               (if (not (eq? mode_0 0))
                                 (let ((app_0 (mcdr v_0)))
                                   (quick-no-graph?_0
                                    config_0
                                    mode_0
                                    print-graph?_0
                                    app_0
                                    (let ((app_1 (mcar v_0)))
                                      (quick-no-graph?_0
                                       config_0
                                       mode_0
                                       print-graph?_0
                                       app_1
                                       (sub1 fuel_0)))))
                                 #f)
                               #f)
                             (if (if (1/custom-write? v_0)
                                   (not (struct-type? v_0))
                                   #f)
                               #f
                               (if (if (struct? v_0)
                                     (config-get config_0 1/print-struct)
                                     #f)
                                 (if (not print-graph?_0)
                                   (if (prefab-struct-key v_0)
                                     (let ((app_0 (struct->vector v_0)))
                                       (quick-no-graph?_0
                                        config_0
                                        mode_0
                                        print-graph?_0
                                        app_0
                                        (sub1 fuel_0)))
                                     #f)
                                   #f)
                                 fuel_0)))))))))))))
    (lambda (v_0 fuel_0 mode_0 print-graph?_0 config_0)
      (quick-no-graph?_0 config_0 mode_0 print-graph?_0 v_0 fuel_0))))
(define struct:as-constructor
  (make-record-type-descriptor* 'as-constructor #f #f #f #f 1 1))
(define effect2286
  (struct-type-install-properties!
   struct:as-constructor
   'as-constructor
   1
   0
   #f
   null
   (current-inspector)
   #f
   '(0)
   #f
   'as-constructor))
(define as-constructor1.1
  (|#%name|
   as-constructor
   (record-constructor
    (make-record-constructor-descriptor struct:as-constructor #f #f))))
(define as-constructor?2285
  (|#%name| as-constructor? (record-predicate struct:as-constructor)))
(define as-constructor?
  (|#%name|
   as-constructor?
   (lambda (v)
     (if (as-constructor?2285 v)
       #t
       ($value
        (if (impersonator? v)
          (as-constructor?2285 (impersonator-val v))
          #f))))))
(define as-constructor-tag2287
  (|#%name| as-constructor-tag (record-accessor struct:as-constructor 0)))
(define as-constructor-tag
  (|#%name|
   as-constructor-tag
   (lambda (s)
     (if (as-constructor?2285 s)
       (as-constructor-tag2287 s)
       ($value
        (impersonate-ref
         as-constructor-tag2287
         struct:as-constructor
         0
         s
         'as-constructor
         'tag))))))
(define effect2288
  (begin
    (register-struct-constructor! as-constructor1.1)
    (register-struct-predicate! as-constructor?)
    (register-struct-field-accessor!
     as-constructor-tag
     struct:as-constructor
     0)
    (void)))
(define build-graph
  (letrec ((build-graph_0
            (|#%name|
             build-graph
             (lambda (checking-port_0
                      config_0
                      constructor?_0
                      counter_0
                      cycle?_0
                      ht_0
                      v_0
                      mode_0)
               (begin
                 (if (not v_0)
                   #f
                   (let ((c1_0 (hash-ref ht_0 v_0 #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_0
                              (if (as-constructor? c1_0)
                                (as-constructor1.1 (unsafe-unbox* counter_0))
                                (unsafe-unbox* counter_0)))
                             (unsafe-set-box*!
                              counter_0
                              (add1 (unsafe-unbox* counter_0)))
                             (if (eq? c1_0 'checking)
                               (unsafe-set-box*! cycle?_0 #t)
                               (void)))
                           (void))
                         (as-constructor? c1_0))
                       (if (pair? v_0)
                         (begin
                           (checking!_0 ht_0 v_0)
                           (let ((car-unquoted?_0
                                  (build-graph_0
                                   checking-port_0
                                   config_0
                                   constructor?_0
                                   counter_0
                                   cycle?_0
                                   ht_0
                                   (car v_0)
                                   mode_0)))
                             (let ((unquoted?_0
                                    (let ((or-part_0
                                           (build-graph_0
                                            checking-port_0
                                            config_0
                                            constructor?_0
                                            counter_0
                                            cycle?_0
                                            ht_0
                                            (cdr v_0)
                                            mode_0)))
                                      (if or-part_0
                                        or-part_0
                                        car-unquoted?_0))))
                               (done!_0 constructor?_0 ht_0 v_0 unquoted?_0))))
                         (if (vector? v_0)
                           (begin
                             (checking!_0 ht_0 v_0)
                             (let ((unquoted?_0
                                    (call-with-values
                                     (lambda ()
                                       (begin
                                         (check-vector v_0)
                                         (values
                                          v_0
                                          (unsafe-vector-length v_0))))
                                     (case-lambda
                                      ((vec_0 len_0)
                                       (begin
                                         #f
                                         (letrec*
                                          ((for-loop_0
                                            (|#%name|
                                             for-loop
                                             (lambda (unquoted?_0 pos_0)
                                               (begin
                                                 (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
                                                                           checking-port_0
                                                                           config_0
                                                                           constructor?_0
                                                                           counter_0
                                                                           cycle?_0
                                                                           ht_0
                                                                           e_0
                                                                           mode_0)))
                                                                     (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))))
                                      (args
                                       (raise-binding-result-arity-error
                                        2
                                        args))))))
                               (done!_0 constructor?_0 ht_0 v_0 unquoted?_0)))
                           (if (if (box? v_0)
                                 (config-get config_0 1/print-box)
                                 #f)
                             (begin
                               (checking!_0 ht_0 v_0)
                               (let ((unquoted?_0
                                      (build-graph_0
                                       checking-port_0
                                       config_0
                                       constructor?_0
                                       counter_0
                                       cycle?_0
                                       ht_0
                                       (unbox v_0)
                                       mode_0)))
                                 (done!_0
                                  constructor?_0
                                  ht_0
                                  v_0
                                  unquoted?_0)))
                             (if (if (hash? v_0)
                                   (if (not (hash-weak? v_0))
                                     (config-get config_0 1/print-hash-table)
                                     #f)
                                   #f)
                               (begin
                                 (checking!_0 ht_0 v_0)
                                 (let ((unquoted?_0
                                        (begin
                                          (letrec*
                                           ((for-loop_0
                                             (|#%name|
                                              for-loop
                                              (lambda (unquoted?_0 i_0)
                                                (begin
                                                  (if i_0
                                                    (let ((k_0
                                                           (hash-iterate-key
                                                            v_0
                                                            i_0)))
                                                      (let ((unquoted?_1
                                                             (let ((unquoted?_1
                                                                    (let ((val_0
                                                                           (hash-ref
                                                                            v_0
                                                                            k_0
                                                                            #f)))
                                                                      (let ((k-unquoted?_0
                                                                             (build-graph_0
                                                                              checking-port_0
                                                                              config_0
                                                                              constructor?_0
                                                                              counter_0
                                                                              cycle?_0
                                                                              ht_0
                                                                              k_0
                                                                              mode_0)))
                                                                        (let ((or-part_0
                                                                               (build-graph_0
                                                                                checking-port_0
                                                                                config_0
                                                                                constructor?_0
                                                                                counter_0
                                                                                cycle?_0
                                                                                ht_0
                                                                                val_0
                                                                                mode_0)))
                                                                          (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_0
                                                          i_0))))
                                                    unquoted?_0))))))
                                           (for-loop_0
                                            #f
                                            (hash-iterate-first v_0))))))
                                   (done!_0
                                    constructor?_0
                                    ht_0
                                    v_0
                                    unquoted?_0)))
                               (if (mpair? v_0)
                                 (begin
                                   (checking!_0 ht_0 v_0)
                                   (build-graph_0
                                    checking-port_0
                                    config_0
                                    constructor?_0
                                    counter_0
                                    cycle?_0
                                    ht_0
                                    (mcar v_0)
                                    mode_0)
                                   (build-graph_0
                                    checking-port_0
                                    config_0
                                    constructor?_0
                                    counter_0
                                    cycle?_0
                                    ht_0
                                    (mcdr v_0)
                                    mode_0)
                                   (done!_0
                                    constructor?_0
                                    ht_0
                                    v_0
                                    (eq? mode_0 0)))
                                 (if (if (1/custom-write? v_0)
                                       (not (struct-type? v_0))
                                       #f)
                                   (let ((print-quotable_0
                                          (if (eq? mode_0 0)
                                            (1/custom-print-quotable-accessor
                                             v_0
                                             'self)
                                            'self)))
                                     (let ((unquoted?_0
                                            (eq? print-quotable_0 'never)))
                                       (begin
                                         (if (unsafe-unbox* checking-port_0)
                                           (void)
                                           (begin
                                             (unsafe-set-box*!
                                              checking-port_0
                                              (open-output-nowhere))
                                             (set-port-handlers-to-recur!
                                              (unsafe-unbox* checking-port_0)
                                              (lambda (e_0 p_0 mode_1)
                                                (if (let ((or-part_0
                                                           (eq? mode_1 1)))
                                                      (if or-part_0
                                                        or-part_0
                                                        (eq? mode_1 0)))
                                                  (let ((e-unquoted?_0
                                                         (build-graph_0
                                                          checking-port_0
                                                          config_0
                                                          constructor?_0
                                                          counter_0
                                                          cycle?_0
                                                          ht_0
                                                          e_0
                                                          mode_1)))
                                                    (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
                                                   checking-port_0
                                                   config_0
                                                   constructor?_0
                                                   counter_0
                                                   cycle?_0
                                                   ht_0
                                                   e_0
                                                   mode_1))))))
                                         (checking!_0 ht_0 v_0)
                                         (let ((app_0
                                                (1/custom-write-accessor v_0)))
                                           (let ((app_1
                                                  (unsafe-unbox*
                                                   checking-port_0)))
                                             (|#%app|
                                              app_0
                                              v_0
                                              app_1
                                              (if (if (eq? mode_0 0)
                                                    (eq?
                                                     print-quotable_0
                                                     'always)
                                                    #f)
                                                1
                                                mode_0))))
                                         (done!_0
                                          constructor?_0
                                          ht_0
                                          v_0
                                          unquoted?_0))))
                                   (if (if (struct? v_0)
                                         (config-get config_0 1/print-struct)
                                         #f)
                                     (begin
                                       (checking!_0 ht_0 v_0)
                                       (let ((unquoted?_0
                                              (let ((or-part_0
                                                     (call-with-values
                                                      (lambda ()
                                                        (let ((vec_0
                                                               (struct->vector
                                                                v_0)))
                                                          (begin
                                                            (check-vector
                                                             vec_0)
                                                            (values
                                                             vec_0
                                                             (unsafe-vector-length
                                                              vec_0)))))
                                                      (case-lambda
                                                       ((vec_0 len_0)
                                                        (begin
                                                          #f
                                                          (letrec*
                                                           ((for-loop_0
                                                             (|#%name|
                                                              for-loop
                                                              (lambda (unquoted?_0
                                                                       pos_0)
                                                                (begin
                                                                  (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
                                                                                            checking-port_0
                                                                                            config_0
                                                                                            constructor?_0
                                                                                            counter_0
                                                                                            cycle?_0
                                                                                            ht_0
                                                                                            e_0
                                                                                            mode_0)))
                                                                                      (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))))
                                                       (args
                                                        (raise-binding-result-arity-error
                                                         2
                                                         args))))))
                                                (if or-part_0
                                                  or-part_0
                                                  (if (eq? mode_0 0)
                                                    (not
                                                     (prefab-struct-key v_0))
                                                    #f)))))
                                         (done!_0
                                          constructor?_0
                                          ht_0
                                          v_0
                                          unquoted?_0)))
                                     #f))))))))))))))
           (checking!_0
            (|#%name|
             checking!
             (lambda (ht_0 v_0) (begin (hash-set! ht_0 v_0 'checking)))))
           (done!_0
            (|#%name|
             done!
             (lambda (constructor?_0 ht_0 v_0 unquoted?_0)
               (begin
                 (begin
                   (if (eq? 'checking (hash-ref ht_0 v_0 #f))
                     (hash-set! ht_0 v_0 'checked)
                     (void))
                   (if unquoted?_0
                     (let ((c_0 (hash-ref ht_0 v_0 #f)))
                       (begin
                         (hash-set!
                          ht_0
                          v_0
                          (as-constructor1.1 (if (integer? c_0) c_0 #f)))
                         (unsafe-set-box*! constructor?_0 #t)))
                     (void))
                   unquoted?_0))))))
    (lambda (v_0 ht_0 print-graph?_0 mode_0 config_0)
      (let ((counter_0 (box 0)))
        (let ((cycle?_0 (box #f)))
          (let ((constructor?_0 (box #f)))
            (let ((checking-port_0 (box #f)))
              (begin
                (build-graph_0
                 checking-port_0
                 config_0
                 constructor?_0
                 counter_0
                 cycle?_0
                 ht_0
                 v_0
                 mode_0)
                (if (if (not (unsafe-unbox* cycle?_0))
                      (if (not (unsafe-unbox* constructor?_0))
                        (not print-graph?_0)
                        #f)
                      #f)
                  #f
                  (if (if (not (unsafe-unbox* cycle?_0))
                        (not print-graph?_0)
                        #f)
                    (begin
                      (let ((lst_0 (hash-keys ht_0)))
                        (begin
                          (letrec*
                           ((for-loop_0
                             (|#%name|
                              for-loop
                              (lambda (lst_1)
                                (begin
                                  (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)))
                        (begin
                          (letrec*
                           ((for-loop_0
                             (|#%name|
                              for-loop
                              (lambda (lst_1)
                                (begin
                                  (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
  (letrec ((abbreviation_0
            (|#%name|
             abbreviation
             (lambda (alt-list-constructor_0 config_0 mode_0 v_0)
               (begin
                 (if (eq? mode_0 1)
                   (if (pair? v_0)
                     (if (pair? (cdr v_0))
                       (if (null? (cddr v_0))
                         (if (not alt-list-constructor_0)
                           (if (config-get
                                config_0
                                1/print-reader-abbreviations)
                             (let ((tmp_0 (car v_0)))
                               (if (eq? tmp_0 'quote)
                                 "'"
                                 (if (eq? tmp_0 'quasiquote)
                                   "`"
                                   (if (eq? tmp_0 'unquote)
                                     (if (starts-@?_0 config_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
                                                  config_0
                                                  (cadr v_0))
                                               "#, "
                                               "#,")
                                             (if (eq? tmp_0 'unsyntax-splicing)
                                               "#,@"
                                               #f)))))))))
                             #f)
                           #f)
                         #f)
                       #f)
                     #f)
                   #f)))))
           (starts-@?_0
            (|#%name|
             starts-@?
             (lambda (config_0 v_0)
               (begin
                 (if (symbol? v_0)
                   (let ((s_0
                          (symbol->print-string.1
                           unsafe-undefined
                           config_0
                           #f
                           #f
                           v_0)))
                     (char=? '#\x40 (string-ref s_0 0)))
                   #f))))))
    (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)
      (let ((unquoted-pairs?_0
             (if (eq? mode_0 0)
               (if (not alt-list-constructor_0)
                 (not (uninterrupted-list? v_0 graph_0))
                 #f)
               #f)))
        (let ((curly?_0
               (if (not (eq? mode_0 0))
                 (if (not alt-list-prefix_0)
                   (config-get config_0 1/print-pair-curly-braces)
                   #f)
                 #f)))
          (let ((c1_0
                 (abbreviation_0 alt-list-constructor_0 config_0 mode_0 v_0)))
            (if c1_0
              (let ((app_0 (cadr v_0)))
                (|#%app|
                 p_0
                 who_0
                 app_0
                 mode_0
                 o_0
                 (write-string/max c1_0 o_0 max-length_0)
                 graph_0
                 config_0))
              (let ((max-length_1
                     (if (eq? mode_0 0)
                       (let ((max-length_1
                              (if unquoted-pairs?_0
                                (if (multiple-pairs? v_0 graph_0)
                                  (write-string/max "(list*" o_0 max-length_0)
                                  (write-string/max "(cons" o_0 max-length_0))
                                (write-string/max
                                 (if alt-list-constructor_0
                                   alt-list-constructor_0
                                   "(list")
                                 o_0
                                 max-length_0))))
                         (if (null? v_0)
                           max-length_1
                           (write-string/max " " o_0 max-length_1)))
                       (write-string/max
                        (if alt-list-prefix_0
                          alt-list-prefix_0
                          (if curly?_0 "{" "("))
                        o_0
                        max-length_0))))
                (letrec*
                 ((loop_0
                   (|#%name|
                    loop
                    (lambda (v_1 max-length_2)
                      (begin
                        (if (eq? max-length_2 'full)
                          'full
                          (if (null? v_1)
                            (write-string/max
                             (if curly?_0 "}" ")")
                             o_0
                             max-length_2)
                            (if (if (null? (cdr v_1))
                                  (not unquoted-pairs?_0)
                                  #f)
                              (let ((max-length_3
                                     (|#%app|
                                      p_0
                                      who_0
                                      (car 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 (pair? (cdr v_1))
                                    (if (let ((or-part_0 (not graph_0)))
                                          (if or-part_0
                                            or-part_0
                                            (non-graph?
                                             (hash-ref graph_0 (cdr v_1) #f))))
                                      (not
                                       (abbreviation_0
                                        alt-list-constructor_0
                                        config_0
                                        mode_0
                                        (cdr v_1)))
                                      #f)
                                    #f)
                                (let ((max-length_3
                                       (|#%app|
                                        p_0
                                        who_0
                                        (car v_1)
                                        mode_0
                                        o_0
                                        max-length_2
                                        graph_0
                                        config_0)))
                                  (let ((app_0 (cdr v_1)))
                                    (loop_0
                                     app_0
                                     (write-string/max " " o_0 max-length_3))))
                                (let ((c2_0
                                       (abbreviation_0
                                        alt-list-constructor_0
                                        config_0
                                        mode_0
                                        v_1)))
                                  (if c2_0
                                    (let ((app_0 (cadr v_1)))
                                      (|#%app|
                                       p_0
                                       who_0
                                       app_0
                                       mode_0
                                       o_0
                                       (write-string/max c2_0 o_0 max-length_2)
                                       graph_0
                                       config_0))
                                    (let ((max-length_3
                                           (|#%app|
                                            p_0
                                            who_0
                                            (car v_1)
                                            mode_0
                                            o_0
                                            max-length_2
                                            graph_0
                                            config_0)))
                                      (let ((max-length_4
                                             (if unquoted-pairs?_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
                                                (cdr 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 uninterrupted-list?
  (lambda (v_0 graph_0)
    (if (list? v_0)
      (letrec*
       ((loop_0
         (|#%name|
          loop
          (lambda (v_1)
            (begin
              (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)
                (begin
                  (if (eq? max-length_2 'full)
                    'full
                    (if (if (null? (mcdr v_1)) (not unquoted?_0) #f)
                      (let ((max-length_3
                             (|#%app|
                              p_0
                              who_0
                              (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? (mcdr v_1))
                            (if (let ((or-part_0 (not graph_0)))
                                  (if or-part_0
                                    or-part_0
                                    (not (hash-ref graph_0 (mcdr v_1) #f))))
                              (not unquoted?_0)
                              #f)
                            #f)
                        (let ((max-length_3
                               (|#%app|
                                p_0
                                who_0
                                (mcar v_1)
                                mode_0
                                o_0
                                max-length_2
                                graph_0
                                config_0)))
                          (let ((app_0 (mcdr v_1)))
                            (loop_0
                             app_0
                             (write-string/max " " o_0 max-length_3))))
                        (let ((max-length_3
                               (|#%app|
                                p_0
                                who_0
                                (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
                                    (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
  (letrec ((v->list_0
            (|#%name|
             v->list
             (lambda (v-ref_0 v_0 len_0)
               (begin
                 (if (zero? len_0)
                   '()
                   (letrec*
                    ((loop_0
                      (|#%name|
                       loop
                       (lambda (i_0 accum_0)
                         (begin
                           (let ((val_0 (|#%app| v-ref_0 v_0 i_0)))
                             (if (zero? i_0)
                               (cons val_0 accum_0)
                               (loop_0 (sub1 i_0) (cons val_0 accum_0)))))))))
                    (loop_0 (sub1 len_0) '()))))))))
    (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 ((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)
                             (begin
                               (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-ref_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-ref_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(" "#hash("))))
      (let ((keys_0 (try-sort (hash-keys v_0))))
        (letrec*
         ((loop_0
           (|#%name|
            loop
            (lambda (keys_1 max-length_1 first?_0)
              (begin
                (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 (andmap2 real? (cdr keys_0)) (sort.1 #f #f keys_0 <) keys_0)
        (if (symbol? (car keys_0))
          (if (andmap2 symbol? (cdr keys_0))
            (sort.1 #f #f keys_0 symbol<?)
            keys_0)
          (if (keyword? (car keys_0))
            (if (andmap2 keyword? (cdr keys_0))
              (sort.1 #f #f keys_0 keyword<?)
              keys_0)
            (if (string? (car keys_0))
              (if (andmap2 string? (cdr keys_0))
                (sort.1 #f #f keys_0 string<?)
                keys_0)
              (if (bytes? (car keys_0))
                (if (andmap2 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
       (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
       (begin
         (if (is-path? p_0)
           (void)
           (raise-argument-error 'path->string "path?" p_0))
         (1/bytes->string/locale (|#%app| path-bytes p_0) '#\x3f))))))
(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)
            (begin
              (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) (begin (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)
            (begin
              (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)
            (begin
              (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) (begin (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)
            (begin
              (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)
            (begin
              (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) (begin (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)
            (begin
              (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!
  (letrec ((...rc/io/print/main.rkt:123:8_0
            (|#%name|
             ...rc/io/print/main.rkt:123:8
             (lambda (default-value_0
                      param_0
                      who34_0
                      v35_0
                      o36_0
                      quote-depth-in32_0
                      max-length33_0)
               (begin
                 (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)))))))))
    (lambda (param_0 default-value_0)
      (set! do-global-print
        (|#%name|
         ...rc/io/print/main.rkt:123:8
         (case-lambda
          ((who_0 v_0 o_0)
           (begin
             (...rc/io/print/main.rkt:123:8_0
              default-value_0
              param_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:123:8_0
            default-value_0
            param_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:123:8_0
            default-value_0
            param_0
            who_0
            v_0
            o_0
            quote-depth-in32_0
            #f))))))))
(define 1/newline
  (let ((newline_0
         (|#%name|
          newline
          (lambda (o21_0)
            (begin
              (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
      (() (begin (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 (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"
                                                     "(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 (eq? mode_0 #t)
                                          (if (not
                                               (config-get
                                                config_0
                                                1/print-unreadable))
                                            (not
                                             (|#%app| printable-regexp? v_0))
                                            #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 (|#%app|
                                                           core-input-port?
                                                           v_0)
                                                        (print-named
                                                         "input-port"
                                                         v_0
                                                         mode_0
                                                         o_0
                                                         max-length_0)
                                                        (if (|#%app|
                                                             core-output-port?
                                                             v_0)
                                                          (print-named
                                                           "output-port"
                                                           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 ((app_0 (symbol->immutable-string who_0)))
              (string-append
               app_0
               ": 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_1 (error-value->string-handler)))
                  (|#%app| app_1 v_0 (error-print-width))))))))
       (|#%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
  (letrec ((bad-dot_0
            (|#%name|
             bad-dot
             (lambda (all-args_0 fmt_0 who_0)
               (begin
                 (ill-formed-error
                  who_0
                  "tag `~.` not followed by `a`, `s`, or `v`"
                  fmt_0
                  all-args_0)))))
           (loop_0
            (|#%name|
             loop
             (lambda (fmt_0 len_0 o_0 who_0 start-i_0 i_0 args_0)
               (begin
                 (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)
                       (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)
                                             (begin
                                               (if (= i_2 len_0)
                                                 (loop_0
                                                  fmt_0
                                                  len_0
                                                  o_0
                                                  who_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
                                                        fmt_0
                                                        len_0
                                                        o_0
                                                        who_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
                                                          fmt_0
                                                          len_0
                                                          o_0
                                                          who_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
                                                          fmt_0
                                                          len_0
                                                          o_0
                                                          who_0
                                                          i_2
                                                          i_2
                                                          args_0)))))))))))
                                        (ws-loop_0 i_1 #f))
                                       (void))
                                     (begin
                                       (1/write-string "~" o_0)
                                       (next_1
                                        fmt_0
                                        len_0
                                        o_0
                                        who_0
                                        i_1
                                        args_0)))
                                   (if (unsafe-fx< index_0 3)
                                     (begin
                                       (1/write-string "\n" o_0)
                                       (next_1
                                        fmt_0
                                        len_0
                                        o_0
                                        who_0
                                        i_1
                                        args_0))
                                     (if (unsafe-fx< index_0 4)
                                       (begin
                                         (display-via-handler
                                          who_0
                                          (car args_0)
                                          o_0)
                                         (next_1
                                          fmt_0
                                          len_0
                                          o_0
                                          who_0
                                          i_1
                                          (cdr args_0)))
                                       (begin
                                         (write-via-handler
                                          who_0
                                          (car args_0)
                                          o_0)
                                         (next_1
                                          fmt_0
                                          len_0
                                          o_0
                                          who_0
                                          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
                                        fmt_0
                                        len_0
                                        o_0
                                        who_0
                                        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
                                           (let ((app_0
                                                  (error-value->string-handler)))
                                             (let ((app_1 (car args_0)))
                                               (|#%app|
                                                app_0
                                                app_1
                                                (error-print-width))))
                                           o_0))
                                         (next_1
                                          fmt_0
                                          len_0
                                          o_0
                                          who_0
                                          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
                                                fmt_0
                                                len_0
                                                o_0
                                                who_0
                                                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
                                                  fmt_0
                                                  len_0
                                                  o_0
                                                  who_0
                                                  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
                                                    fmt_0
                                                    len_0
                                                    o_0
                                                    who_0
                                                    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
                                        fmt_0
                                        len_0
                                        o_0
                                        who_0
                                        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
                                          fmt_0
                                          len_0
                                          o_0
                                          who_0
                                          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
                                            fmt_0
                                            len_0
                                            o_0
                                            who_0
                                            i_1
                                            (cdr args_0)))
                                         (begin
                                           (1/write-string
                                            (string (car args_0))
                                            o_0)
                                           (next_1
                                            fmt_0
                                            len_0
                                            o_0
                                            who_0
                                            i_1
                                            (cdr args_0))))))))))))
                       (loop_0
                        fmt_0
                        len_0
                        o_0
                        who_0
                        start-i_0
                        (add1 i_0)
                        args_0))))))))
           (next_0
            (|#%name|
             next
             (lambda (args_0) (begin (if (pair? args_0) (cdr args_0) #f)))))
           (next_1
            (|#%name|
             next
             (lambda (fmt_0 len_0 o_0 who_0 i_0 args_0)
               (begin
                 (let ((i_1 (add1 i_0)))
                   (loop_0 fmt_0 len_0 o_0 who_0 i_1 i_1 args_0)))))))
    (lambda (who_0 o_0 fmt_0 all-args_0)
      (let ((len_0 (string-length fmt_0)))
        (begin
          (letrec*
           ((loop_1
             (|#%name|
              loop
              (lambda (i_0 expected-count_0 args_0 error-thunk_0)
                (begin
                  (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_1
                                       (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_1
                                     (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_1
                                         app_0
                                         app_1
                                         (next_0 args_0)
                                         error-thunk_0)))
                                    (if (unsafe-fx< index_0 4)
                                      (let ((i_2 (add1 i_1)))
                                        (begin
                                          (if (= i_2 len_0)
                                            (bad-dot_0 all-args_0 fmt_0 who_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_1
                                                   app_0
                                                   app_1
                                                   (next_0 args_0)
                                                   error-thunk_0)))
                                              (bad-dot_0
                                               all-args_0
                                               fmt_0
                                               who_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 ()
                                                        (begin
                                                          (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_1
                                               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 ()
                                                        (begin
                                                          (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_1
                                               app_0
                                               app_1
                                               (next_0 args_0)
                                               new-error-thunk_0))))))))))))
                        (loop_1
                         (add1 i_0)
                         expected-count_0
                         args_0
                         error-thunk_0)))))))))
           (loop_1 0 0 all-args_0 #f))
          (loop_0 fmt_0 len_0 o_0 who_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 (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 value->string
  (lambda (v_0)
    (let ((app_0 (error-value->string-handler)))
      (|#%app| app_0 v_0 (error-print-width)))))
(define arguments->string
  (letrec ((loop_0
            (|#%name|
             loop
             (lambda (ss_0)
               (begin
                 (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)))))))))))
    (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: "
            (loop_0 (map2 value->string args_0))))
          "")))))
(define 1/fprintf
  (|#%name|
   fprintf
   (lambda (o_0 fmt_0 . args_0)
     (begin
       (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
       (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
       (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)
        (if (keyword? a_0) (string-append "#:" (keyword->string a_0)) #f)))))
(define 1/format
  (|#%name|
   format
   (case-lambda
    ((fmt_0 a_0)
     (begin
       (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)
                   (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) (begin (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)
     (begin (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)
                   (begin
                     (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
  (letrec ((check_0
            (|#%name|
             check
             (lambda (convention4_0 first?1_0 p3_0 who5_0 c_0)
               (begin
                 (begin
                   (if (if convention4_0 (not (eq? c_0 convention4_0)) #f)
                     (let ((app_0
                            (let ((app_0
                                   (if first?1_0
                                     "specified convention incompatible with ~a path element"
                                     "preceding path's convention incompatible with ~a path element")))
                              (1/format
                               app_0
                               (if (string? p3_0) "string" "given")))))
                       (raise-arguments-error
                        who5_0
                        app_0
                        "path element"
                        p3_0
                        (if first?1_0
                          "convention"
                          "preceding path's convention")
                        convention4_0))
                     (void))
                   c_0))))))
    (|#%name|
     argument->convention
     (lambda (first?1_0 p3_0 convention4_0 who5_0)
       (begin
         (if (1/path? p3_0)
           (check_0
            convention4_0
            first?1_0
            p3_0
            who5_0
            (|#%app| path-convention p3_0))
           (if (string? p3_0)
             (check_0
              convention4_0
              first?1_0
              p3_0
              who5_0
              (system-path-convention-type))
             convention4_0)))))))
(define append-path-parts
  (letrec ((combine_0
            (|#%name|
             combine
             (lambda (accum_0
                      bstr_0
                      convention_0
                      first?_0
                      result-is-backslash-backslash-questionmark?_0
                      sub_0
                      subs_0
                      unc-result?_0
                      who_0
                      is-rel?_0
                      is-complete?_0
                      is-drive?_0)
               (begin
                 (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_0)
                                       (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_0))))))
                     (loop_0
                      convention_0
                      result-is-backslash-backslash-questionmark?_0
                      unc-result?_0
                      who_0
                      app_0
                      (cdr subs_0)
                      #f)))))))
           (loop_0
            (|#%name|
             loop
             (lambda (convention_0
                      result-is-backslash-backslash-questionmark?_0
                      unc-result?_0
                      who_0
                      accum_0
                      subs_0
                      first?_0)
               (begin
                 (if (null? subs_0)
                   (let ((elems_0 (1/reverse accum_0)))
                     (combine-build-elements elems_0 unc-result?_0))
                   (let ((sub_0 (car subs_0)))
                     (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)
                               (loop_0
                                convention_0
                                result-is-backslash-backslash-questionmark?_0
                                unc-result?_0
                                who_0
                                (cons bstr_0 accum_0)
                                (cdr subs_0)
                                #f)
                               (loop_0
                                convention_0
                                result-is-backslash-backslash-questionmark?_0
                                unc-result?_0
                                who_0
                                (list* bstr_0 #vu8(47) accum_0)
                                (cdr subs_0)
                                #f))))
                         (if (eq? convention_0 'windows)
                           (let ((len_0 (unsafe-bytes-length bstr_0)))
                             (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))
                                  (case-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
                                         accum_0
                                         bstr_0
                                         convention_0
                                         first?_0
                                         result-is-backslash-backslash-questionmark?_0
                                         sub_0
                                         subs_0
                                         unc-result?_0
                                         who_0
                                         (eq? kind_0 'rel)
                                         abs?_0
                                         (if abs?_0
                                           (just-backslashes-after?
                                            bstr_0
                                            drive-len_0)
                                           #f)))))
                                   (args
                                    (raise-binding-result-arity-error
                                     5
                                     args))))
                                 (let ((c1_0 (parse-unc.1 #f #f bstr_0 0)))
                                   (if c1_0
                                     (combine_0
                                      accum_0
                                      bstr_0
                                      convention_0
                                      first?_0
                                      result-is-backslash-backslash-questionmark?_0
                                      sub_0
                                      subs_0
                                      unc-result?_0
                                      who_0
                                      #t
                                      #t
                                      (just-separators-after? bstr_0 c1_0))
                                     (combine_0
                                      accum_0
                                      bstr_0
                                      convention_0
                                      first?_0
                                      result-is-backslash-backslash-questionmark?_0
                                      sub_0
                                      subs_0
                                      unc-result?_0
                                      who_0
                                      #f
                                      #f
                                      #f))))
                               (if (letter-drive-start? bstr_0 len_0)
                                 (combine_0
                                  accum_0
                                  bstr_0
                                  convention_0
                                  first?_0
                                  result-is-backslash-backslash-questionmark?_0
                                  sub_0
                                  subs_0
                                  unc-result?_0
                                  who_0
                                  #f
                                  #t
                                  (just-separators-after? bstr_0 2))
                                 (combine_0
                                  accum_0
                                  bstr_0
                                  convention_0
                                  first?_0
                                  result-is-backslash-backslash-questionmark?_0
                                  sub_0
                                  subs_0
                                  unc-result?_0
                                  who_0
                                  #t
                                  #f
                                  #f))))
                           (void)))))))))))
    (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)))
                 (begin
                   (letrec*
                    ((for-loop_0
                      (|#%name|
                       for-loop
                       (lambda (result_0 lst_1)
                         (begin
                           (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)))
            (loop_0
             convention_0
             result-is-backslash-backslash-questionmark?_0
             unc-result?_0
             who_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)
            (begin
              (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))
                      (loop_0 (cdr elems_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)
                     (begin
                       (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)))
       (case-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))))
        (args (raise-binding-result-arity-error 2 args))))
      (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)
          (|#%app| path-bytes p_0)
          (1/string->bytes/locale p_0 63))))))
(define just-separators-after?
  (letrec ((procz2 (lambda (x_0) (unsafe-bytes-length x_0)))
           (procz1 (lambda (x_0) (bytes? x_0))))
    (lambda (bstr_0 drive-len_0)
      (call-with-values
       (lambda ()
         (normalise-inputs
          'in-bytes
          "bytes"
          procz1
          procz2
          bstr_0
          drive-len_0
          #f
          1))
       (case-lambda
        ((v*_0 start*_0 stop*_0 step*_0)
         (begin
           #t
           (letrec*
            ((for-loop_0
              (|#%name|
               for-loop
               (lambda (result_0 idx_0)
                 (begin
                   (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))))
        (args (raise-binding-result-arity-error 4 args)))))))
(define just-backslashes-after?
  (letrec ((procz2 (lambda (x_0) (unsafe-bytes-length x_0)))
           (procz1 (lambda (x_0) (bytes? x_0))))
    (lambda (bstr_0 drive-len_0)
      (call-with-values
       (lambda ()
         (normalise-inputs
          'in-bytes
          "bytes"
          procz1
          procz2
          bstr_0
          drive-len_0
          #f
          1))
       (case-lambda
        ((v*_0 start*_0 stop*_0 step*_0)
         (begin
           #t
           (letrec*
            ((for-loop_0
              (|#%name|
               for-loop
               (lambda (result_0 idx_0)
                 (begin
                   (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))))
        (args (raise-binding-result-arity-error 4 args)))))))
(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 struct:starting-point
  (make-record-type-descriptor* 'starting-point #f #f #f #f 7 127))
(define effect2624
  (struct-type-install-properties!
   struct:starting-point
   'starting-point
   7
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1 2 3 4 5 6)
   #f
   'starting-point))
(define starting-point7.1
  (|#%name|
   starting-point
   (record-constructor
    (make-record-constructor-descriptor struct:starting-point #f #f))))
(define starting-point?2623
  (|#%name| starting-point? (record-predicate struct:starting-point)))
(define starting-point?
  (|#%name|
   starting-point?
   (lambda (v)
     (if (starting-point?2623 v)
       #t
       ($value
        (if (impersonator? v)
          (starting-point?2623 (impersonator-val v))
          #f))))))
(define starting-point-kind2625
  (|#%name| starting-point-kind (record-accessor struct:starting-point 0)))
(define starting-point-kind
  (|#%name|
   starting-point-kind
   (lambda (s)
     (if (starting-point?2623 s)
       (starting-point-kind2625 s)
       ($value
        (impersonate-ref
         starting-point-kind2625
         struct:starting-point
         0
         s
         'starting-point
         'kind))))))
(define starting-point-bstr2626
  (|#%name| starting-point-bstr (record-accessor struct:starting-point 1)))
(define starting-point-bstr
  (|#%name|
   starting-point-bstr
   (lambda (s)
     (if (starting-point?2623 s)
       (starting-point-bstr2626 s)
       ($value
        (impersonate-ref
         starting-point-bstr2626
         struct:starting-point
         1
         s
         'starting-point
         'bstr))))))
(define starting-point-len2627
  (|#%name| starting-point-len (record-accessor struct:starting-point 2)))
(define starting-point-len
  (|#%name|
   starting-point-len
   (lambda (s)
     (if (starting-point?2623 s)
       (starting-point-len2627 s)
       ($value
        (impersonate-ref
         starting-point-len2627
         struct:starting-point
         2
         s
         'starting-point
         'len))))))
(define starting-point-orig-len2628
  (|#%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?2623 s)
       (starting-point-orig-len2628 s)
       ($value
        (impersonate-ref
         starting-point-orig-len2628
         struct:starting-point
         3
         s
         'starting-point
         'orig-len))))))
(define starting-point-extra-sep2629
  (|#%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?2623 s)
       (starting-point-extra-sep2629 s)
       ($value
        (impersonate-ref
         starting-point-extra-sep2629
         struct:starting-point
         4
         s
         'starting-point
         'extra-sep))))))
(define starting-point-add-ups?2630
  (|#%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?2623 s)
       (starting-point-add-ups?2630 s)
       ($value
        (impersonate-ref
         starting-point-add-ups?2630
         struct:starting-point
         5
         s
         'starting-point
         'add-ups?))))))
(define starting-point-drive?2631
  (|#%name| starting-point-drive? (record-accessor struct:starting-point 6)))
(define starting-point-drive?
  (|#%name|
   starting-point-drive?
   (lambda (s)
     (if (starting-point?2623 s)
       (starting-point-drive?2631 s)
       ($value
        (impersonate-ref
         starting-point-drive?2631
         struct:starting-point
         6
         s
         'starting-point
         'drive?))))))
(define effect2632
  (begin
    (register-struct-constructor! starting-point7.1)
    (register-struct-predicate! starting-point?)
    (register-struct-field-accessor!
     starting-point-kind
     struct:starting-point
     0)
    (register-struct-field-accessor!
     starting-point-bstr
     struct:starting-point
     1)
    (register-struct-field-accessor!
     starting-point-len
     struct:starting-point
     2)
    (register-struct-field-accessor!
     starting-point-orig-len
     struct:starting-point
     3)
    (register-struct-field-accessor!
     starting-point-extra-sep
     struct:starting-point
     4)
    (register-struct-field-accessor!
     starting-point-add-ups?
     struct:starting-point
     5)
    (register-struct-field-accessor!
     starting-point-drive?
     struct:starting-point
     6)
    (void)))
(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)
     (begin
       (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))
       (case-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)))
            (case-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)))
                     (let ((temp72_1 temp72_0))
                       (make-starting-point.1
                        temp73_0
                        #f
                        #vu8()
                        unsafe-undefined
                        kind_0
                        bstr_0
                        temp72_1)))))))
             (args (raise-binding-result-arity-error 2 args))))))
        (args (raise-binding-result-arity-error 5 args))))
      (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)))))
           (case-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))))))
            (args (raise-binding-result-arity-error 2 args))))
          (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)
                          (begin
                            (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
  (letrec ((is-a-sep?_0
            (|#%name|
             is-a-sep?
             (lambda (bbq-mode?20_0 b_0)
               (begin
                 (if bbq-mode?20_0 (eqv? b_0 92) (is-sep? b_0 'windows))))))
           (loop_0
            (|#%name|
             loop
             (lambda (bbq-mode?20_0
                      bstr24_0
                      keep-trailing-separator?21_0
                      len_0
                      pos_0)
               (begin
                 (if (= pos_0 len_0)
                   null
                   (if (is-a-sep?_0
                        bbq-mode?20_0
                        (unsafe-bytes-ref bstr24_0 pos_0))
                     (loop_0
                      bbq-mode?20_0
                      bstr24_0
                      keep-trailing-separator?21_0
                      len_0
                      (add1 pos_0))
                     (letrec*
                      ((e-loop_0
                        (|#%name|
                         e-loop
                         (lambda (end-pos_0)
                           (begin
                             (if (let ((or-part_0 (= end-pos_0 len_0)))
                                   (if or-part_0
                                     or-part_0
                                     (is-a-sep?_0
                                      bbq-mode?20_0
                                      (unsafe-bytes-ref bstr24_0 end-pos_0))))
                               (let ((rest_0
                                      (loop_0
                                       bbq-mode?20_0
                                       bstr24_0
                                       keep-trailing-separator?21_0
                                       len_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))))))))))
    (|#%name|
     extract-separate-parts
     (lambda (bbq-mode?20_0 keep-trailing-separator?21_0 bstr24_0 pos25_0)
       (begin
         (let ((len_0 (unsafe-bytes-length bstr24_0)))
           (loop_0
            bbq-mode?20_0
            bstr24_0
            keep-trailing-separator?21_0
            len_0
            pos25_0)))))))
(define extract-dot-ups
  (letrec ((loop_0
            (|#%name|
             loop
             (lambda (bstr_0 dots-end_0 i_0)
               (begin
                 (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 bstr_0 dots-end_0 (add1 i_0)))
                     (loop_0 bstr_0 dots-end_0 (add1 i_0)))))))))
    (lambda (bstr_0 start_0 dots-end_0)
      (if (= start_0 dots-end_0)
        '()
        (loop_0 bstr_0 dots-end_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)
     (begin
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda (bstrs_0 accum_0)
             (begin
               (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
       (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 (|#%app| 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)
      (|#%app| 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) (|#%app| check-directory-path 'current-directory v_0))
   'current-directory))
(define current-directory-for-user$1
  (make-parameter
   (current-directory$1)
   (lambda (v_0)
     (|#%app| 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
       (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
  (letrec ((return_0
            (|#%name|
             return
             (lambda (convention_0 p_0 bstr_0)
               (begin
                 (if (eq? bstr_0 (|#%app| path-bytes p_0))
                   p_0
                   (path1.1 bstr_0 convention_0)))))))
    (lambda (p_0 convert-slashes?_0)
      (let ((convention_0 (|#%app| path-convention p_0)))
        (let ((bstr_0 (|#%app| path-bytes p_0)))
          (if (eq? convention_0 'unix)
            (return_0
             convention_0
             p_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
                    (|#%app| path-bytes p_0)))
                 (case-lambda
                  ((kind_0
                    drive-len_0
                    orig-drive-len_0
                    clean-start-pos_0
                    sep-bstr_0)
                   (if clean-start-pos_0
                     (return_0
                      convention_0
                      p_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)))
                      (case-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 convention_0 p_0 new-bstr_0)
                              (if (=
                                   literal-start_0
                                   (unsafe-bytes-length new-bstr_0))
                                (return_0 convention_0 p_0 new-bstr_0)
                                (return_0
                                 convention_0
                                 p_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)))))))))
                       (args (raise-binding-result-arity-error 2 args))))))
                  (args (raise-binding-result-arity-error 5 args))))
                (let ((c1_0 (parse-unc.1 #f #f bstr_0 0)))
                  (if c1_0
                    (return_0
                     convention_0
                     p_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
                         convention_0
                         p_0
                         (let ((temp30_0 (if convert-slashes?_0 2 #f)))
                           (clean-double-slashes.1
                            #f
                            temp30_0
                            bstr_0
                            'windows
                            2)))
                        (return_0
                         convention_0
                         p_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
                       convention_0
                       p_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
  (letrec ((procz2 (lambda (x_0) (unsafe-bytes-length x_0)))
           (procz1 (lambda (x_0) (bytes? x_0)))
           (is-a-sep?_0
            (|#%name|
             is-a-sep?
             (lambda (convention6_0 only-backslash?1_0 b_0)
               (begin
                 (if only-backslash?1_0
                   (eqv? b_0 92)
                   (is-sep? b_0 convention6_0))))))
           (loop_0
            (|#%name|
             loop
             (lambda (allow-double-before7_0
                      bstr5_0
                      convention6_0
                      new-bstr_0
                      only-backslash?1_0
                      to-backslash-from2_0
                      i_0
                      j_0)
               (begin
                 (if (<= i_0 allow-double-before7_0)
                   (void)
                   (if (is-a-sep?_0
                        convention6_0
                        only-backslash?1_0
                        (unsafe-bytes-ref bstr5_0 i_0))
                     (if (is-a-sep?_0
                          convention6_0
                          only-backslash?1_0
                          (unsafe-bytes-ref bstr5_0 (sub1 i_0)))
                       (loop_0
                        allow-double-before7_0
                        bstr5_0
                        convention6_0
                        new-bstr_0
                        only-backslash?1_0
                        to-backslash-from2_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
                            allow-double-before7_0
                            bstr5_0
                            convention6_0
                            new-bstr_0
                            only-backslash?1_0
                            to-backslash-from2_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
                          allow-double-before7_0
                          bstr5_0
                          convention6_0
                          new-bstr_0
                          only-backslash?1_0
                          to-backslash-from2_0
                          app_0
                          (sub1 j_0))))))))))
           (loop_1
            (|#%name|
             loop
             (lambda (allow-double-before7_0
                      bstr5_0
                      convention6_0
                      only-backslash?1_0
                      i_0)
               (begin
                 (if (<= i_0 allow-double-before7_0)
                   0
                   (if (if (is-a-sep?_0
                            convention6_0
                            only-backslash?1_0
                            (unsafe-bytes-ref bstr5_0 i_0))
                         (is-a-sep?_0
                          convention6_0
                          only-backslash?1_0
                          (unsafe-bytes-ref bstr5_0 (sub1 i_0)))
                         #f)
                     (add1
                      (loop_1
                       allow-double-before7_0
                       bstr5_0
                       convention6_0
                       only-backslash?1_0
                       (sub1 i_0)))
                     (loop_1
                      allow-double-before7_0
                      bstr5_0
                      convention6_0
                      only-backslash?1_0
                      (sub1 i_0)))))))))
    (|#%name|
     clean-double-slashes
     (lambda (only-backslash?1_0
              to-backslash-from2_0
              bstr5_0
              convention6_0
              allow-double-before7_0)
       (begin
         (let ((extra-count_0
                (loop_1
                 allow-double-before7_0
                 bstr5_0
                 convention6_0
                 only-backslash?1_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 ()
                         (normalise-inputs
                          'in-bytes
                          "bytes"
                          procz1
                          procz2
                          bstr5_0
                          to-backslash-from2_0
                          #f
                          1))
                       (case-lambda
                        ((v*_0 start*_0 stop*_0 step*_0)
                         (begin
                           #t
                           (letrec*
                            ((for-loop_0
                              (|#%name|
                               for-loop
                               (lambda (result_0 idx_0)
                                 (begin
                                   (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))))
                        (args (raise-binding-result-arity-error 4 args)))))))
                 #f)
             bstr5_0
             (let ((new-bstr_0
                    (make-bytes
                     (- (unsafe-bytes-length bstr5_0) extra-count_0))))
               (begin
                 (let ((app_0 (sub1 (unsafe-bytes-length bstr5_0))))
                   (loop_0
                    allow-double-before7_0
                    bstr5_0
                    convention6_0
                    new-bstr_0
                    only-backslash?1_0
                    to-backslash-from2_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)))
                       (begin
                         (letrec*
                          ((for-loop_0
                            (|#%name|
                             for-loop
                             (lambda (pos_0)
                               (begin
                                 (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)
                  (begin
                    (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
                                                    (eqv? b_0 62)))))))))))
                              #t
                              (loop_0 i_0 #f)))))))))))
             (loop_0 len_0 #t))))))))
(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 struct:security-guard
  (make-record-type-descriptor* 'security-guard #f #f #f #f 4 15))
(define effect2764
  (struct-type-install-properties!
   struct:security-guard
   'security-guard
   4
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1 2 3)
   #f
   'security-guard))
(define security-guard1.1
  (|#%name|
   security-guard
   (record-constructor
    (make-record-constructor-descriptor struct:security-guard #f #f))))
(define 1/security-guard?2763
  (|#%name| security-guard? (record-predicate struct:security-guard)))
(define 1/security-guard?
  (|#%name|
   security-guard?
   (lambda (v)
     (if (1/security-guard?2763 v)
       #t
       ($value
        (if (impersonator? v)
          (1/security-guard?2763 (impersonator-val v))
          #f))))))
(define security-guard-parent2765
  (|#%name| security-guard-parent (record-accessor struct:security-guard 0)))
(define security-guard-parent
  (|#%name|
   security-guard-parent
   (lambda (s)
     (if (1/security-guard?2763 s)
       (security-guard-parent2765 s)
       ($value
        (impersonate-ref
         security-guard-parent2765
         struct:security-guard
         0
         s
         'security-guard
         'parent))))))
(define security-guard-file-guard2766
  (|#%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?2763 s)
       (security-guard-file-guard2766 s)
       ($value
        (impersonate-ref
         security-guard-file-guard2766
         struct:security-guard
         1
         s
         'security-guard
         'file-guard))))))
(define security-guard-network-guard2767
  (|#%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?2763 s)
       (security-guard-network-guard2767 s)
       ($value
        (impersonate-ref
         security-guard-network-guard2767
         struct:security-guard
         2
         s
         'security-guard
         'network-guard))))))
(define security-guard-link-guard2768
  (|#%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?2763 s)
       (security-guard-link-guard2768 s)
       ($value
        (impersonate-ref
         security-guard-link-guard2768
         struct:security-guard
         3
         s
         'security-guard
         'link-guard))))))
(define effect2769
  (begin
    (register-struct-constructor! security-guard1.1)
    (register-struct-predicate! 1/security-guard?)
    (register-struct-field-accessor!
     security-guard-parent
     struct:security-guard
     0)
    (register-struct-field-accessor!
     security-guard-file-guard
     struct:security-guard
     1)
    (register-struct-field-accessor!
     security-guard-network-guard
     struct:security-guard
     2)
    (register-struct-field-accessor!
     security-guard-link-guard
     struct:security-guard
     3)
    (void)))
(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
              (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)
       (begin
         (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
              (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
      (() (begin (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
       (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)
                   (begin
                     (letrec*
                      ((for-loop_0
                        (|#%name|
                         for-loop
                         (lambda (result_0 lst_0)
                           (begin
                             (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)
                     (begin
                       (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
       (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)
                       (begin
                         (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
       (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)
                       (begin
                         (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))
        (let ((app_0 path-bytes))
          (|#%app|
           app_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))
        (|#%app| 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 none$1 (gensym))
(define 1/open-input-file
  (let ((open-input-file_0
         (letrec ((mode->flags_0
                   (|#%name|
                    mode->flags
                    (lambda (mode_0) (begin (if (eq? mode_0 'text) 4 0))))))
           (|#%name|
            open-input-file
            (lambda (path3_0 mode11_0 mode22_0)
              (begin
                (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 ((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 ((temp33_0 (host-> host-path_0)))
                                         (open-input-fd.1
                                          unsafe-undefined
                                          unsafe-undefined
                                          fd_0
                                          temp33_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)
       (begin (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
  (letrec ((mode->flags_0
            (|#%name|
             mode->flags
             (lambda (mode_0)
               (begin
                 (if (eq? mode_0 'test)
                   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))))))))))
           (mode?_0
            (|#%name|
             mode?
             (lambda (mode18_0 mode29_0 v_0)
               (begin
                 (let ((or-part_0 (eq? mode18_0 v_0)))
                   (if or-part_0 or-part_0 (eq? mode29_0 v_0))))))))
    (|#%name|
     do-open-output-file
     (lambda (plus-input?4_0 who6_0 path7_0 mode18_0 mode29_0)
       (begin
         (begin
           (if (path-string? path7_0)
             (void)
             (raise-argument-error who6_0 "path-string?" path7_0))
           (let ((host-path_0
                  (->host
                   path7_0
                   who6_0
                   (let ((app_0
                          (if (let ((or-part_0
                                     (mode?_0 mode18_0 mode29_0 'replace)))
                                (if or-part_0
                                  or-part_0
                                  (mode?_0
                                   mode18_0
                                   mode29_0
                                   'truncate/replace)))
                            '(delete)
                            '())))
                     (append
                      '(write)
                      app_0
                      (if (let ((or-part_0
                                 (mode?_0 mode18_0 mode29_0 'append)))
                            (if or-part_0
                              or-part_0
                              (let ((or-part_1
                                     (mode?_0 mode18_0 mode29_0 'update)))
                                (if or-part_1
                                  or-part_1
                                  (mode?_0 mode18_0 mode29_0 'must-update)))))
                        '(read)
                        '()))))))
             (begin
               (unsafe-start-atomic)
               (begin
                 (check-current-custodian who6_0)
                 (let ((flags_0
                        (let ((app_0 (if plus-input?4_0 1 0)))
                          (let ((app_1 (mode->flags_0 mode18_0)))
                            (+ 2 app_0 app_1 (mode->flags_0 mode29_0))))))
                   (let ((fd0_0
                          (|#%app|
                           rktio_open
                           (unsafe-place-local-ref cell.1)
                           host-path_0
                           flags_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
                                            mode18_0
                                            mode29_0
                                            'replace)))
                                      (if or-part_0
                                        or-part_0
                                        (mode?_0
                                         mode18_0
                                         mode29_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
                                     (unsafe-place-local-ref cell.1)
                                     host-path_0
                                     flags_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 1/open-output-file
  (let ((open-output-file_0
         (|#%name|
          open-output-file
          (lambda (path13_0 mode111_0 mode212_0)
            (begin
              (let ((mode1_0
                     (if (eq? mode111_0 unsafe-undefined) none$1 mode111_0)))
                (let ((mode2_0
                       (if (eq? mode212_0 unsafe-undefined) none$1 mode212_0)))
                  (do-open-output-file.1
                   #f
                   'open-output-file
                   path13_0
                   mode1_0
                   mode2_0))))))))
    (|#%name|
     open-output-file
     (case-lambda
      ((path_0)
       (begin (open-output-file_0 path_0 unsafe-undefined unsafe-undefined)))
      ((path_0 mode1_0 mode212_0)
       (open-output-file_0 path_0 mode1_0 mode212_0))
      ((path_0 mode111_0)
       (open-output-file_0 path_0 mode111_0 unsafe-undefined))))))
(define 1/open-input-output-file
  (let ((open-input-output-file_0
         (|#%name|
          open-input-output-file
          (lambda (path16_0 mode114_0 mode215_0)
            (begin
              (let ((mode1_0
                     (if (eq? mode114_0 unsafe-undefined) none$1 mode114_0)))
                (let ((mode2_0
                       (if (eq? mode215_0 unsafe-undefined) none$1 mode215_0)))
                  (do-open-output-file.1
                   #t
                   'open-input-output-file
                   path16_0
                   mode1_0
                   mode2_0))))))))
    (|#%name|
     open-input-output-file
     (case-lambda
      ((path_0)
       (begin
         (open-input-output-file_0 path_0 unsafe-undefined unsafe-undefined)))
      ((path_0 mode1_0 mode215_0)
       (open-input-output-file_0 path_0 mode1_0 mode215_0))
      ((path_0 mode114_0)
       (open-input-output-file_0 path_0 mode114_0 unsafe-undefined))))))
(define 1/call-with-input-file
  (let ((call-with-input-file_0
         (|#%name|
          call-with-input-file
          (lambda (path18_0 proc19_0 mode17_0)
            (begin
              (let ((mode_0
                     (if (eq? mode17_0 unsafe-undefined) none$1 mode17_0)))
                (begin
                  (if (path-string? path18_0)
                    (void)
                    (raise-argument-error
                     'call-with-input-file
                     "path-string?"
                     path18_0))
                  (begin
                    (if (if (procedure? proc19_0)
                          (procedure-arity-includes? proc19_0 1)
                          #f)
                      (void)
                      (raise-argument-error
                       'call-with-input-file
                       "(procedure-arity-includes/c 1)"
                       proc19_0))
                    (let ((i_0 (1/open-input-file path18_0 mode_0)))
                      (begin0
                        (|#%app| proc19_0 i_0)
                        (1/close-input-port i_0)))))))))))
    (|#%name|
     call-with-input-file
     (case-lambda
      ((path_0 proc_0)
       (begin (call-with-input-file_0 path_0 proc_0 unsafe-undefined)))
      ((path_0 proc_0 mode17_0)
       (call-with-input-file_0 path_0 proc_0 mode17_0))))))
(define 1/call-with-output-file
  (let ((call-with-output-file_0
         (|#%name|
          call-with-output-file
          (lambda (path22_0 proc23_0 mode120_0 mode221_0)
            (begin
              (let ((mode1_0
                     (if (eq? mode120_0 unsafe-undefined) none$1 mode120_0)))
                (let ((mode2_0
                       (if (eq? mode221_0 unsafe-undefined) none$1 mode221_0)))
                  (begin
                    (if (path-string? path22_0)
                      (void)
                      (raise-argument-error
                       'call-with-output-file
                       "path-string?"
                       path22_0))
                    (begin
                      (if (if (procedure? proc23_0)
                            (procedure-arity-includes? proc23_0 1)
                            #f)
                        (void)
                        (raise-argument-error
                         'call-with-output-file
                         "(procedure-arity-includes/c 1)"
                         proc23_0))
                      (let ((o_0
                             (1/open-output-file path22_0 mode1_0 mode2_0)))
                        (begin0
                          (|#%app| proc23_0 o_0)
                          (1/close-output-port o_0))))))))))))
    (|#%name|
     call-with-output-file
     (case-lambda
      ((path_0 proc_0)
       (begin
         (call-with-output-file_0
          path_0
          proc_0
          unsafe-undefined
          unsafe-undefined)))
      ((path_0 proc_0 mode1_0 mode221_0)
       (call-with-output-file_0 path_0 proc_0 mode1_0 mode221_0))
      ((path_0 proc_0 mode120_0)
       (call-with-output-file_0 path_0 proc_0 mode120_0 unsafe-undefined))))))
(define 1/with-input-from-file
  (let ((with-input-from-file_0
         (|#%name|
          with-input-from-file
          (lambda (path25_0 proc26_0 mode24_0)
            (begin
              (let ((mode_0
                     (if (eq? mode24_0 unsafe-undefined) none$1 mode24_0)))
                (begin
                  (if (path-string? path25_0)
                    (void)
                    (raise-argument-error
                     'with-input-from-file
                     "path-string?"
                     path25_0))
                  (begin
                    (if (if (procedure? proc26_0)
                          (procedure-arity-includes? proc26_0 0)
                          #f)
                      (void)
                      (raise-argument-error
                       'with-input-from-file
                       "(procedure-arity-includes/c 0)"
                       proc26_0))
                    (let ((i_0 (1/open-input-file path25_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
                        proc26_0
                        (lambda () (1/close-input-port i_0)))))))))))))
    (|#%name|
     with-input-from-file
     (case-lambda
      ((path_0 proc_0)
       (begin (with-input-from-file_0 path_0 proc_0 unsafe-undefined)))
      ((path_0 proc_0 mode24_0)
       (with-input-from-file_0 path_0 proc_0 mode24_0))))))
(define 1/with-output-to-file
  (let ((with-output-to-file_0
         (|#%name|
          with-output-to-file
          (lambda (path29_0 proc30_0 mode127_0 mode228_0)
            (begin
              (let ((mode1_0
                     (if (eq? mode127_0 unsafe-undefined) none$1 mode127_0)))
                (let ((mode2_0
                       (if (eq? mode228_0 unsafe-undefined) none$1 mode228_0)))
                  (begin
                    (if (path-string? path29_0)
                      (void)
                      (raise-argument-error
                       'with-output-to-file
                       "path-string?"
                       path29_0))
                    (begin
                      (if (if (procedure? proc30_0)
                            (procedure-arity-includes? proc30_0 0)
                            #f)
                        (void)
                        (raise-argument-error
                         'with-output-to-file
                         "(procedure-arity-includes/c 0)"
                         proc30_0))
                      (let ((o_0
                             (1/open-output-file path29_0 mode1_0 mode2_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
                          proc30_0
                          (lambda () (1/close-output-port o_0))))))))))))))
    (|#%name|
     with-output-to-file
     (case-lambda
      ((path_0 proc_0)
       (begin
         (with-output-to-file_0
          path_0
          proc_0
          unsafe-undefined
          unsafe-undefined)))
      ((path_0 proc_0 mode1_0 mode228_0)
       (with-output-to-file_0 path_0 proc_0 mode1_0 mode228_0))
      ((path_0 proc_0 mode127_0)
       (with-output-to-file_0 path_0 proc_0 mode127_0 unsafe-undefined))))))
(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)
     (begin
       (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")))
                      (format app_0 (host-> host-path1_0)))
                    (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
       (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 1/port-try-file-lock?
  (|#%name|
   port-try-file-lock?
   (lambda (p_0 mode_0)
     (begin
       (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
                                         (format-rktio-message
                                          'port-try-file-lock?
                                          r_0
                                          base-msg_0)))
                                    (|#%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
       (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
                                 (format-rktio-message
                                  'port-file-unlock
                                  r_0
                                  base-msg_0)))
                            (|#%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)
                      (begin
                        (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)
     (begin
       (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
         (letrec ((procz1
                   (case-lambda
                    ((self_0) (temp9.1 self_0))
                    ((self_0 mode_0) (temp9.1 self_0 mode_0))))
                  (called!_0
                   (|#%name|
                    called!
                    (lambda (called?_0)
                      (begin
                        (begin
                          (if (unsafe-unbox* called?_0)
                            (raise-arguments-error
                             'read-special
                             "cannot be called a second time")
                            (void))
                          (unsafe-set-box*! called?_0 #t))))))
                  (check-read-result_0
                   (|#%name|
                    check-read-result
                    (lambda (input-pipe_0
                             user-peek-in9_0
                             ok-false?13_0
                             peek?12_0
                             who16_0
                             r17_0
                             dest-start18_0
                             dest-end19_0)
                      (begin
                        (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)
                                (unsafe-set-box*! 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
                                       (let ((app_0
                                              (if (if peek?12_0
                                                    ok-false?13_0
                                                    #f)
                                                " #f"
                                                "")))
                                         (string-append
                                          "(or/c exact-nonnegative-integer? eof-object? evt? pipe-input-port?"
                                          app_0
                                          (if user-peek-in9_0
                                            " (procedure-arity-includes/c 4)"
                                            "")
                                          ")"))
                                       r17_0))))))))))))
                  (protect-in_0
                   (|#%name|
                    protect-in
                    (lambda (dest-bstr_0
                             dest-start_0
                             dest-end_0
                             copy?_0
                             user-read-in_0)
                      (begin
                        (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 len_0)
                                   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))))))))))
                  (wrap-check-read-evt-result_0
                   (|#%name|
                    wrap-check-read-evt-result
                    (lambda (input-pipe_0
                             user-peek-in9_0
                             who_0
                             evt_0
                             dest-start_0
                             dest-end_0
                             peek?_0
                             ok-false?_0)
                      (begin
                        (wrap-evt
                         evt_0
                         (lambda (r_0)
                           (begin
                             (unsafe-start-atomic)
                             (check-read-result_0
                              input-pipe_0
                              user-peek-in9_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
                                  input-pipe_0
                                  user-peek-in9_0
                                  who_0
                                  r_0
                                  dest-start_0
                                  dest-end_0
                                  peek?_0
                                  ok-false?_0)
                                 r_0)))))))))
                  (wrap-procedure-result_0
                   (|#%name|
                    wrap-procedure-result
                    (lambda (r_0)
                      (begin
                        (let ((called?_0 (box #f)))
                          (let ((four-args_0
                                 (|#%name|
                                  four-args
                                  (lambda (a_0 b_0 c_0 d_0)
                                    (begin
                                      (begin
                                        (called!_0 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 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))))))))
           (|#%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
                (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 (box #f)))
                                            (letrec*
                                             ((read-in_0
                                               (|#%name|
                                                read-in
                                                (lambda (self_0
                                                         dest-bstr_0
                                                         dest-start_0
                                                         dest-end_0
                                                         copy?_0)
                                                  (begin
                                                    (if (unsafe-unbox*
                                                         input-pipe_0)
                                                      (if (zero?
                                                           (1/pipe-content-length
                                                            (unsafe-unbox*
                                                             input-pipe_0)))
                                                        (begin
                                                          (unsafe-set-box*!
                                                           input-pipe_0
                                                           #f)
                                                          (read-in_0
                                                           self_0
                                                           dest-bstr_0
                                                           dest-start_0
                                                           dest-end_0
                                                           copy?_0))
                                                        (let ((o_0
                                                               (unsafe-unbox*
                                                                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
                                                           input-pipe_0
                                                           user-peek-in9_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
                                                               input-pipe_0
                                                               user-peek-in9_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)))))))))))
                                             (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)
                                                   (begin
                                                     (if (unsafe-unbox*
                                                          input-pipe_0)
                                                       (if (<=
                                                            (1/pipe-content-length
                                                             (unsafe-unbox*
                                                              input-pipe_0))
                                                            skip-k_0)
                                                         (begin
                                                           (unsafe-set-box*!
                                                            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
                                                                (unsafe-unbox*
                                                                 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
                                                            input-pipe_0
                                                            user-peek-in9_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
                                                                input-pipe_0
                                                                user-peek-in9_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)
                                                        (begin
                                                          (if (if (unsafe-unbox*
                                                                   input-pipe_0)
                                                                (positive?
                                                                 (1/pipe-content-length
                                                                  (unsafe-unbox*
                                                                   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
                                                            (begin
                                                              (unsafe-end-atomic)
                                                              (|#%app|
                                                               user-close10_0)
                                                              (unsafe-start-atomic)))))))
                                                  (let ((get-progress-evt_0
                                                         (|#%name|
                                                          get-progress-evt
                                                          (lambda (self_0)
                                                            (begin
                                                              (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)
                                                              (begin
                                                                (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
                                                                      (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))
                                                           (case-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
                                                                  (create-core-input-port
                                                                   (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)))
                                                                         (let ((app_3
                                                                                (if (1/input-port?
                                                                                     user-peek-in9_0)
                                                                                  user-peek-in9_0
                                                                                  byte-ready_0)))
                                                                           (let ((app_4
                                                                                  (if user-get-progress-evt1_0
                                                                                    get-progress-evt_0
                                                                                    #f)))
                                                                             (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
                                                                              app_3
                                                                              app_4
                                                                              (if user-commit2_0
                                                                                commit_0
                                                                                #f)))))))
                                                                   name7_0
                                                                   (direct2.1
                                                                    #f
                                                                    0
                                                                    0)
                                                                   #f
                                                                   #f
                                                                   init-offset_0
                                                                   #f
                                                                   #f
                                                                   #f)
                                                                  (let ((app_0
                                                                         (let ((app_0
                                                                                (if buffer-mode_0
                                                                                  buffer-mode_0
                                                                                  procz1)))
                                                                           (let ((app_1
                                                                                  (core-input-port-methods-prepare-change.1
                                                                                   peek-via-read-input-port-vtable.1)))
                                                                             (let ((app_2
                                                                                    (core-input-port-methods-read-in.1
                                                                                     peek-via-read-input-port-vtable.1)))
                                                                               (let ((app_3
                                                                                      (core-input-port-methods-peek-in.1
                                                                                       peek-via-read-input-port-vtable.1)))
                                                                                 (let ((app_4
                                                                                        (core-input-port-methods-byte-ready.1
                                                                                         peek-via-read-input-port-vtable.1)))
                                                                                   (let ((app_5
                                                                                          (core-input-port-methods-get-progress-evt.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
                                                                                      app_0
                                                                                      app_1
                                                                                      app_2
                                                                                      app_3
                                                                                      app_4
                                                                                      app_5
                                                                                      (core-input-port-methods-commit.1
                                                                                       peek-via-read-input-port-vtable.1)
                                                                                      read-in_0)))))))))
                                                                    (create-peek-via-read-input-port
                                                                     app_0
                                                                     name7_0
                                                                     (direct2.1
                                                                      #f
                                                                      0
                                                                      0)
                                                                     #f
                                                                     #f
                                                                     init-offset_0
                                                                     #f
                                                                     #f
                                                                     #f
                                                                     #f
                                                                     #f
                                                                     (make-bytes
                                                                      4096)
                                                                     0
                                                                     0
                                                                     #f
                                                                     'block))))))
                                                            (args
                                                             (raise-binding-result-arity-error
                                                              2
                                                              args))))))))))))))))))))))))))))))))
    (|#%name|
     make-input-port
     (case-lambda
      ((name_0 user-read-in_0 user-peek-in_0 user-close_0)
       (begin
         (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
         (letrec ((check-write-result_0
                   (|#%name|
                    check-write-result
                    (lambda (output-pipe_0
                             as-evt?13_0
                             who15_0
                             r16_0
                             start17_0
                             end18_0
                             non-block/buffer?19_0)
                      (begin
                        (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))
                                (unsafe-set-box*! 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))))))))))
                  (wrap-check-write-evt-result_0
                   (|#%name|
                    wrap-check-write-evt-result
                    (lambda (output-pipe_0
                             who_0
                             evt_0
                             start_0
                             end_0
                             non-block/buffer?_0)
                      (begin
                        (wrap-evt
                         evt_0
                         (lambda (r_0)
                           (begin
                             (unsafe-start-atomic)
                             (check-write-result_0
                              output-pipe_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
                                  output-pipe_0
                                  who_0
                                  r_0
                                  start_0
                                  end_0
                                  non-block/buffer?_0)
                                 r_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
                (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 (box #f)))
                                            (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)
                                                  (begin
                                                    (if (unsafe-unbox*
                                                         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
                                                                  (unsafe-unbox*
                                                                   output-pipe_0))))))
                                                        (begin
                                                          (unsafe-set-box*!
                                                           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
                                                               (unsafe-unbox*
                                                                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)))
                                                       (case-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
                                                              output-pipe_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
                                                                  output-pipe_0
                                                                  '|user port write|
                                                                  r_0
                                                                  imm-start_0
                                                                  imm-end_0
                                                                  non-block/buffer?_0)
                                                                 r_0)))))
                                                        (args
                                                         (raise-binding-result-arity-error
                                                          3
                                                          args))))))))))
                                             (let ((get-write-evt_0
                                                    (|#%name|
                                                     get-write-evt
                                                     (lambda (self_0
                                                              bstr_0
                                                              start_0
                                                              end_0)
                                                       (begin
                                                         (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)))))
                                                          (case-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
                                                                   output-pipe_0
                                                                   '|user port write-evt|
                                                                   r_0
                                                                   imm-start_0
                                                                   imm-end_0
                                                                   #t)))))
                                                           (args
                                                            (raise-binding-result-arity-error
                                                             3
                                                             args)))))))))
                                               (let ((write-out-special_0
                                                      (|#%name|
                                                       write-out-special
                                                       (lambda (self_0
                                                                v_0
                                                                non-block/buffer?_0
                                                                enable-break?_0)
                                                         (begin
                                                           (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
                                                                 (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))
                                                      (case-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
                                                                      (begin
                                                                        (unsafe-end-atomic)
                                                                        (|#%app|
                                                                         user-close11_0)
                                                                        (unsafe-start-atomic)))))))
                                                            (finish-port/count
                                                             (create-core-output-port
                                                              (let ((app_0
                                                                     (if (1/output-port?
                                                                          user-write-out10_0)
                                                                       user-write-out10_0
                                                                       write-out_0)))
                                                                (let ((app_1
                                                                       (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))))
                                                                  (let ((app_2
                                                                         (if user-get-write-evt2_0
                                                                           get-write-evt_0
                                                                           #f)))
                                                                    (core-output-port-methods6.1
                                                                     close_0
                                                                     count-lines!_0
                                                                     get-location_0
                                                                     file-position_0
                                                                     buffer-mode_0
                                                                     app_0
                                                                     app_1
                                                                     app_2
                                                                     (if user-get-write-special-evt3_0
                                                                       (lambda (self_0
                                                                                v_0)
                                                                         (|#%app|
                                                                          user-get-write-special-evt3_0
                                                                          v_0))
                                                                       #f)))))
                                                              name8_0
                                                              (direct2.1
                                                               #f
                                                               0
                                                               0)
                                                              #f
                                                              #f
                                                              init-offset_0
                                                              #f
                                                              evt9_0
                                                              #f
                                                              #f
                                                              #f)))))
                                                       (args
                                                        (raise-binding-result-arity-error
                                                         2
                                                         args)))))))))))))))))))))))))))))
    (|#%name|
     make-output-port
     (case-lambda
      ((name_0 evt_0 user-write-out_0 user-close_0)
       (begin
         (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
       (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
       (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
       (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
   (letrec ((.../io/port/handler.rkt:118:49_0
             (|#%name|
              .../io/port/handler.rkt:118:49
              (lambda (h_0 v27_0 o28_0 w26_0)
                (begin (|#%app| h_0 v27_0 o28_0))))))
     (case-lambda
      ((o_0)
       (begin
         (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
                (|#%name|
                 .../io/port/handler.rkt:118:49
                 (case-lambda
                  ((v_0 o_2)
                   (begin (.../io/port/handler.rkt:118:49_0 h_0 v_0 o_2 #f)))
                  ((v_0 o_2 w26_0)
                   (.../io/port/handler.rkt:118:49_0
                    h_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
              (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 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)
            (begin
              (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))))))))
    (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
   default-global-port-print-handler
   (letrec ((.../io/port/handler.rkt:145:24_0
             (|#%name|
              .../io/port/handler.rkt:145:24
              (lambda (p_0 v35_0 o36_0 quote-depth34_0)
                (begin (|#%app| p_0 v35_0 o36_0))))))
     (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
           (|#%name|
            .../io/port/handler.rkt:145:24
            (case-lambda
             ((v_0 o_0)
              (begin (.../io/port/handler.rkt:145:24_0 p_0 v_0 o_0 0)))
             ((v_0 o_0 quote-depth34_0)
              (.../io/port/handler.rkt:145:24_0
               p_0
               v_0
               o_0
               quote-depth34_0))))))))
   'global-port-print-handler))
(define effect2918
  (begin
    (void
     (install-do-global-print!
      1/global-port-print-handler
      default-global-port-print-handler))
    (void)))
(define 1/byte-ready?
  (let ((byte-ready?_0
         (|#%name|
          byte-ready?
          (lambda (in1_0)
            (begin
              (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)
                        (begin
                          (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)
                                        (eq? #t r_0)))))))))))))
                   (loop_0
                    (->core-input-port.1 unsafe-undefined in_0 #f))))))))))
    (|#%name|
     byte-ready?
     (case-lambda
      (() (begin (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)
            (begin
              (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)
                                  (begin
                                    (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))
                                       (case-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))
                                        (args
                                         (raise-binding-result-arity-error
                                          3
                                          args))))
                                      #f))))))
                             (loop_0 0 #f)))))
                      #f)))))))))
    (|#%name|
     char-ready?
     (case-lambda
      (() (begin (char-ready?_0 unsafe-undefined)))
      ((in2_0) (char-ready?_0 in2_0))))))
(define 1/split-path
  (|#%name|
   split-path
   (lambda (p_0)
     (begin
       (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
       (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)
     (begin
       (if (not (eq? (|#%app| path-convention p3_0) 'windows))
         (split-after-drive.1 0 0 explode?1_0 unsafe-undefined #f #f #f p3_0)
         (let ((bstr_0 (|#%app| 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))
              (case-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)))))
               (args (raise-binding-result-arity-error 3 args))))
             (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)
     (begin
       (let ((keep-drive-end_0
              (if (eq? keep-drive-end7_0 unsafe-undefined)
                drive-end6_0
                keep-drive-end7_0)))
         (let ((convention_0 (|#%app| path-convention p19_0)))
           (let ((bstr_0
                  (if len5_0
                    (|#%app| path-bytes p19_0)
                    (let ((temp61_0 (|#%app| 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)
                        (begin
                          (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)))
                (case-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))
                       (case-lambda
                        ((name_0 is-dir?_0)
                         (if explode?11_0
                           (list name_0)
                           (values 'relative name_0 is-dir?_0)))
                        (args (raise-binding-result-arity-error 2 args)))))
                    (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)))
                     (case-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))))
                          (case-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))))
                           (args (raise-binding-result-arity-error 2 args))))))
                      (args (raise-binding-result-arity-error 2 args))))))
                 (args (raise-binding-result-arity-error 2 args))))))))))))
(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)
     (begin
       (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))
     (case-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))
      (args (raise-binding-result-arity-error 5 args))))))
(define parse-//-drive (lambda (bstr_0) (parse-unc.1 #f #f bstr_0 0)))
(define split-reld.1
  (letrec ((explode-loop_0
            (|#%name|
             explode-loop
             (lambda (explode?30_0 bstr_0)
               (begin
                 (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))))
                  (case-lambda
                   ((len_0 is-dir?_0)
                    (call-with-values
                     (lambda ()
                       (backslash-backslash-questionmark-dot-ups-end
                        bstr_0
                        len_0))
                     (case-lambda
                      ((dots-end_0 literal-start_0)
                       (if (< literal-start_0 len_0)
                         (letrec*
                          ((loop_1
                            (|#%name|
                             loop
                             (lambda (p_0)
                               (begin
                                 (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
                                                 explode?30_0
                                                 base-bstr_0))
                                               (values
                                                (path1.1 base-bstr_0 'windows)
                                                elem_0
                                                is-dir?_0))))))
                                     (loop_1 (sub1 p_0)))))))))
                          (loop_1 (sub1 len_0)))
                         (if explode?30_0
                           (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)))))
                      (args (raise-binding-result-arity-error 2 args)))))
                   (args (raise-binding-result-arity-error 2 args))))))))
           (loop_0
            (|#%name|
             loop
             (lambda (dots-end_0)
               (begin
                 (if (> dots-end_0 9)
                   (cons 'up (loop_0 (- dots-end_0 3)))
                   '()))))))
    (|#%name|
     split-reld
     (lambda (explode?30_0 bstr32_0)
       (begin (explode-loop_0 explode?30_0 bstr32_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 ()
                  (begin (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/path->directory-path
  (|#%name|
   path->directory-path
   (lambda (p-in_0)
     (begin
       (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 (|#%app| path-convention p_0)))
               (if (eq? tmp_0 'unix)
                 (path1.1 (bytes-append (|#%app| path-bytes p_0) #vu8(47)) 'unix)
                 (if (eq? tmp_0 'windows)
                   (path1.1
                    (bytes-append (|#%app| path-bytes p_0) #vu8(92))
                    'windows)
                   (void)))))))))))
(define directory-path?.1
  (letrec ((unixish-path-directory-path?_0
            (|#%name|
             unixish-path-directory-path?
             (lambda (bstr_0 convention_0 len_0 require-sep?1_0)
               (begin
                 (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))))))))
    (|#%name|
     directory-path?
     (lambda (require-sep?1_0 p3_0)
       (begin
         (let ((bstr_0 (|#%app| path-bytes p3_0)))
           (let ((len_0 (unsafe-bytes-length bstr_0)))
             (let ((convention_0 (|#%app| path-convention p3_0)))
               (if (eq? convention_0 'unix)
                 (unixish-path-directory-path?_0
                  bstr_0
                  convention_0
                  len_0
                  require-sep?1_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))
                               (case-lambda
                                ((dots-end_0 literal-start_0) dots-end_0)
                                (args
                                 (raise-binding-result-arity-error 2 args)))))
                             #f)
                           #f)))
                     (unixish-path-directory-path?_0
                      bstr_0
                      convention_0
                      len_0
                      require-sep?1_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)
                       (begin
                         (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 1/directory-exists?
  (|#%name|
   directory-exists?
   (lambda (p_0)
     (begin
       (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
       (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
       (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
              (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) (begin (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
  (|#%name|
   make-directory
   (lambda (p_0)
     (begin
       (begin
         (if (path-string? p_0)
           (void)
           (raise-argument-error 'make-directory "path-string?" p_0))
         (let ((host-path_0 (->host p_0 'make-directory '(write))))
           (let ((r_0
                  (|#%app|
                   rktio_make_directory
                   (unsafe-place-local-ref cell.1)
                   host-path_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)))))))))
(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
         (letrec ((procz1
                   (lambda (dl_0)
                     (|#%app|
                      rktio_directory_list_stop
                      (unsafe-place-local-ref cell.1)
                      dl_0))))
           (|#%name|
            directory-list
            (lambda (p3_0)
              (begin
                (let ((p_0
                       (if (eq? p3_0 unsafe-undefined)
                         (current-directory$1)
                         p3_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)
                             procz1
                             (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
                                           (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
      (() (begin (directory-list_0 unsafe-undefined)))
      ((p3_0) (directory-list_0 p3_0))))))
(define 1/delete-file
  (|#%name|
   delete-file
   (lambda (p_0)
     (begin
       (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
       (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 (old5_0 new6_0 exists-ok?4_0)
            (begin
              (begin
                (if (path-string? old5_0)
                  (void)
                  (raise-argument-error
                   'rename-file-or-directory
                   "path-string?"
                   old5_0))
                (begin
                  (if (path-string? new6_0)
                    (void)
                    (raise-argument-error
                     'rename-file-or-directory
                     "path-string?"
                     new6_0))
                  (let ((host-old_0
                         (->host old5_0 'rename-file-or-directory '(read))))
                    (let ((host-new_0
                           (->host new6_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?4_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) (begin (rename-file-or-directory_0 old_0 new_0 #f)))
      ((old_0 new_0 exists-ok?4_0)
       (rename-file-or-directory_0 old_0 new_0 exists-ok?4_0))))))
(define 1/file-or-directory-modify-seconds
  (|#%name|
   file-or-directory-modify-seconds
   (case-lambda
    ((p_0)
     (begin
       (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 (exact-integer? secs_0)
         (void)
         (raise-argument-error
          'file-or-directory-modify-seconds
          "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")))
                       (let ((app_1 (if secs_0 "setting" "getting")))
                         (1/format app_0 app_1 (host-> host-path_0))))))
                  r_0)))))))))
(define 1/file-or-directory-permissions
  (let ((file-or-directory-permissions_0
         (letrec ((set?_0
                   (|#%name|
                    set?
                    (lambda (r_0 n_0)
                      (begin (eqv? n_0 (bitwise-and r_0 n_0)))))))
           (|#%name|
            file-or-directory-permissions
            (lambda (p8_0 mode7_0)
              (begin
                (begin
                  (if (path-string? p8_0)
                    (void)
                    (raise-argument-error
                     'file-or-directory-permissions
                     "path-string?"
                     p8_0))
                  (begin
                    (if (let ((or-part_0 (not mode7_0)))
                          (if or-part_0
                            or-part_0
                            (let ((or-part_1 (eq? mode7_0 'bits)))
                              (if or-part_1
                                or-part_1
                                (if (exact-integer? mode7_0)
                                  (<= 0 mode7_0 65535)
                                  #f)))))
                      (void)
                      (raise-argument-error
                       'file-or-directory-permissions
                       "(or/c #f 'bits (integer-in 0 65535))"
                       mode7_0))
                    (let ((host-path_0
                           (->host
                            p8_0
                            'file-or-directory-permissions
                            (if (integer? mode7_0) '(write) '(read)))))
                      (let ((r_0
                             (if (integer? mode7_0)
                               (|#%app|
                                rktio_set_file_or_directory_permissions
                                (unsafe-place-local-ref cell.1)
                                host-path_0
                                mode7_0)
                               (|#%app|
                                rktio_get_file_or_directory_permissions
                                (unsafe-place-local-ref cell.1)
                                host-path_0
                                (eq? mode7_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 (integer? mode7_0)
                                        "update"
                                        "access")))
                                 (let ((app_2
                                        (if (racket-error? r_0 4)
                                          ";\n unsupported bit combination"
                                          "")))
                                   (let ((app_3 (host-> host-path_0)))
                                     (1/format
                                      app_0
                                      app_1
                                      app_2
                                      app_3
                                      (if (racket-error? r_0 4)
                                        (1/format
                                         "\n  permission value: ~a"
                                         mode7_0)
                                        "")))))))
                            (void))
                          (if (integer? mode7_0)
                            (void)
                            (if (eq? 'bits mode7_0)
                              r_0
                              (let ((l_0
                                     (if (set?_0 r_0 4) (cons 'read '()) '())))
                                (let ((l_1
                                       (if (set?_0 r_0 2)
                                         (cons 'write l_0)
                                         l_0)))
                                  (let ((l_2
                                         (if (set?_0 r_0 1)
                                           (cons 'execute l_1)
                                           l_1)))
                                    l_2))))))))))))))))
    (|#%name|
     file-or-directory-permissions
     (case-lambda
      ((p_0) (begin (file-or-directory-permissions_0 p_0 #f)))
      ((p_0 mode7_0) (file-or-directory-permissions_0 p_0 mode7_0))))))
(define 1/file-or-directory-identity
  (let ((file-or-directory-identity_0
         (|#%name|
          file-or-directory-identity
          (lambda (p10_0 as-link?9_0)
            (begin
              (begin
                (if (path-string? p10_0)
                  (void)
                  (raise-argument-error
                   'file-or-directory-identity
                   "path-string?"
                   p10_0))
                (let ((host-path_0
                       (->host p10_0 'file-or-directory-identity '(exists))))
                  (begin
                    (unsafe-start-atomic)
                    (path-or-fd-identity.1
                     as-link?9_0
                     #f
                     host-path_0
                     #f
                     #f
                     'file-or-directory-identity)))))))))
    (|#%name|
     file-or-directory-identity
     (case-lambda
      ((p_0) (begin (file-or-directory-identity_0 p_0 #f)))
      ((p_0 as-link?9_0) (file-or-directory-identity_0 p_0 as-link?9_0))))))
(define 1/file-size
  (|#%name|
   file-size
   (lambda (p_0)
     (begin
       (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
         (letrec ((report-error_0
                   (|#%name|
                    report-error
                    (lambda (dest-host_0 src-host_0 r_0)
                      (begin
                        (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)))))))))))
           (|#%name|
            copy-file
            (lambda (src12_0 dest13_0 exists-ok?11_0)
              (begin
                (begin
                  (if (path-string? src12_0)
                    (void)
                    (raise-argument-error 'copy-file "path-string?" src12_0))
                  (begin
                    (if (path-string? dest13_0)
                      (void)
                      (raise-argument-error
                       'copy-file
                       "path-string?"
                       dest13_0))
                    (let ((src-host_0 (->host src12_0 'copy-file '(read))))
                      (let ((dest-host_0
                             (->host dest13_0 'copy-file '(write delete))))
                        (begin
                          (unsafe-start-atomic)
                          (let ((cp_0
                                 (|#%app|
                                  rktio_copy_file_start
                                  (unsafe-place-local-ref cell.1)
                                  dest-host_0
                                  src-host_0
                                  exists-ok?11_0)))
                            (if (vector? cp_0)
                              (begin
                                (unsafe-end-atomic)
                                (report-error_0 dest-host_0 src-host_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 ()
                                           (begin
                                             (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
                                                    dest-host_0
                                                    src-host_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
                                                      dest-host_0
                                                      src-host_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) (begin (copy-file_0 src_0 dest_0 #f)))
      ((src_0 dest_0 exists-ok?11_0)
       (copy-file_0 src_0 dest_0 exists-ok?11_0))))))
(define 1/make-file-or-directory-link
  (|#%name|
   make-file-or-directory-link
   (lambda (to_0 path_0)
     (begin
       (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) (begin (do-resolve-path p_0 'resolve-path)))))
(define 1/expand-user-path
  (|#%name|
   expand-user-path
   (lambda (p_0)
     (begin
       (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 (|#%app| 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
       (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
                  (begin
                    (letrec*
                     ((for-loop_0
                       (|#%name|
                        for-loop
                        (lambda (fold-var_0 lst_0)
                          (begin
                            (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
         (letrec ((combine_0
                   (|#%name|
                    combine
                    (lambda (base_0 accum_0)
                      (begin
                        (if (null? accum_0)
                          base_0
                          (apply 1/build-path base_0 (1/reverse accum_0)))))))
                  (loop_0
                   (|#%name|
                    loop
                    (lambda (l_0 accum_0)
                      (begin
                        (if (null? l_0)
                          (1/reverse accum_0)
                          (if (eq? 'same (car l_0))
                            (loop_0 (cdr l_0) accum_0)
                            (if (eq? 'up (car l_0))
                              (if (pair? accum_0)
                                (let ((app_0 (cdr l_0)))
                                  (loop_0 app_0 (cdr accum_0)))
                                (cons 'up (loop_0 (cdr l_0) null)))
                              (let ((app_0 (cdr l_0)))
                                (loop_0 app_0 (cons (car l_0) accum_0))))))))))
                  (loop_1
                   (|#%name|
                    loop
                    (lambda (l_0 base_0 accum_0 seen_0)
                      (begin
                        (if (null? l_0)
                          (combine_0 base_0 accum_0)
                          (if (eq? 'same (car l_0))
                            (loop_1 (cdr l_0) base_0 accum_0 seen_0)
                            (if (eq? 'up (car l_0))
                              (let ((new-base_0 (combine_0 base_0 accum_0)))
                                (let ((target_0
                                       (do-resolve-path
                                        new-base_0
                                        'simplify-path)))
                                  (call-with-values
                                   (lambda ()
                                     (if (eq? target_0 new-base_0)
                                       (values new-base_0 seen_0)
                                       (let ((from-base_0
                                              (if (1/complete-path? target_0)
                                                target_0
                                                (call-with-values
                                                 (lambda ()
                                                   (1/split-path new-base_0))
                                                 (case-lambda
                                                  ((base-dir_0 name_0 dir?_0)
                                                   (path->complete-path.1
                                                    #t
                                                    target_0
                                                    base-dir_0))
                                                  (args
                                                   (raise-binding-result-arity-error
                                                    3
                                                    args)))))))
                                         (begin
                                           (if (hash-ref seen_0 from-base_0 #f)
                                             (raise
                                              (let ((app_0
                                                     (let ((app_0
                                                            (symbol->string
                                                             'simplify-path)))
                                                       (string-append
                                                        app_0
                                                        ": cycle detected at link"
                                                        "\n  link path: "
                                                        (path->string
                                                         new-base_0)))))
                                                (|#%app|
                                                 exn:fail:filesystem
                                                 app_0
                                                 (current-continuation-marks))))
                                             (void))
                                           (values
                                            from-base_0
                                            (hash-set
                                             seen_0
                                             from-base_0
                                             #t))))))
                                   (case-lambda
                                    ((from-base_0 new-seen_0)
                                     (call-with-values
                                      (lambda () (1/split-path from-base_0))
                                      (case-lambda
                                       ((next-base_0 name_0 dir?_0)
                                        (if (not next-base_0)
                                          (loop_1
                                           (cdr l_0)
                                           from-base_0
                                           '()
                                           new-seen_0)
                                          (loop_1
                                           (cdr l_0)
                                           next-base_0
                                           '()
                                           new-seen_0)))
                                       (args
                                        (raise-binding-result-arity-error
                                         3
                                         args)))))
                                    (args
                                     (raise-binding-result-arity-error
                                      2
                                      args))))))
                              (let ((app_0 (cdr l_0)))
                                (loop_1
                                 app_0
                                 base_0
                                 (cons (car l_0) accum_0)
                                 seen_0))))))))))
           (|#%name|
            simplify-path
            (lambda (p-in2_0 use-filesystem?1_0)
              (begin
                (begin
                  (check-path-argument 'simplify-path p-in2_0)
                  (let ((p_0 (->path p-in2_0)))
                    (let ((convention_0 (|#%app| path-convention p_0)))
                      (begin
                        (if use-filesystem?1_0
                          (if (eq? convention_0 (system-path-convention-type))
                            (void)
                            (raise-arguments-error
                             'simplify-path
                             "in use-filesystem mode, path is not for the current platform"
                             "path"
                             p_0))
                          (void))
                        (if (|#%app| simple? p_0 convention_0)
                          p_0
                          (let ((clean-p_0 (do-cleanse-path p_0 #t)))
                            (if (|#%app| simple? clean-p_0 convention_0)
                              (if (let ((or-part_0 (not use-filesystem?1_0)))
                                    (if or-part_0
                                      or-part_0
                                      (if (eq? 'windows (system-type))
                                        (|#%app|
                                         same-modulo-slashes?
                                         p_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-filesystem?1_0
                                         (let ((app_0
                                                (if (1/path? (car l_0))
                                                  (cdr l_0)
                                                  l_0)))
                                           (loop_1
                                            app_0
                                            (if (1/path? (car l_0))
                                              (let ((temp8_0 (car l_0)))
                                                (let ((temp9_0
                                                       (current-directory$1)))
                                                  (let ((temp8_1 temp8_0))
                                                    (path->complete-path.1
                                                     #t
                                                     temp8_1
                                                     temp9_0))))
                                              (current-directory$1))
                                            '()
                                            hash2725))
                                         (let ((simpler-l_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)
                                           (|#%app|
                                            simplify-backslash-backslash-questionmark
                                            simple-p_0)
                                           simple-p_0)))
                                    (if (let ((or-part_0
                                               (directory-path?.1 #f p_0)))
                                          (if or-part_0
                                            or-part_0
                                            (if (eq? convention_0 'windows)
                                              (|#%app|
                                               unc-without-trailing-separator?
                                               simpler-p_0)
                                              #f)))
                                      (1/path->directory-path simpler-p_0)
                                      simpler-p_0)))))))))))))))))
    (|#%name|
     simplify-path
     (case-lambda
      ((p-in_0) (begin (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 effect3148
  (begin (void (set! simplify-path/dl 1/simplify-path)) (void)))
(define simple?
  (letrec ((is-a-sep?_0
            (|#%name|
             is-a-sep?
             (lambda (convention_0 b_0)
               (begin
                 (if (eq? convention_0 'windows)
                   (eqv? b_0 92)
                   (is-sep? b_0 convention_0)))))))
    (lambda (p_0 convention_0)
      (let ((bstr_0 (|#%app| path-bytes p_0)))
        (let ((len_0 (unsafe-bytes-length bstr_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)
                      (begin
                        (if (= i_0 len_0)
                          #t
                          (if (is-a-sep?_0
                               convention_0
                               (unsafe-bytes-ref bstr_0 i_0))
                            (if (= (add1 i_0) len_0)
                              #t
                              (if (is-a-sep?_0
                                   convention_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
                                                  convention_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
                                                     convention_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))
     (case-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)
                 (begin
                   (call-with-values
                    (lambda () (1/split-path p_0))
                    (case-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
                                           (|#%app| path-bytes rebuilt0-p_0)
                                           #vu8(92))
                                          'windows)
                                         rebuilt0-p_0)))
                                  (let ((rebuilt-bstr_0
                                         (let ((app_0 path-bytes))
                                           (|#%app|
                                            app_0
                                            (simplify-backslash-backslash-questionmark
                                             rebuilt-p_0)))))
                                    (if (bytes=? bstr_0 rebuilt-bstr_0)
                                      'simple
                                      'non-simple)))))))))
                     (args (raise-binding-result-arity-error 3 args)))))))))
            (loop_0 (path1.1 bstr_0 'windows) '() #f))
           'non-simple)))
      (args (raise-binding-result-arity-error 5 args))))))
(define unc-without-trailing-separator?
  (lambda (p_0)
    (let ((bstr_0 (|#%app| path-bytes p_0)))
      (eqv? (parse-unc.1 #f #f bstr_0 0) (unsafe-bytes-length bstr_0)))))
(define simplify-backslash-backslash-questionmark
  (letrec ((no-special-in-content?_0
            (|#%name|
             no-special-in-content?
             (lambda (bstr_0 len_0 len13_0 start-pos15_0)
               (begin
                 (let ((len_1
                        (if (eq? len13_0 unsafe-undefined) len_0 len13_0)))
                   (letrec*
                    ((loop_0
                      (|#%name|
                       loop
                       (lambda (i_0 elem-start_0)
                         (begin
                           (if (= i_0 len_1)
                             (not
                              (special-element?_0 bstr_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
                                      bstr_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-pos15_0 start-pos15_0)))))))
           (special-element?_0
            (|#%name|
             special-element?
             (lambda (bstr_0 elem-start_0 i_0 at-end?_0)
               (begin
                 (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 ((temp17_0 (subbytes bstr_0 elem-start_0 i_0)))
                         (special-filename?.1 #t temp17_0))))
                   #f))))))
    (lambda (p_0)
      (let ((bstr_0 (|#%app| path-bytes p_0)))
        (let ((len_0 (unsafe-bytes-length bstr_0)))
          (call-with-values
           (lambda () (parse-backslash-backslash-questionmark bstr_0))
           (case-lambda
            ((kind_0 drive-len_0 orig-drive-len_0 clean-start-pos_0 sep-bstr_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
                          bstr_0
                          len_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 ((temp20_0
                              (if (= orig-drive-len_0 len_0)
                                (sub1 len_0)
                                len_0)))
                         (no-special-in-content?_0 bstr_0 len_0 temp20_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
                        bstr_0
                        len_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))
                      (case-lambda
                       ((dots-end_0 literal-start_0)
                        (if (no-special-in-content?_0
                             bstr_0
                             len_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))
                       (args (raise-binding-result-arity-error 2 args))))
                     p_0)))))
            (args (raise-binding-result-arity-error 5 args)))))))))
(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 (|#%app| path-bytes p1_0)))
      (let ((bstr2_0 (|#%app| 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)
                  (begin
                    (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 bytes-no-nuls?
  (lambda (s_0)
    (if (bytes? s_0)
      (not
       (call-with-values
        (lambda ()
          (begin (check-bytes s_0) (values s_0 (unsafe-bytes-length s_0))))
        (case-lambda
         ((vec_0 len_0)
          (begin
            #f
            (letrec*
             ((for-loop_0
               (|#%name|
                for-loop
                (lambda (result_0 pos_0)
                  (begin
                    (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))))
         (args (raise-binding-result-arity-error 2 args)))))
      #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 struct:environment-variables
  (make-record-type-descriptor* 'environment-variables #f #f #f #f 1 1))
(define effect3190
  (struct-type-install-properties!
   struct:environment-variables
   'environment-variables
   1
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   '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 effect3191
  (begin
    (register-struct-constructor! environment-variables1.1)
    (register-struct-predicate! 1/environment-variables?)
    (register-struct-field-accessor!
     environment-variables-ht
     struct:environment-variables
     0)
    (register-struct-field-mutator!
     set-environment-variables-ht!
     struct:environment-variables
     0)
    (void)))
(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
     (begin
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda (args_1 ht_0)
             (begin
               (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
                                  (hash-set
                                   ht_0
                                   (normalize-key key_0)
                                   (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
       (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)
            (begin
              (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
                                                (format-rktio-message
                                                 'environment-variables-set!
                                                 r_0
                                                 base-msg_0)))
                                           (|#%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)
       (begin (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
       (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 ((end_0
                                   (|#%app|
                                    rktio_envvars_count
                                    (unsafe-place-local-ref cell.1)
                                    ev_0)))
                              (begin
                                (letrec*
                                 ((for-loop_0
                                   (|#%name|
                                    for-loop
                                    (lambda (table_0 pos_0)
                                      (begin
                                        (if (< pos_0 end_0)
                                          (let ((table_1
                                                 (let ((table_1
                                                        (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)))))))))
                                                         (case-lambda
                                                          ((key_0 val_0)
                                                           (hash-set
                                                            table_0
                                                            key_0
                                                            val_0))
                                                          (args
                                                           (raise-binding-result-arity-error
                                                            2
                                                            args))))))
                                                   (values table_1))))
                                            (for-loop_0 table_1 (+ pos_0 1)))
                                          table_0))))))
                                 (for-loop_0 hash2725 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
       (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))
             (map2 car (hash-values ht_0)))))))))
(define 1/find-system-path
  (letrec ((procz1 (lambda () 0))
           (as-dir_0
            (|#%name|
             as-dir
             (lambda (p_0) (begin (1/path->directory-path p_0))))))
    (|#%name|
     find-system-path
     (lambda (key_0)
       (begin
         (begin0
           (let ((index_0
                  (if (symbol? key_0) (hash-ref hash2702 key_0 procz1) 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")))))
                         (begin (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")))))
                       (begin (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")))))))
                       (begin (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")))))))
                       (begin (1/path->directory-path p_0)))
                     (if (unsafe-fx< index_0 8)
                       (begin (1/path->directory-path orig-dir))
                       (let ((p_0 (rktio-system-path 'find-system-path 1)))
                         (begin (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)))
                     (begin (1/path->directory-path p_0)))
                   (if (unsafe-fx< index_0 11)
                     (let ((p_0 (rktio-system-path 'find-system-path 2)))
                       (begin (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)))))
                         (begin (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)))
                       (begin (1/path->directory-path p_0)))
                     (let ((p_0 (rktio-system-path 'find-system-path 5)))
                       (begin (1/path->directory-path p_0))))
                   (if (unsafe-fx< index_0 16)
                     (let ((p_0 (rktio-system-path 'find-system-path 6)))
                       (begin (1/path->directory-path p_0)))
                     (if (unsafe-fx< index_0 17)
                       (let ((p_0 (rktio-system-path 'find-system-path 7)))
                         (begin (1/path->directory-path p_0)))
                       (if (unsafe-fx< index_0 18)
                         (let ((p_0 (rktio-system-path 'find-system-path 8)))
                           (begin (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
         (|#%app|
          rktio_to_bytes
          (|#%app|
           rktio_get_current_directory
           (unsafe-place-local-ref cell.1)))))
    (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 (format-rktio-message who_0 s_0 base-msg_0)))
                 (|#%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 effect3239 (begin (void (init-current-directory!)) (void)))
(define 1/path->complete-path
  (|#%name|
   path->complete-path
   (case-lambda
    ((p_0)
     (begin
       (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
       (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 (|#%app| 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
             (() (begin (|#%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 (->host p_0 #f '()) #vu8(0)) #f)))
   (lambda (bstr_0)
     (if (check-not-unsafe-undefined bstr_0 'bstr_119)
       (path1.1
        (bytes->immutable-bytes (check-not-unsafe-undefined bstr_0 'bstr_119))
        (system-path-convention-type))
       #f))))
(define 1/bytes->path
  (let ((bytes->path_0
         (|#%name|
          bytes->path
          (lambda (bstr2_0 convention1_0)
            (begin
              (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) (begin (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
       (begin
         (if (1/path? p_0)
           (void)
           (raise-argument-error 'path->bytes "path-for-some-system?" p_0))
         (bytes-copy (|#%app| path-bytes p_0)))))))
(define 1/string->path-element
  (|#%name|
   string->path-element
   (lambda (s_0)
     (begin
       (begin
         (if (string? s_0)
           (void)
           (raise-argument-error 'string->path-element "string?" s_0))
         (check-path-string 'string->path-element s_0)
         (do-bytes->path-element
          (string->path-bytes s_0)
          (system-path-convention-type)
          'string->path-element
          s_0))))))
(define 1/bytes->path-element
  (let ((bytes->path-element_0
         (|#%name|
          bytes->path-element
          (lambda (bstr4_0 convention3_0)
            (begin
              (let ((convention_0
                     (if (eq? convention3_0 unsafe-undefined)
                       (system-path-convention-type)
                       convention3_0)))
                (begin
                  (if (bytes? bstr4_0)
                    (void)
                    (raise-argument-error
                     'bytes->path-element
                     "bytes?"
                     bstr4_0))
                  (check-convention 'bytes->path-element convention_0)
                  (check-path-bytes 'bytes->path-element bstr4_0)
                  (do-bytes->path-element
                   bstr4_0
                   convention_0
                   'bytes->path-element
                   bstr4_0))))))))
    (|#%name|
     bytes->path-element
     (case-lambda
      ((bstr_0) (begin (bytes->path-element_0 bstr_0 unsafe-undefined)))
      ((bstr_0 convention3_0) (bytes->path-element_0 bstr_0 convention3_0))))))
(define path-element-clean.1
  (letrec ((procz2 (lambda (x_0) (unsafe-bytes-length x_0)))
           (procz1 (lambda (x_0) (bytes? x_0))))
    (|#%name|
     path-element-clean
     (lambda (try-quick?5_0 p7_0)
       (begin
         (if (1/path? p7_0)
           (let ((bstr_0 (|#%app| path-bytes p7_0)))
             (let ((convention_0 (|#%app| path-convention p7_0)))
               (if (let ((or-part_0 (not try-quick?5_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 ()
                               (normalise-inputs
                                'in-bytes
                                "bytes"
                                procz1
                                procz2
                                bstr_0
                                0
                                (letrec*
                                 ((loop_0
                                   (|#%name|
                                    loop
                                    (lambda (end_0)
                                      (begin
                                        (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))
                             (case-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))
                                   (begin
                                     #t
                                     (void)
                                     (letrec*
                                      ((for-loop_0
                                        (|#%name|
                                         for-loop
                                         (lambda (result_0 idx_0 pos_0)
                                           (begin
                                             (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))))))
                              (args
                               (raise-binding-result-arity-error
                                4
                                args)))))))))
                 (call-with-values
                  (lambda () (1/split-path p7_0))
                  (case-lambda
                   ((base_0 name_0 dir?_0)
                    (if (symbol? base_0) (if (1/path? name_0) name_0 #f) #f))
                   (args (raise-binding-result-arity-error 3 args))))
                 #f)))
           #f))))))
(define path-element? (lambda (p_0) (if (path-element-clean.1 #t p_0) #t #f)))
(define do-bytes->path-element
  (letrec ((bad-element_0
            (|#%name|
             bad-element
             (lambda (orig-arg_0 who_0)
               (begin
                 (raise-arguments-error
                  who_0
                  "cannot be converted to a path element"
                  "path"
                  orig-arg_0
                  "explanation"
                  "path can be split, is not relative, or names a special element"))))))
    (lambda (bstr_0 convention_0 who_0 orig-arg_0)
      (begin
        (if (eq? 'windows convention_0)
          (if (call-with-values
               (lambda ()
                 (begin
                   (check-bytes bstr_0)
                   (values bstr_0 (unsafe-bytes-length bstr_0))))
               (case-lambda
                ((vec_0 len_0)
                 (begin
                   #f
                   (letrec*
                    ((for-loop_0
                      (|#%name|
                       for-loop
                       (lambda (result_0 pos_0)
                         (begin
                           (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))))
                (args (raise-binding-result-arity-error 2 args))))
            (bad-element_0 orig-arg_0 who_0)
            (void))
          (void))
        (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)))
            (begin
              (if (path-element? p_0) (void) (bad-element_0 orig-arg_0 who_0))
              p_0)))))))
(define 1/path-element->string
  (|#%name|
   path-element->string
   (lambda (p_0)
     (begin
       (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)
     (begin
       (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 (|#%app| path-bytes elem-p_0)))
      (if (eq? (|#%app| path-convention elem-p_0) 'windows)
        (strip-backslash-backslash-rel bstr_0)
        bstr_0))))
(define 1/path<?
  (|#%name|
   path<?
   (case-lambda
    ((p_0)
     (begin
       (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 (|#%app| path-bytes p1_0)))
         (bytes<? app_0 (|#%app| 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)
             (begin
               (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 (|#%app| path-bytes p_1)))
                       (if (bytes<? bstr_0 bstr2_0)
                         (loop_0 bstr2_0 (cdr ps_1))
                         #f))))))))))
        (loop_0 (|#%app| path-bytes p_0) ps_0)))))))
(define 1/path-convention-type
  (|#%name|
   path-convention-type
   (lambda (p_0)
     (begin
       (begin
         (if (1/path? p_0)
           (void)
           (raise-argument-error
            'path-convention-type
            "path-for-some-system?"
            p_0))
         (|#%app| path-convention p_0))))))
(define utf-16-encode
  (lambda (s_0)
    (let ((surrogate-count_0
           (call-with-values
            (lambda ()
              (begin
                (check-string s_0)
                (values s_0 (unsafe-string-length s_0))))
            (case-lambda
             ((vec_0 len_0)
              (begin
                #f
                (letrec*
                 ((for-loop_0
                   (|#%name|
                    for-loop
                    (lambda (n_0 pos_0)
                      (begin
                        (if (unsafe-fx< pos_0 len_0)
                          (let ((c_0 (string-ref vec_0 pos_0)))
                            (let ((n_1
                                   (let ((n_1
                                          (if (>= (char->integer c_0) 65536)
                                            (add1 n_0)
                                            n_0)))
                                     (values n_1))))
                              (for-loop_0 n_1 (unsafe-fx+ 1 pos_0))))
                          n_0))))))
                 (for-loop_0 0 0))))
             (args (raise-binding-result-arity-error 2 args))))))
      (let ((bstr_0
             (make-bytes (* 2 (+ (string-length s_0) surrogate-count_0)))))
        (begin
          (call-with-values
           (lambda ()
             (begin
               (check-string s_0)
               (values s_0 (unsafe-string-length s_0))))
           (case-lambda
            ((vec_0 len_0)
             (begin
               #f
               (letrec*
                ((for-loop_0
                  (|#%name|
                   for-loop
                   (lambda (pos_0 pos_1)
                     (begin
                       (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 (>= v_0 65536)
                                             (let ((av_0 (- v_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!
                                                        bstr_0
                                                        pos_0
                                                        app_0
                                                        (bitwise-and
                                                         hi_0
                                                         255)))
                                                     (let ((app_0
                                                            (arithmetic-shift
                                                             lo_0
                                                             -8)))
                                                       (bytes-set-two!
                                                        bstr_0
                                                        pos_0
                                                        app_0
                                                        (bitwise-and
                                                         lo_0
                                                         255)))
                                                     (+ pos_0 4)))))
                                             (begin
                                               (let ((app_0
                                                      (arithmetic-shift
                                                       v_0
                                                       -8)))
                                                 (bytes-set-two!
                                                  bstr_0
                                                  pos_0
                                                  app_0
                                                  (bitwise-and v_0 255)))
                                               (+ pos_0 2))))))
                                    (values pos_2))))
                             (for-loop_0 pos_2 (unsafe-fx+ 1 pos_1))))
                         pos_0))))))
                (for-loop_0 0 0))))
            (args (raise-binding-result-arity-error 2 args))))
          bstr_0)))))
(define big-endian? (system-big-endian?))
(define utf-16-decode
  (letrec ((procz2 (lambda (x_0) (unsafe-bytes-length x_0)))
           (procz1 (lambda (x_0) (bytes? x_0))))
    (lambda (bstr_0)
      (let ((len_0 (unsafe-bytes-length bstr_0)))
        (let ((surrogate-count_0
               (call-with-values
                (lambda ()
                  (normalise-inputs
                   'in-bytes
                   "bytes"
                   procz1
                   procz2
                   bstr_0
                   (if big-endian? 0 1)
                   len_0
                   2))
                (case-lambda
                 ((v*_0 start*_0 stop*_0 step*_0)
                  (begin
                    #t
                    (letrec*
                     ((for-loop_0
                       (|#%name|
                        for-loop
                        (lambda (n_0 idx_0)
                          (begin
                            (if (< idx_0 stop*_0)
                              (let ((b_0 (unsafe-bytes-ref v*_0 idx_0)))
                                (let ((n_1
                                       (let ((n_1
                                              (if (= (bitwise-and b_0 220) 216)
                                                (add1 n_0)
                                                n_0)))
                                         (values n_1))))
                                  (for-loop_0 n_1 (+ idx_0 2))))
                              n_0))))))
                     (for-loop_0 0 start*_0))))
                 (args (raise-binding-result-arity-error 4 args))))))
          (let ((str_0
                 (make-string
                  (- (arithmetic-shift len_0 -1) surrogate-count_0))))
            (begin
              (letrec*
               ((loop_0
                 (|#%name|
                  loop
                  (lambda (i_0 pos_0)
                    (begin
                      (if (= i_0 len_0)
                        (void)
                        (let ((a_0 (unsafe-bytes-ref bstr_0 i_0)))
                          (let ((b_0 (unsafe-bytes-ref bstr_0 (add1 i_0))))
                            (let ((v_0
                                   (if big-endian?
                                     (bitwise-ior (arithmetic-shift a_0 8) b_0)
                                     (bitwise-ior
                                      (arithmetic-shift b_0 8)
                                      a_0))))
                              (if (= (bitwise-and v_0 56320) 56320)
                                (let ((a_1
                                       (unsafe-bytes-ref bstr_0 (+ i_0 2))))
                                  (let ((b_1
                                         (unsafe-bytes-ref bstr_0 (+ i_0 3))))
                                    (let ((v2_0
                                           (if big-endian?
                                             (bitwise-ior
                                              (arithmetic-shift a_1 8)
                                              b_1)
                                             (bitwise-ior
                                              (arithmetic-shift b_1 8)
                                              a_1))))
                                      (let ((all-v_0
                                             (+
                                              65536
                                              (let ((app_0
                                                     (arithmetic-shift
                                                      (bitwise-and v_0 1023)
                                                      10)))
                                                (bitwise-ior
                                                 app_0
                                                 (bitwise-and v2_0 1023))))))
                                        (begin
                                          (string-set!
                                           str_0
                                           pos_0
                                           (integer->char all-v_0))
                                          (let ((app_0 (+ i_0 4)))
                                            (loop_0 app_0 (add1 pos_0))))))))
                                (begin
                                  (string-set! str_0 pos_0 (integer->char v_0))
                                  (let ((app_0 (+ i_0 2)))
                                    (loop_0 app_0 (add1 pos_0))))))))))))))
               (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)
          (begin
            (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
       (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
       (begin
         (if (string? s_0)
           (void)
           (raise-argument-error 'string-locale-downcase "string?" s_0))
         (recase.1 #f s_0))))))
(define recase.1
  (letrec ((loop_0
            (|#%name|
             loop
             (lambda (len_0 s3_0 up?1_0 pos_0)
               (begin
                 (let ((i-len_0
                        (+ pos_0 (string-length-up-to-nul s3_0 pos_0 len_0))))
                   (if (= 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 len_0 s3_0 up?1_0 (+ 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))))))))))))
    (|#%name|
     recase
     (lambda (up?1_0 s3_0)
       (begin
         (let ((len_0 (string-length s3_0))) (loop_0 len_0 s3_0 up?1_0 0)))))))
(define recase/no-nul
  (letrec ((loop_0
            (|#%name|
             loop
             (lambda (c_0 in-bstr_0 s_0 up?_0 pos_0)
               (begin
                 (if (= pos_0 (unsafe-bytes-length in-bstr_0))
                   (if (eqv? pos_0 0) "" '(""))
                   (call-with-values
                    (lambda ()
                      (1/bytes-convert (unsafe-unbox* c_0) in-bstr_0 pos_0))
                    (case-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
                                          c_0
                                          in-bstr_0
                                          s_0
                                          up?_0
                                          (+ pos_0 in-used_0 4))))
                                    (let ((err-s_0
                                           (string
                                            (string-ref
                                             s_0
                                             (arithmetic-shift
                                              (+ 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)))))))))))
                     (args (raise-binding-result-arity-error 3 args))))))))))
    (lambda (s_0 up?_0)
      (if (if (equal? (1/current-locale) "")
            (not
             (zero?
              (bitwise-and
               (|#%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
                    (arithmetic-shift (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 (box #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 ()
                 (unsafe-set-box*! c_0 (bytes-open-converter/cached-to enc_0)))
               (lambda () (loop_0 c_0 in-bstr_0 s_0 up?_0 0))
               (lambda ()
                 (let ((c_1 (unsafe-unbox* 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)
     (begin
       (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
          (begin
            (letrec*
             ((for-loop_0
               (|#%name|
                for-loop
                (lambda (lst_0)
                  (begin
                    (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)
                  (begin
                    (if (null? args_1)
                      #t
                      (if (if locale-on?_0
                            (|#%app|
                             cmp_0
                             (let ((app_0 collate))
                               (|#%app| app_0 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)
              (begin
                (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
  (letrec ((check-one-byte_0
            (|#%name|
             check-one-byte
             (lambda (c1_0
                      c2_0
                      ci?_0
                      in-bstr1_0
                      in-bstr2_0
                      new-pos1_0
                      new-pos2_0
                      s1_0
                      s2_0)
               (begin
                 (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)))
                           (loop_0
                            c1_0
                            c2_0
                            ci?_0
                            in-bstr1_0
                            in-bstr2_0
                            s1_0
                            s2_0
                            app_0
                            (+ new-pos2_0 4)
                            (unsafe-bytes-length in-bstr1_0)
                            (unsafe-bytes-length in-bstr2_0)))))))))))
           (loop_0
            (|#%name|
             loop
             (lambda (c1_0
                      c2_0
                      ci?_0
                      in-bstr1_0
                      in-bstr2_0
                      s1_0
                      s2_0
                      pos1_0
                      pos2_0
                      end1_0
                      end2_0)
               (begin
                 (call-with-values
                  (lambda ()
                    (1/bytes-convert
                     (unsafe-unbox* c1_0)
                     in-bstr1_0
                     pos1_0
                     end1_0))
                  (case-lambda
                   ((bstr1_0 in-used1_0 status1_0)
                    (call-with-values
                     (lambda ()
                       (1/bytes-convert
                        (unsafe-unbox* c2_0)
                        in-bstr2_0
                        pos2_0
                        end2_0))
                     (case-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)))
                               (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
                                                c1_0
                                                c2_0
                                                ci?_0
                                                in-bstr1_0
                                                in-bstr2_0
                                                new-pos1_0
                                                new-pos2_0
                                                s1_0
                                                s2_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
                                        c1_0
                                        c2_0
                                        ci?_0
                                        in-bstr1_0
                                        in-bstr2_0
                                        new-pos1_0
                                        new-pos2_0
                                        s1_0
                                        s2_0)
                                       (if (zero? in-used1_0) 1 -1))
                                     (let ((app_0 (+ pos1_0 len_0)))
                                       (loop_0
                                        c1_0
                                        c2_0
                                        ci?_0
                                        in-bstr1_0
                                        in-bstr2_0
                                        s1_0
                                        s2_0
                                        pos1_0
                                        pos2_0
                                        app_0
                                        (+ pos2_0 len_0)))))))))))
                      (args (raise-binding-result-arity-error 3 args)))))
                   (args (raise-binding-result-arity-error 3 args)))))))))
    (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 (box #f)))
          (let ((c2_0 (box #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
                       (unsafe-set-box*!
                        c1_0
                        (bytes-open-converter/cached-to enc_0))
                       (unsafe-set-box*!
                        c2_0
                        (bytes-open-converter/cached-to2 enc_0))))
                   (lambda ()
                     (loop_0
                      c1_0
                      c2_0
                      ci?_0
                      in-bstr1_0
                      in-bstr2_0
                      s1_0
                      s2_0
                      0
                      0
                      (unsafe-bytes-length in-bstr1_0)
                      (unsafe-bytes-length in-bstr2_0)))
                   (lambda ()
                     (begin
                       (let ((c_0 (unsafe-unbox* c1_0)))
                         (cache-save! c_0 enc_0 cache-to set-cache-to!))
                       (let ((c_0 (unsafe-unbox* c2_0)))
                         (cache-save!
                          c_0
                          enc_0
                          cache-to2
                          set-cache-to2!))))))))))))))
(define 1/error
  (|#%name|
   error
   (lambda (init_0 . args_0)
     (begin (do-error 'error exn:fail init_0 args_0)))))
(define 1/raise-user-error
  (|#%name|
   raise-user-error
   (lambda (init_0 . args_0)
     (begin (do-error 'raise-user-error exn:fail:user init_0 args_0)))))
(define do-error
  (lambda (who_0 exn:fail_0 init_0 args_0)
    (if (if (symbol? init_0) (null? args_0) #f)
      (raise
       (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)))
              (raise
               (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)
          (raise
           (let ((app_0
                  (apply
                   string-append
                   init_0
                   (1/reverse
                    (begin
                      (letrec*
                       ((for-loop_0
                         (|#%name|
                          for-loop
                          (lambda (fold-var_0 lst_0)
                            (begin
                              (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 install-error-value->string-handler!
  (letrec ((procz1
            (|#%name|
             default-error-value->string-handler
             (lambda (v_0 len_0)
               (begin
                 (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)))))))))
    (lambda () (error-value->string-handler procz1))))
(define effect3418
  (begin (void (install-error-value->string-handler!)) (void)))
(define 1/srcloc->string
  (|#%name|
   srcloc->string
   (lambda (s_0)
     (begin
       (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))))
             (let ((app_0 (adjust-path (srcloc-source s_0))))
               (1/format "~a::~s" app_0 (srcloc-position s_0))))
           #f))))))
(define adjust-path
  (lambda (p_0) (let ((dir_0 (current-directory-for-user$1))) p_0)))
(define struct:logger
  (make-record-type-descriptor* 'logger #f #f #f #f 11 2047))
(define effect3420
  (struct-type-install-properties!
   struct:logger
   'logger
   11
   0
   #f
   null
   (current-inspector)
   #f
   '(0 1 2 7 9 10)
   #f
   'logger))
(define logger1.1
  (|#%name|
   logger
   (record-constructor
    (make-record-constructor-descriptor struct:logger #f #f))))
(define 1/logger?3419 (|#%name| logger? (record-predicate struct:logger)))
(define 1/logger?
  (|#%name|
   logger?
   (lambda (v)
     (if (1/logger?3419 v)
       #t
       ($value
        (if (impersonator? v) (1/logger?3419 (impersonator-val v)) #f))))))
(define logger-topic3421
  (|#%name| logger-topic (record-accessor struct:logger 0)))
(define logger-topic
  (|#%name|
   logger-topic
   (lambda (s)
     (if (1/logger?3419 s)
       (logger-topic3421 s)
       ($value
        (impersonate-ref
         logger-topic3421
         struct:logger
         0
         s
         'logger
         'topic))))))
(define logger-parent3422
  (|#%name| logger-parent (record-accessor struct:logger 1)))
(define logger-parent
  (|#%name|
   logger-parent
   (lambda (s)
     (if (1/logger?3419 s)
       (logger-parent3422 s)
       ($value
        (impersonate-ref
         logger-parent3422
         struct:logger
         1
         s
         'logger
         'parent))))))
(define logger-propagate-filters3423
  (|#%name| logger-propagate-filters (record-accessor struct:logger 2)))
(define logger-propagate-filters
  (|#%name|
   logger-propagate-filters
   (lambda (s)
     (if (1/logger?3419 s)
       (logger-propagate-filters3423 s)
       ($value
        (impersonate-ref
         logger-propagate-filters3423
         struct:logger
         2
         s
         'logger
         'propagate-filters))))))
(define logger-receiver-box+backrefs3424
  (|#%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?3419 s)
       (logger-receiver-box+backrefs3424 s)
       ($value
        (impersonate-ref
         logger-receiver-box+backrefs3424
         struct:logger
         3
         s
         'logger
         'receiver-box+backrefs))))))
(define logger-prune-counter3425
  (|#%name| logger-prune-counter (record-accessor struct:logger 4)))
(define logger-prune-counter
  (|#%name|
   logger-prune-counter
   (lambda (s)
     (if (1/logger?3419 s)
       (logger-prune-counter3425 s)
       ($value
        (impersonate-ref
         logger-prune-counter3425
         struct:logger
         4
         s
         'logger
         'prune-counter))))))
(define logger-permanent-receivers3426
  (|#%name| logger-permanent-receivers (record-accessor struct:logger 5)))
(define logger-permanent-receivers
  (|#%name|
   logger-permanent-receivers
   (lambda (s)
     (if (1/logger?3419 s)
       (logger-permanent-receivers3426 s)
       ($value
        (impersonate-ref
         logger-permanent-receivers3426
         struct:logger
         5
         s
         'logger
         'permanent-receivers))))))
(define logger-max-receiver-level3427
  (|#%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?3419 s)
       (logger-max-receiver-level3427 s)
       ($value
        (impersonate-ref
         logger-max-receiver-level3427
         struct:logger
         6
         s
         'logger
         'max-receiver-level))))))
(define logger-topic-level-cache3428
  (|#%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?3419 s)
       (logger-topic-level-cache3428 s)
       ($value
        (impersonate-ref
         logger-topic-level-cache3428
         struct:logger
         7
         s
         'logger
         'topic-level-cache))))))
(define logger-local-level-timestamp3429
  (|#%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?3419 s)
       (logger-local-level-timestamp3429 s)
       ($value
        (impersonate-ref
         logger-local-level-timestamp3429
         struct:logger
         8
         s
         'logger
         'local-level-timestamp))))))
(define logger-root-level-timestamp-box3430
  (|#%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?3419 s)
       (logger-root-level-timestamp-box3430 s)
       ($value
        (impersonate-ref
         logger-root-level-timestamp-box3430
         struct:logger
         9
         s
         'logger
         'root-level-timestamp-box))))))
(define logger-level-sema-box3431
  (|#%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?3419 s)
       (logger-level-sema-box3431 s)
       ($value
        (impersonate-ref
         logger-level-sema-box3431
         struct:logger
         10
         s
         'logger
         'level-sema-box))))))
(define set-logger-receiver-box+backrefs!3432
  (|#%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?3419 s)
       (set-logger-receiver-box+backrefs!3432 s v)
       ($value
        (impersonate-set!
         set-logger-receiver-box+backrefs!3432
         struct:logger
         3
         3
         s
         v
         'logger
         'receiver-box+backrefs))))))
(define set-logger-prune-counter!3433
  (|#%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?3419 s)
       (set-logger-prune-counter!3433 s v)
       ($value
        (impersonate-set!
         set-logger-prune-counter!3433
         struct:logger
         4
         4
         s
         v
         'logger
         'prune-counter))))))
(define set-logger-permanent-receivers!3434
  (|#%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?3419 s)
       (set-logger-permanent-receivers!3434 s v)
       ($value
        (impersonate-set!
         set-logger-permanent-receivers!3434
         struct:logger
         5
         5
         s
         v
         'logger
         'permanent-receivers))))))
(define set-logger-max-receiver-level!3435
  (|#%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?3419 s)
       (set-logger-max-receiver-level!3435 s v)
       ($value
        (impersonate-set!
         set-logger-max-receiver-level!3435
         struct:logger
         6
         6
         s
         v
         'logger
         'max-receiver-level))))))
(define set-logger-local-level-timestamp!3436
  (|#%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?3419 s)
       (set-logger-local-level-timestamp!3436 s v)
       ($value
        (impersonate-set!
         set-logger-local-level-timestamp!3436
         struct:logger
         8
         8
         s
         v
         'logger
         'local-level-timestamp))))))
(define effect3437
  (begin
    (register-struct-constructor! logger1.1)
    (register-struct-predicate! 1/logger?)
    (register-struct-field-accessor! logger-topic struct:logger 0)
    (register-struct-field-accessor! logger-parent struct:logger 1)
    (register-struct-field-accessor! logger-propagate-filters struct:logger 2)
    (register-struct-field-accessor!
     logger-receiver-box+backrefs
     struct:logger
     3)
    (register-struct-field-accessor! logger-prune-counter struct:logger 4)
    (register-struct-field-accessor!
     logger-permanent-receivers
     struct:logger
     5)
    (register-struct-field-accessor! logger-max-receiver-level struct:logger 6)
    (register-struct-field-accessor! logger-topic-level-cache struct:logger 7)
    (register-struct-field-accessor!
     logger-local-level-timestamp
     struct:logger
     8)
    (register-struct-field-accessor!
     logger-root-level-timestamp-box
     struct:logger
     9)
    (register-struct-field-accessor! logger-level-sema-box struct:logger 10)
    (register-struct-field-mutator!
     set-logger-receiver-box+backrefs!
     struct:logger
     3)
    (register-struct-field-mutator! set-logger-prune-counter! struct:logger 4)
    (register-struct-field-mutator!
     set-logger-permanent-receivers!
     struct:logger
     5)
    (register-struct-field-mutator!
     set-logger-max-receiver-level!
     struct:logger
     6)
    (register-struct-field-mutator!
     set-logger-local-level-timestamp!
     struct:logger
     8)
    (void)))
(define 1/logger-name
  (|#%name|
   logger-name
   (lambda (logger_0)
     (begin
       (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)
     (begin
       (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)))
       (begin
         (letrec*
          ((for-loop_0
            (|#%name|
             for-loop
             (lambda (fold-var_0 lst_1)
               (begin
                 (if (pair? lst_1)
                   (let ((b+r_0 (unsafe-car lst_1)))
                     (let ((rest_0 (unsafe-cdr lst_1)))
                       (let ((fold-var_1
                              (let ((lr_0 (weak-box-value (car b+r_0))))
                                (begin
                                  #t
                                  (letrec*
                                   ((for-loop_1
                                     (|#%name|
                                      for-loop
                                      (lambda (fold-var_1)
                                        (begin
                                          (let ((fold-var_2
                                                 (if lr_0
                                                   (let ((fold-var_2
                                                          (cons
                                                           lr_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)
     (begin
       (letrec*
        ((loop_0
          (|#%name|
           loop
           (lambda (l_0 accum_0 default-level_0)
             (begin
               (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)
                             (loop_0
                              (cddr l_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)
          (begin
            (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)
          (begin
            (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 struct:queue (make-record-type-descriptor* 'queue #f #f #f #f 2 3))
(define effect3457
  (struct-type-install-properties!
   struct:queue
   'queue
   2
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   '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 effect3458
  (begin
    (register-struct-constructor! queue1.1)
    (register-struct-predicate! queue?)
    (register-struct-field-accessor! queue-start struct:queue 0)
    (register-struct-field-accessor! queue-end struct:queue 1)
    (register-struct-field-mutator! set-queue-start! struct:queue 0)
    (register-struct-field-mutator! set-queue-end! struct:queue 1)
    (void)))
(define struct:node (make-record-type-descriptor* 'node #f #f #f #f 3 7))
(define effect3459
  (struct-type-install-properties!
   struct:node
   'node
   3
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '(0)
   #f
   '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 effect3460
  (begin
    (register-struct-constructor! node2.1)
    (register-struct-predicate! node?)
    (register-struct-field-accessor! node-elem struct:node 0)
    (register-struct-field-accessor! node-prev struct:node 1)
    (register-struct-field-accessor! node-next struct:node 2)
    (register-struct-field-mutator! set-node-prev! struct:node 1)
    (register-struct-field-mutator! set-node-next! struct:node 2)
    (void)))
(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 struct:log-receiver
  (make-record-type-descriptor* 'log-receiver #f #f #f #f 1 1))
(define effect3469
  (struct-type-install-properties!
   struct:log-receiver
   'log-receiver
   1
   0
   #f
   null
   (current-inspector)
   #f
   '(0)
   #f
   'log-receiver))
(define log-receiver1.1
  (|#%name|
   log-receiver
   (record-constructor
    (make-record-constructor-descriptor struct:log-receiver #f #f))))
(define 1/log-receiver?3468
  (|#%name| log-receiver? (record-predicate struct:log-receiver)))
(define 1/log-receiver?
  (|#%name|
   log-receiver?
   (lambda (v)
     (if (1/log-receiver?3468 v)
       #t
       ($value
        (if (impersonator? v)
          (1/log-receiver?3468 (impersonator-val v))
          #f))))))
(define log-receiver-filters3470
  (|#%name| log-receiver-filters (record-accessor struct:log-receiver 0)))
(define log-receiver-filters
  (|#%name|
   log-receiver-filters
   (lambda (s)
     (if (1/log-receiver?3468 s)
       (log-receiver-filters3470 s)
       ($value
        (impersonate-ref
         log-receiver-filters3470
         struct:log-receiver
         0
         s
         'log-receiver
         'filters))))))
(define effect3471
  (begin
    (register-struct-constructor! log-receiver1.1)
    (register-struct-predicate! 1/log-receiver?)
    (register-struct-field-accessor!
     log-receiver-filters
     struct:log-receiver
     0)
    (void)))
(define-values
 (prop:receiver-send receiver-send? receiver-send-ref)
 (make-struct-type-property 'receiver-send))
(define struct:queue-log-receiver
  (make-record-type-descriptor*
   'log-receiver
   struct:log-receiver
   #f
   #f
   #f
   3
   7))
(define effect3473
  (struct-type-install-properties!
   struct:queue-log-receiver
   'log-receiver
   3
   0
   struct:log-receiver
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (lr_0 ctx_0)
        (let ((msg_0 (queue-remove! (|#%app| 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
                       (|#%app| increment-receiever-waiters! lr_0)
                       (queue-add!
                        (|#%app| 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 (|#%app| queue-log-receiver-waiters lr_0)))
                        (queue-remove-node! app_0 n_0))
                      (|#%app| decrement-receiever-waiters! lr_0)))
                  void
                  (lambda ()
                    (let ((msg_1
                           (queue-remove!
                            (|#%app| queue-log-receiver-msgs lr_0))))
                      (if msg_1
                        (begin (set-box! b_0 msg_1) (values msg_1 #t))
                        (begin
                          (|#%app| increment-receiever-waiters! lr_0)
                          (set! n_0
                            (queue-add!
                             (|#%app| queue-log-receiver-waiters lr_0)
                             b_0))
                          (values #f #f))))))))))))))
    (cons
     prop:receiver-send
     (lambda (lr_0 msg_0)
       (let ((b_0 (queue-remove! (|#%app| queue-log-receiver-waiters lr_0))))
         (if b_0
           (begin
             (|#%app| decrement-receiever-waiters! lr_0)
             (let ((select!_0 (unbox b_0)))
               (begin (set-box! b_0 msg_0) (|#%app| select!_0))))
           (queue-add! (|#%app| queue-log-receiver-msgs lr_0) msg_0))))))
   (current-inspector)
   #f
   '(0 1 2)
   #f
   '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?3472
  (|#%name| log-receiver? (record-predicate struct:queue-log-receiver)))
(define queue-log-receiver?
  (|#%name|
   log-receiver?
   (lambda (v)
     (if (queue-log-receiver?3472 v)
       #t
       ($value
        (if (impersonator? v)
          (queue-log-receiver?3472 (impersonator-val v))
          #f))))))
(define queue-log-receiver-msgs3497
  (|#%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?3472 s)
       (queue-log-receiver-msgs3497 s)
       ($value
        (impersonate-ref
         queue-log-receiver-msgs3497
         struct:queue-log-receiver
         0
         s
         'log-receiver
         'msgs))))))
(define queue-log-receiver-waiters3498
  (|#%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?3472 s)
       (queue-log-receiver-waiters3498 s)
       ($value
        (impersonate-ref
         queue-log-receiver-waiters3498
         struct:queue-log-receiver
         1
         s
         'log-receiver
         'waiters))))))
(define queue-log-receiver-backref3499
  (|#%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?3472 s)
       (queue-log-receiver-backref3499 s)
       ($value
        (impersonate-ref
         queue-log-receiver-backref3499
         struct:queue-log-receiver
         2
         s
         'log-receiver
         'backref))))))
(define effect3500
  (begin
    (register-struct-constructor! queue-log-receiver2.1)
    (register-struct-predicate! queue-log-receiver?)
    (register-struct-field-accessor!
     queue-log-receiver-msgs
     struct:queue-log-receiver
     0)
    (register-struct-field-accessor!
     queue-log-receiver-waiters
     struct:queue-log-receiver
     1)
    (register-struct-field-accessor!
     queue-log-receiver-backref
     struct:queue-log-receiver
     2)
    (void)))
(define 1/make-log-receiver
  (|#%name|
   make-log-receiver
   (lambda (logger_0 level_0 . args_0)
     (begin
       (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 (|#%app| 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 (|#%app| queue-log-receiver-waiters lr_0)))
          (not (queue-start q_0)))
      (set-box! (queue-log-receiver-backref lr_0) lr_0)
      (void))))
(define struct:stdio-log-receiver
  (make-record-type-descriptor*
   'stdio-log-receiver
   struct:log-receiver
   #f
   #f
   #f
   2
   3))
(define effect3513
  (struct-type-install-properties!
   struct:stdio-log-receiver
   '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)
                       (begin
                         (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 stdio-log-receiver3.1
  (|#%name|
   stdio-log-receiver
   (record-constructor
    (make-record-constructor-descriptor struct:stdio-log-receiver #f #f))))
(define stdio-log-receiver?3512
  (|#%name| stdio-log-receiver? (record-predicate struct:stdio-log-receiver)))
(define stdio-log-receiver?
  (|#%name|
   stdio-log-receiver?
   (lambda (v)
     (if (stdio-log-receiver?3512 v)
       #t
       ($value
        (if (impersonator? v)
          (stdio-log-receiver?3512 (impersonator-val v))
          #f))))))
(define stdio-log-receiver-rktio3517
  (|#%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?3512 s)
       (stdio-log-receiver-rktio3517 s)
       ($value
        (impersonate-ref
         stdio-log-receiver-rktio3517
         struct:stdio-log-receiver
         0
         s
         'stdio-log-receiver
         'rktio))))))
(define stdio-log-receiver-which3518
  (|#%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?3512 s)
       (stdio-log-receiver-which3518 s)
       ($value
        (impersonate-ref
         stdio-log-receiver-which3518
         struct:stdio-log-receiver
         1
         s
         'stdio-log-receiver
         'which))))))
(define effect3519
  (begin
    (register-struct-constructor! stdio-log-receiver3.1)
    (register-struct-predicate! stdio-log-receiver?)
    (register-struct-field-accessor!
     stdio-log-receiver-rktio
     struct:stdio-log-receiver
     0)
    (register-struct-field-accessor!
     stdio-log-receiver-which
     struct:stdio-log-receiver
     1)
    (void)))
(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
             (stdio-log-receiver3.1
              (parse-filters.1 'none parse-who_0 args_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 struct:syslog-log-receiver
  (make-record-type-descriptor*
   'syslog-log-receiver
   struct:log-receiver
   #f
   #f
   #f
   2
   3))
(define effect3524
  (struct-type-install-properties!
   struct:syslog-log-receiver
   '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 syslog-log-receiver4.1
  (|#%name|
   syslog-log-receiver
   (record-constructor
    (make-record-constructor-descriptor struct:syslog-log-receiver #f #f))))
(define syslog-log-receiver?3523
  (|#%name|
   syslog-log-receiver?
   (record-predicate struct:syslog-log-receiver)))
(define syslog-log-receiver?
  (|#%name|
   syslog-log-receiver?
   (lambda (v)
     (if (syslog-log-receiver?3523 v)
       #t
       ($value
        (if (impersonator? v)
          (syslog-log-receiver?3523 (impersonator-val v))
          #f))))))
(define syslog-log-receiver-rktio3528
  (|#%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?3523 s)
       (syslog-log-receiver-rktio3528 s)
       ($value
        (impersonate-ref
         syslog-log-receiver-rktio3528
         struct:syslog-log-receiver
         0
         s
         'syslog-log-receiver
         'rktio))))))
(define syslog-log-receiver-cmd3529
  (|#%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?3523 s)
       (syslog-log-receiver-cmd3529 s)
       ($value
        (impersonate-ref
         syslog-log-receiver-cmd3529
         struct:syslog-log-receiver
         1
         s
         'syslog-log-receiver
         'cmd))))))
(define effect3530
  (begin
    (register-struct-constructor! syslog-log-receiver4.1)
    (register-struct-predicate! syslog-log-receiver?)
    (register-struct-field-accessor!
     syslog-log-receiver-rktio
     struct:syslog-log-receiver
     0)
    (register-struct-field-accessor!
     syslog-log-receiver-cmd
     struct:syslog-log-receiver
     1)
    (void)))
(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)))
             (syslog-log-receiver4.1
              app_0
              (unsafe-place-local-ref cell.1)
              (let ((app_1 path-bytes))
                (|#%app| app_1 (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
               (cons
                (cons (make-weak-box lr_0) backref_0)
                (1/reverse
                 (let ((lst_0 (logger-receiver-box+backrefs logger_0)))
                   (begin
                     (letrec*
                      ((for-loop_0
                        (|#%name|
                         for-loop
                         (lambda (fold-var_0 lst_1)
                           (begin
                             (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
               (cons
                (cons (make-weak-box lr_0) backref_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)
          (begin
            (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)))
                   (begin
                     (letrec*
                      ((for-loop_0
                        (|#%name|
                         for-loop
                         (lambda (result_0 pos_0)
                           (begin
                             (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!
  (letrec ((for-loop_0
            (|#%name|
             for-loop
             (lambda (ceiling-level_0
                      topic-ceiling-level_0
                      topic_0
                      max-level_0
                      topic-max-level_0
                      lst_0)
               (begin
                 (if (pair? lst_0)
                   (let ((r_0 (unsafe-car lst_0)))
                     (let ((rest_0 (unsafe-cdr lst_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))))
                          (case-lambda
                           ((max-level_1 topic-max-level_1)
                            (begin
                              (for-loop_0
                               ceiling-level_0
                               topic-ceiling-level_0
                               topic_0
                               max-level_1
                               topic-max-level_1
                               rest_0)))
                           (args
                            (raise-binding-result-arity-error 2 args)))))))
                   (values max-level_0 topic-max-level_0))))))
           (next-k-proc_0
            (|#%name|
             next-k-proc
             (lambda (ceiling-level_0
                      rest_0
                      topic-ceiling-level_0
                      topic_0
                      max-level_0
                      topic-max-level_0)
               (begin
                 (for-loop_0
                  ceiling-level_0
                  topic-ceiling-level_0
                  topic_0
                  max-level_0
                  topic-max-level_0
                  rest_0))))))
    (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)))
                (begin
                  (letrec*
                   ((for-loop_1
                     (|#%name|
                      for-loop
                      (lambda (pos_0)
                        (begin
                          (if (< pos_0 end_0)
                            (begin
                              (vector-set! cache_0 pos_0 #f)
                              (for-loop_1 (+ pos_0 2)))
                            (values)))))))
                   (for-loop_1 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)
              (begin
                (call-with-values
                 (lambda ()
                   (let ((lst_0 (logger-receivers parent_0)))
                     (begin
                       (for-loop_0
                        ceiling-level_0
                        topic-ceiling-level_0
                        topic_0
                        old-max-level_0
                        old-topic-max-level_0
                        lst_0))))
                 (case-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)))
                                      (begin
                                        (letrec*
                                         ((for-loop_1
                                           (|#%name|
                                            for-loop
                                            (lambda (result_0 pos_0)
                                              (begin
                                                (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_1
                                                       result_1
                                                       (+ pos_0 2))
                                                      result_1))
                                                  result_0))))))
                                         (for-loop_1 #f 0))))))
                               (if or-part_0
                                 or-part_0
                                 (begin
                                   (begin
                                     (let ((end_0
                                            (- (vector-length cache_0) 2)))
                                       (begin
                                         (letrec*
                                          ((for-loop_1
                                            (|#%name|
                                             for-loop
                                             (lambda (pos_0)
                                               (begin
                                                 (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_1 (+ pos_0 2)))
                                                   (values)))))))
                                          (for-loop_1 0))))
                                     (void))
                                   (vector-set! cache_0 0 topic_0)
                                   (vector-set!
                                    cache_0
                                    1
                                    topic-max-level_0)))))
                           (void))))))
                  (args (raise-binding-result-arity-error 2 args)))))))))
         (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)
             (begin
               (call-with-values
                (lambda ()
                  (let ((lst_0 (logger-receivers logger_1)))
                    (begin
                      (letrec*
                       ((for-loop_0
                         (|#%name|
                          for-loop
                          (lambda (topics_1 default-level_1 lst_1)
                            (begin
                              (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))
                                        (case-lambda
                                         ((topics_2 default-level_2)
                                          (values topics_2 default-level_2))
                                         (args
                                          (raise-binding-result-arity-error
                                           2
                                           args)))))
                                     (case-lambda
                                      ((topics_2 default-level_2)
                                       (for-loop_0
                                        topics_2
                                        default-level_2
                                        rest_0))
                                      (args
                                       (raise-binding-result-arity-error
                                        2
                                        args))))))
                                (values topics_1 default-level_1)))))))
                       (for-loop_0 topics_0 'none lst_0)))))
                (case-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)))))
                 (args (raise-binding-result-arity-error 2 args)))))))))
        (loop_0 hash2610 'none 'debug logger_0)))
     (case-lambda
      ((topics_0 default-level_0)
       (let ((app_0 (level->user-representation default-level_0)))
         (list*
          app_0
          #f
          (apply
           append
           (1/reverse
            (begin
              (letrec*
               ((for-loop_0
                 (|#%name|
                  for-loop
                  (lambda (fold-var_0 i_0)
                    (begin
                      (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)))))))))
      (args (raise-binding-result-arity-error 2 args))))))
(define make-root-logger (lambda () (create-logger.1 #f 'none #f)))
(define cell.1$4 (unsafe-make-place-local (make-root-logger)))
(define unsafe-root-logger (lambda () (unsafe-place-local-ref cell.1$4)))
(define 1/current-logger
  (make-parameter
   (unsafe-place-local-ref cell.1$4)
   (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$4 (make-root-logger))
      (1/current-logger (unsafe-place-local-ref cell.1$4)))))
(define 1/make-logger
  (let ((make-logger_0
         (|#%name|
          make-logger
          (lambda (topic1_0 parent2_0 new-rest_0)
            (begin
              (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
      (() (begin (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
              (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))
                (|#%app| start-atomic/no-interrupts)
                (begin0
                  (log-level?* logger4_0 level5_0 topic3_0)
                  (|#%app| end-atomic/no-interrupts))))))))
    (|#%name|
     log-level?
     (case-lambda
      ((logger_0 level_0) (begin (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$4) '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$4) '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
              (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) (begin (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
       (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
       (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)
     (begin
       (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))
      (|#%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$4)
         '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$4)
         'debug
         'place
         message_0
         data_0
         #t
         #f)
        (|#%app| end-atomic/no-interrupts)))))
(define log-message*
  (letrec ()
    (lambda (logger_0
             level_0
             topic_0
             message_0
             data_0
             prefix?_0
             in-interrupt?_0)
      (let ((msg_0 (box #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
                  (begin
                    (let ((lst_0 (logger-receivers logger_1)))
                      (begin
                        (letrec*
                         ((for-loop_0
                           (|#%name|
                            for-loop
                            (lambda (lst_1)
                              (begin
                                (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 (unsafe-unbox* msg_0)
                                              (void)
                                              (unsafe-set-box*!
                                               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
                                             (unsafe-unbox* 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 struct:fs-change-evt
  (make-record-type-descriptor* 'filesystem-change-evt #f #f #f #f 2 3))
(define effect3652
  (struct-type-install-properties!
   struct:fs-change-evt
   'filesystem-change-evt
   2
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (fc_0 ctx_0)
        (let ((rfc_0 (|#%app| 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 fs-change-evt1.1
  (|#%name|
   fs-change-evt
   (record-constructor
    (make-record-constructor-descriptor struct:fs-change-evt #f #f))))
(define fs-change-evt?3651
  (|#%name| filesystem-change-evt? (record-predicate struct:fs-change-evt)))
(define fs-change-evt?
  (|#%name|
   filesystem-change-evt?
   (lambda (v)
     (if (fs-change-evt?3651 v)
       #t
       ($value
        (if (impersonator? v)
          (fs-change-evt?3651 (impersonator-val v))
          #f))))))
(define fs-change-evt-rfc3657
  (|#%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?3651 s)
       (fs-change-evt-rfc3657 s)
       ($value
        (impersonate-ref
         fs-change-evt-rfc3657
         struct:fs-change-evt
         0
         s
         'filesystem-change-evt
         'rfc))))))
(define fs-change-evt-cust-ref3658
  (|#%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?3651 s)
       (fs-change-evt-cust-ref3658 s)
       ($value
        (impersonate-ref
         fs-change-evt-cust-ref3658
         struct:fs-change-evt
         1
         s
         'filesystem-change-evt
         'cust-ref))))))
(define set-fs-change-evt-rfc!3659
  (|#%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?3651 s)
       (set-fs-change-evt-rfc!3659 s v)
       ($value
        (impersonate-set!
         set-fs-change-evt-rfc!3659
         struct:fs-change-evt
         0
         0
         s
         v
         'filesystem-change-evt
         'rfc))))))
(define set-fs-change-evt-cust-ref!3660
  (|#%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?3651 s)
       (set-fs-change-evt-cust-ref!3660 s v)
       ($value
        (impersonate-set!
         set-fs-change-evt-cust-ref!3660
         struct:fs-change-evt
         1
         1
         s
         v
         'filesystem-change-evt
         'cust-ref))))))
(define effect3661
  (begin
    (register-struct-constructor! fs-change-evt1.1)
    (register-struct-predicate! fs-change-evt?)
    (register-struct-field-accessor! fs-change-evt-rfc struct:fs-change-evt 0)
    (register-struct-field-accessor!
     fs-change-evt-cust-ref
     struct:fs-change-evt
     1)
    (register-struct-field-mutator!
     set-fs-change-evt-rfc!
     struct:fs-change-evt
     0)
    (register-struct-field-mutator!
     set-fs-change-evt-cust-ref!
     struct:fs-change-evt
     1)
    (void)))
(define 1/filesystem-change-evt?
  (|#%name|
   filesystem-change-evt?
   (lambda (v_0) (begin (fs-change-evt? v_0)))))
(define 1/filesystem-change-evt
  (let ((filesystem-change-evt_0
         (letrec ((procz1 (lambda (fc_0) (close-fc fc_0))))
           (|#%name|
            filesystem-change-evt
            (lambda (p3_0 fail2_0)
              (begin
                (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$3))))
                          (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)))
                                        (case-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$3)))))
                                         (args
                                          (raise-binding-result-arity-error
                                           3
                                           args))))
                                       (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
                                     (|#%app|
                                      exn:fail:unsupported
                                      "filesystem-change-evt: unsupported"
                                      (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
                                        procz1
                                        #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) (begin (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
       (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 (|#%app| 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 effect3682
  (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)
                  (begin (not (eqv? 0 (bitwise-and a_0 b_0))))))))
          (if (if (set?_0 props_0 16)
                (eq? (unsafe-place-local-ref cell.1$3) 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)
            (begin
              (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) (begin (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
         (letrec ((procz1 (lambda (p_0) (|#%app| rktio_sha2_init p_0 #t))))
           (|#%name|
            sha224-bytes
            (lambda (in6_0 start4_0 end5_0)
              (begin
                (sha
                 'sha224-bytes
                 in6_0
                 start4_0
                 end5_0
                 (|#%app| rktio_make_sha2_ctx)
                 28
                 procz1
                 rktio_sha2_update
                 rktio_sha2_final)))))))
    (|#%name|
     sha224-bytes
     (case-lambda
      ((in_0) (begin (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
         (letrec ((procz1 (lambda (p_0) (|#%app| rktio_sha2_init p_0 #f))))
           (|#%name|
            sha256-bytes
            (lambda (in9_0 start7_0 end8_0)
              (begin
                (sha
                 'sha256-bytes
                 in9_0
                 start7_0
                 end8_0
                 (|#%app| rktio_make_sha2_ctx)
                 32
                 procz1
                 rktio_sha2_update
                 rktio_sha2_final)))))))
    (|#%name|
     sha256-bytes
     (case-lambda
      ((in_0) (begin (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)
                            (begin
                              (if (zero? skip_0)
                                (letrec*
                                 ((loop_1
                                   (|#%name|
                                    loop
                                    (lambda (len_0)
                                      (begin
                                        (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 struct:subprocess
  (make-record-type-descriptor* 'subprocess #f #f #f #f 3 7))
(define effect3693
  (struct-type-install-properties!
   struct:subprocess
   '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)
                (|#%app| 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)
                  (|#%app| subprocess-process sp_0)
                  ps_0)))
              (values #f sp_0))
            (begin (|#%app| no-custodian! sp_0) (values (list sp_0) #f))))))))
   (current-inspector)
   #f
   '(2)
   #f
   'make-subprocess))
(define make-subprocess
  (|#%name|
   make-subprocess
   (record-constructor
    (make-record-constructor-descriptor struct:subprocess #f #f))))
(define 1/subprocess?3692
  (|#%name| subprocess? (record-predicate struct:subprocess)))
(define 1/subprocess?
  (|#%name|
   subprocess?
   (lambda (v)
     (if (1/subprocess?3692 v)
       #t
       ($value
        (if (impersonator? v) (1/subprocess?3692 (impersonator-val v)) #f))))))
(define subprocess-process3701
  (|#%name| subprocess-process (record-accessor struct:subprocess 0)))
(define subprocess-process
  (|#%name|
   subprocess-process
   (lambda (s)
     (if (1/subprocess?3692 s)
       (subprocess-process3701 s)
       ($value
        (impersonate-ref
         subprocess-process3701
         struct:subprocess
         0
         s
         'subprocess
         'process))))))
(define subprocess-cust-ref3702
  (|#%name| subprocess-cust-ref (record-accessor struct:subprocess 1)))
(define subprocess-cust-ref
  (|#%name|
   subprocess-cust-ref
   (lambda (s)
     (if (1/subprocess?3692 s)
       (subprocess-cust-ref3702 s)
       ($value
        (impersonate-ref
         subprocess-cust-ref3702
         struct:subprocess
         1
         s
         'subprocess
         'cust-ref))))))
(define subprocess-is-group?3703
  (|#%name| subprocess-is-group? (record-accessor struct:subprocess 2)))
(define subprocess-is-group?
  (|#%name|
   subprocess-is-group?
   (lambda (s)
     (if (1/subprocess?3692 s)
       (subprocess-is-group?3703 s)
       ($value
        (impersonate-ref
         subprocess-is-group?3703
         struct:subprocess
         2
         s
         'subprocess
         'is-group?))))))
(define set-subprocess-process!3704
  (|#%name| set-subprocess-process! (record-mutator struct:subprocess 0)))
(define set-subprocess-process!
  (|#%name|
   set-subprocess-process!
   (lambda (s v)
     (if (1/subprocess?3692 s)
       (set-subprocess-process!3704 s v)
       ($value
        (impersonate-set!
         set-subprocess-process!3704
         struct:subprocess
         0
         0
         s
         v
         'subprocess
         'process))))))
(define set-subprocess-cust-ref!3705
  (|#%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?3692 s)
       (set-subprocess-cust-ref!3705 s v)
       ($value
        (impersonate-set!
         set-subprocess-cust-ref!3705
         struct:subprocess
         1
         1
         s
         v
         'subprocess
         'cust-ref))))))
(define effect3706
  (begin
    (register-struct-constructor! make-subprocess)
    (register-struct-predicate! 1/subprocess?)
    (register-struct-field-accessor! subprocess-process struct:subprocess 0)
    (register-struct-field-accessor! subprocess-cust-ref struct:subprocess 1)
    (register-struct-field-accessor! subprocess-is-group? struct:subprocess 2)
    (register-struct-field-mutator!
     set-subprocess-process!
     struct:subprocess
     0)
    (register-struct-field-mutator!
     set-subprocess-cust-ref!
     struct:subprocess
     1)
    (void)))
(define do-subprocess
  (letrec ((maybe-wait_0
            (|#%name|
             maybe-wait
             (lambda (fd_0)
               (begin
                 (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)))))))
    (|#%name|
     subprocess
     (lambda (stdout_0 stdin_0 stderr_0 group/command_0 . command/args_0)
       (begin
         (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))
               (let ((lr3710 unsafe-undefined)
                     (group_0 unsafe-undefined)
                     (command_0 unsafe-undefined)
                     (exact/args_0 unsafe-undefined))
                 (set! lr3710
                   (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?"
                           (check-not-unsafe-undefined command_0 '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_1 (car command/args_0)))
                                (begin
                                  (if (path-string? command_1)
                                    (void)
                                    (raise-argument-error
                                     'subprocess
                                     "path-string?"
                                     command_1))
                                  (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_1
                                   (cdr command/args_0)))))
                            (raise-argument-error
                             'subprocess
                             "(or/c path-string? #f 'new subprocess?)"
                             group/command_0)))))
                    (case-lambda
                     ((group_1 command_1 exact/args_1)
                      (vector group_1 command_1 exact/args_1))
                     (args (raise-binding-result-arity-error 3 args)))))
                 (set! group_0 (unsafe-vector*-ref lr3710 0))
                 (set! command_0 (unsafe-vector*-ref lr3710 1))
                 (set! exact/args_0 (unsafe-vector*-ref lr3710 2))
                 (call-with-values
                  (lambda ()
                    (if (if (pair? exact/args_0)
                          (eq? 'exact (car exact/args_0))
                          #f)
                      (values #t (cdr exact/args_0))
                      (values #f exact/args_0)))
                  (case-lambda
                   ((exact?_0 args_0)
                    (begin
                      (begin
                        (letrec*
                         ((for-loop_0
                           (|#%name|
                            for-loop
                            (lambda (lst_0 pos_0)
                              (begin
                                (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)))
                      (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 ((command-bstr_0
                                         (->host
                                          (->path
                                           (check-not-unsafe-undefined
                                            command_0
                                            'command_0))
                                          'subprocess
                                          '(execute))))
                                    (begin
                                      (maybe-wait_0 stdout_0)
                                      (begin
                                        (if (eq? stderr_0 'stdout)
                                          (void)
                                          (maybe-wait_0 stderr_0))
                                        (begin
                                          (unsafe-start-atomic)
                                          (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)))
                                                    (begin
                                                      (letrec*
                                                       ((for-loop_0
                                                         (|#%name|
                                                          for-loop
                                                          (lambda (lst_1)
                                                            (begin
                                                              (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
                                                            (begin
                                                              (letrec*
                                                               ((for-loop_0
                                                                 (|#%name|
                                                                  for-loop
                                                                  (lambda (fold-var_0
                                                                           lst_0)
                                                                    (begin
                                                                      (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)
                                                                                               (|#%app|
                                                                                                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)
                                                                            (let ((app_4
                                                                                   subprocess-process))
                                                                              (|#%app|
                                                                               app_4
                                                                               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_3))))))))
                                                      (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
                                                                          (format-rktio-message
                                                                           'subprocess
                                                                           r_0
                                                                           base-msg_0)))
                                                                     (|#%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
                                                                         (let ((app_0
                                                                                (|#%app|
                                                                                 rktio_process_result_process
                                                                                 r_0)))
                                                                           (make-subprocess
                                                                            app_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)))))))))))))))))))))))))))
                   (args (raise-binding-result-arity-error 2 args)))))))))))))
(define 1/subprocess-wait
  (|#%name|
   subprocess-wait
   (lambda (sp_0)
     (begin
       (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
       (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)
                   (|#%app| subprocess-process sp_0))))
             (if (vector? r_0)
               (begin
                 (unsafe-end-atomic)
                 (let ((base-msg_0 "status access failed"))
                   (raise
                    (let ((app_0
                           (format-rktio-message
                            'subprocess-status
                            r_0
                            base-msg_0)))
                      (|#%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
       (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)
            (|#%app| subprocess-process sp_0))
           (unsafe-end-atomic)))))))
(define kill-subprocess
  (lambda (sp_0)
    (let ((p_0 (|#%app| 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 (|#%app| 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
       (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 subprocess-will-executor (make-will-executor))
(define register-subprocess-finalizer
  (letrec ((procz1
            (lambda (sp_0)
              (begin
                (if (|#%app| subprocess-process sp_0)
                  (begin
                    (|#%app|
                     rktio_process_forget
                     (unsafe-place-local-ref cell.1)
                     (|#%app| subprocess-process sp_0))
                    (set-subprocess-process! sp_0 #f))
                  (void))
                (no-custodian! sp_0)
                #t))))
    (lambda (sp_0) (will-register subprocess-will-executor sp_0 procz1))))
(define poll-subprocess-finalizations
  (lambda ()
    (if (will-try-execute subprocess-will-executor)
      (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/shell-execute
  (letrec ((procz1 (lambda () 0)))
    (|#%name|
     shell-execute
     (lambda (verb_0 target_0 parameters_0 dir_0 show-mode_0)
       (begin
         (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 procz1)
                                 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 ((err_0 "failed"))
                           (raise
                            (let ((app_0
                                   (format-rktio-message 'who err_0 r_0)))
                              (|#%app|
                               exn:fail
                               app_0
                               (current-continuation-marks)))))
                         (void))
                       #f))))))))))))
(define effect3784
  (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 ()
     (begin (|#%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 (format-rktio-message who_0 err_0 base-msg_0)))
        (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 ((app_0 (symbol->string who_0)))
                (string-append
                 app_0
                 ": "
                 msg_0
                 "\n  socket: "
                 (let ((app_1 (error-value->string-handler)))
                   (|#%app| app_1 u_0 (error-print-width)))))))
         (|#%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 struct:tcp-input-port
  (make-record-type-descriptor*
   'tcp-input-port
   struct:fd-input-port
   #f
   #f
   #f
   1
   1))
(define effect3804
  (struct-type-install-properties!
   struct:tcp-input-port
   '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 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 effect3805
  (begin
    (register-struct-constructor! create-tcp-input-port)
    (register-struct-predicate! tcp-input-port?)
    (register-struct-field-accessor!
     tcp-input-port-abandon?
     struct:tcp-input-port
     0)
    (register-struct-field-mutator!
     set-tcp-input-port-abandon?!
     struct:tcp-input-port
     0)
    (void)))
(define struct:tcp-input-port-methods.1
  (make-record-type-descriptor*
   'tcp-input-port-methods
   struct:fd-input-port-methods.1
   #f
   #f
   #f
   0
   0))
(define effect3807
  (struct-type-install-properties!
   struct:tcp-input-port-methods.1
   'tcp-input-port-methods
   0
   0
   struct:fd-input-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'tcp-input-port-methods))
(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?.13806
  (|#%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?.13806 v)
       #t
       ($value
        (if (impersonator? v)
          (tcp-input-port-methods?.13806 (impersonator-val v))
          #f))))))
(define effect3808
  (begin
    (register-struct-constructor! tcp-input-port-methods1.1)
    (register-struct-predicate! tcp-input-port-methods?.1)
    (void)))
(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)))
                        (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
                         (peek-via-read-input-port-methods-read-in/inner.1
                          fd-input-port-vtable.1)
                         (|#%name|
                          on-close
                          (lambda (this-id_0)
                            (begin
                              (if (tcp-input-port-abandon? this-id_0)
                                (void)
                                (|#%app|
                                 rktio_socket_shutdown
                                 (unsafe-place-local-ref cell.1)
                                 (|#%app| fd-input-port-fd this-id_0)
                                 0)))))
                         (|#%name|
                          raise-read-error
                          (lambda (this-id_0 n50_0)
                            (begin
                              (raise-network-error
                               #f
                               n50_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)
     (begin
       (let ((fd-refcount_0
              (if (eq? fd-refcount2_0 unsafe-undefined)
                (box 1)
                fd-refcount2_0)))
         (let ((temp80_0
                (create-tcp-input-port
                 tcp-input-port-vtable.1
                 name5_0
                 (direct2.1 #f 0 0)
                 #f
                 #f
                 0
                 #f
                 #f
                 #f
                 #f
                 #f
                 (make-bytes 4096)
                 0
                 0
                 #f
                 'block
                 fd4_0
                 fd-refcount_0
                 #f
                 #f)))
           (finish-fd-input-port.1 unsafe-undefined temp80_0)))))))
(define struct:tcp-output-port
  (make-record-type-descriptor*
   'tcp-output-port
   struct:fd-output-port
   #f
   #f
   #f
   1
   1))
(define effect3824
  (struct-type-install-properties!
   struct:tcp-output-port
   '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 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 effect3825
  (begin
    (register-struct-constructor! create-tcp-output-port)
    (register-struct-predicate! tcp-output-port?)
    (register-struct-field-accessor!
     tcp-output-port-abandon?
     struct:tcp-output-port
     0)
    (register-struct-field-mutator!
     set-tcp-output-port-abandon?!
     struct:tcp-output-port
     0)
    (void)))
(define struct:tcp-output-port-methods.1
  (make-record-type-descriptor*
   'tcp-output-port-methods
   struct:fd-output-port-methods.1
   #f
   #f
   #f
   0
   0))
(define effect3827
  (struct-type-install-properties!
   struct:tcp-output-port-methods.1
   'tcp-output-port-methods
   0
   0
   struct:fd-output-port-methods.1
   null
   (current-inspector)
   #f
   '()
   #f
   'tcp-output-port-methods))
(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?.13826
  (|#%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?.13826 v)
       #t
       ($value
        (if (impersonator? v)
          (tcp-output-port-methods?.13826 (impersonator-val v))
          #f))))))
(define effect3828
  (begin
    (register-struct-constructor! tcp-output-port-methods7.1)
    (register-struct-predicate! tcp-output-port-methods?.1)
    (void)))
(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-port-methods-buffer-mode.1 fd-output-port-vtable.1)))
            (let ((app_5
                   (core-output-port-methods-write-out.1
                    fd-output-port-vtable.1)))
              (let ((app_6
                     (core-output-port-methods-write-out-special.1
                      fd-output-port-vtable.1)))
                (let ((app_7
                       (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
                   app_4
                   app_5
                   app_6
                   app_7
                   (core-output-port-methods-get-write-special-evt.1
                    fd-output-port-vtable.1)
                   (|#%name|
                    on-close
                    (lambda (this-id_0)
                      (begin
                        (if (tcp-output-port-abandon? this-id_0)
                          (void)
                          (|#%app|
                           rktio_socket_shutdown
                           (unsafe-place-local-ref cell.1)
                           (|#%app| fd-output-port-fd this-id_0)
                           1)))))
                   (|#%name|
                    raise-write-error
                    (lambda (this-id_0 n109_0)
                      (begin
                        (raise-network-error
                         #f
                         n109_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)
     (begin
       (let ((fd-refcount_0
              (if (eq? fd-refcount8_0 unsafe-undefined)
                (box 1)
                fd-refcount8_0)))
         (let ((temp135_0
                (create-tcp-output-port
                 tcp-output-port-vtable.1
                 name11_0
                 (direct2.1 #f 0 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 temp135_0)))))))
(define open-input-output-tcp.1
  (|#%name|
   open-input-output-tcp
   (lambda (close?13_0 fd15_0 name16_0)
     (begin
       (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)
     (begin
       (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)
     (begin
       (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 struct:rktio-evt
  (make-record-type-descriptor* 'rktio-evt #f #f #f #f 2 3))
(define effect3844
  (struct-type-install-properties!
   struct:rktio-evt
   'rktio-evt
   2
   0
   #f
   (list
    (cons prop:authentic #t)
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (self_0 poll-ctx_0)
        (if (|#%app| (|#%app| rktio-evt-poll self_0))
          (values (list self_0) #f)
          (begin
            (sandman-poll-ctx-add-poll-set-adder!
             poll-ctx_0
             (|#%app| rktio-evt-add-to-poll-set self_0))
            (values #f self_0)))))))
   (current-inspector)
   #f
   '(0 1)
   #f
   '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 effect3851
  (begin
    (register-struct-constructor! rktio-evt1.1)
    (register-struct-predicate! rktio-evt?)
    (register-struct-field-accessor! rktio-evt-poll struct:rktio-evt 0)
    (register-struct-field-accessor!
     rktio-evt-add-to-poll-set
     struct:rktio-evt
     1)
    (void)))
(define call-with-resolved-address.1
  (letrec ((procz2
            (lambda (addr_0)
              (|#%app|
               rktio_addrinfo_free
               (unsafe-place-local-ref cell.1)
               addr_0)))
           (procz1
            (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))))))
    (|#%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)
       (begin
         (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
                 (let ((app_0
                        (if hostname17_0
                          (1/string->bytes/utf-8 hostname17_0)
                          #f)))
                   (|#%app|
                    rktio_start_addrinfo_lookup
                    (unsafe-place-local-ref cell.1)
                    app_0
                    (if port-no18_0 port-no18_0 0)
                    family_0
                    passive?6_0
                    tcp?7_0)))
                procz1
                (lambda (lookup-box_0)
                  (let ((lookup_0 (unbox lookup-box_0)))
                    (letrec*
                     ((loop_0
                       (|#%name|
                        loop
                        (lambda ()
                          (begin
                            (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))
                                 procz2
                                 (lambda (addr_0)
                                   (if (if who1_0 (vector? addr_0) #f)
                                     (raise-network-error
                                      who1_0
                                      addr_0
                                      (let ((app_0
                                             (if hostname17_0
                                               hostname17_0
                                               "<unspec>")))
                                        (string-append
                                         "can't resolve "
                                         which2_0
                                         "address"
                                         "\n  address: "
                                         app_0
                                         (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 address-will-executor (make-will-executor))
(define register-address-finalizer
  (letrec ((procz1
            (lambda (addr_0)
              (begin
                (|#%app|
                 rktio_addrinfo_free
                 (unsafe-place-local-ref cell.1)
                 addr_0)
                #t))))
    (lambda (addr_0) (will-register address-will-executor addr_0 procz1))))
(define poll-address-finalizations
  (lambda ()
    (if (will-try-execute address-will-executor)
      (poll-address-finalizations)
      (void))))
(define struct:connect-progress
  (make-record-type-descriptor* 'connect-progress #f #f #f #f 2 3))
(define effect3865
  (struct-type-install-properties!
   struct:connect-progress
   'connect-progress
   2
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   '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 effect3866
  (begin
    (register-struct-constructor! connect-progress1.1)
    (register-struct-predicate! connect-progress?)
    (register-struct-field-accessor!
     connect-progress-conn
     struct:connect-progress
     0)
    (register-struct-field-accessor!
     connect-progress-trying-fd
     struct:connect-progress
     1)
    (register-struct-field-mutator!
     set-connect-progress-conn!
     struct:connect-progress
     0)
    (register-struct-field-mutator!
     set-connect-progress-trying-fd!
     struct:connect-progress
     1)
    (void)))
(define 1/tcp-connect
  (let ((tcp-connect_0
         (|#%name|
          tcp-connect
          (lambda (hostname4_0 port-no5_0 local-hostname2_0 local-port-no3_0)
            (begin
              (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)
       (begin (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)
            (begin
              (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)
       (begin (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
  (letrec ((procz1
            (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))))))
           (raise-connect-error_0
            (|#%name|
             raise-connect-error
             (case-lambda
              ((hostname15_0 port-no16_0 who14_0 err_0)
               (begin
                 (raise-connect-error_1
                  hostname15_0
                  port-no16_0
                  who14_0
                  err_0
                  unsafe-undefined
                  unsafe-undefined
                  unsafe-undefined)))
              ((hostname15_0
                port-no16_0
                who14_0
                err_0
                what_0
                hostname_0
                port-no34_0)
               (raise-connect-error_1
                hostname15_0
                port-no16_0
                who14_0
                err_0
                what_0
                hostname_0
                port-no34_0))
              ((hostname15_0 port-no16_0 who14_0 err_0 what_0 hostname33_0)
               (raise-connect-error_1
                hostname15_0
                port-no16_0
                who14_0
                err_0
                what_0
                hostname33_0
                unsafe-undefined))
              ((hostname15_0 port-no16_0 who14_0 err_0 what32_0)
               (raise-connect-error_1
                hostname15_0
                port-no16_0
                who14_0
                err_0
                what32_0
                unsafe-undefined
                unsafe-undefined)))))
           (raise-connect-error_1
            (|#%name|
             raise-connect-error
             (lambda (hostname15_0
                      port-no16_0
                      who14_0
                      err35_0
                      what32_0
                      hostname33_0
                      port-no34_0)
               (begin
                 (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)
                               "")))))))))))))
    (|#%name|
     do-tcp-connect
     (lambda (enable-break?10_0
              who14_0
              hostname15_0
              port-no16_0
              local-hostname12_0
              local-port-no13_0)
       (begin
         (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))
                   (begin
                     (1/security-guard-check-network
                      who14_0
                      hostname15_0
                      port-no16_0
                      'client)
                     (unsafe-start-atomic)
                     (begin0
                       (let ((temp39_0
                              (|#%name|
                               temp39
                               (lambda (remote-addr_0)
                                 (begin
                                   (if (vector? remote-addr_0)
                                     (raise-connect-error_0
                                      hostname15_0
                                      port-no16_0
                                      who14_0
                                      remote-addr_0
                                      "host not found")
                                     (let ((temp43_0
                                            (|#%name|
                                             temp43
                                             (lambda (local-addr_0)
                                               (begin
                                                 (if (vector? local-addr_0)
                                                   (raise-connect-error_0
                                                    hostname15_0
                                                    port-no16_0
                                                    who14_0
                                                    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)
                                                    procz1
                                                    (lambda (conn-prog_0)
                                                      (let ((conn_0
                                                             (connect-progress-conn
                                                              conn-prog_0)))
                                                        (if (vector? conn_0)
                                                          (raise-connect-error_0
                                                           hostname15_0
                                                           port-no16_0
                                                           who14_0
                                                           conn_0)
                                                          (letrec*
                                                           ((loop_0
                                                             (|#%name|
                                                              loop
                                                              (lambda ()
                                                                (begin
                                                                  (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_0
                                                                                 hostname15_0
                                                                                 port-no16_0
                                                                                 who14_0
                                                                                 fd_0)))
                                                                            (let ((name_0
                                                                                   (string->immutable-string
                                                                                    hostname15_0)))
                                                                              (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 struct:tcp-listener
  (make-record-type-descriptor* 'tcp-listener #f #f #f #f 3 7))
(define effect3879
  (struct-type-install-properties!
   struct:tcp-listener
   'tcp-listener
   3
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app| poller (lambda (l_0 ctx_0) (|#%app| poll-listener l_0 ctx_0)))))
   (current-inspector)
   #f
   '(0 1 2)
   #f
   'tcp-listener))
(define tcp-listener1.1
  (|#%name|
   tcp-listener
   (record-constructor
    (make-record-constructor-descriptor struct:tcp-listener #f #f))))
(define 1/tcp-listener?3878
  (|#%name| tcp-listener? (record-predicate struct:tcp-listener)))
(define 1/tcp-listener?
  (|#%name|
   tcp-listener?
   (lambda (v)
     (if (1/tcp-listener?3878 v)
       #t
       ($value
        (if (impersonator? v)
          (1/tcp-listener?3878 (impersonator-val v))
          #f))))))
(define tcp-listener-lnr3883
  (|#%name| tcp-listener-lnr (record-accessor struct:tcp-listener 0)))
(define tcp-listener-lnr
  (|#%name|
   tcp-listener-lnr
   (lambda (s)
     (if (1/tcp-listener?3878 s)
       (tcp-listener-lnr3883 s)
       ($value
        (impersonate-ref
         tcp-listener-lnr3883
         struct:tcp-listener
         0
         s
         'tcp-listener
         'lnr))))))
(define tcp-listener-closed3884
  (|#%name| tcp-listener-closed (record-accessor struct:tcp-listener 1)))
(define tcp-listener-closed
  (|#%name|
   tcp-listener-closed
   (lambda (s)
     (if (1/tcp-listener?3878 s)
       (tcp-listener-closed3884 s)
       ($value
        (impersonate-ref
         tcp-listener-closed3884
         struct:tcp-listener
         1
         s
         'tcp-listener
         'closed))))))
(define tcp-listener-custodian-reference3885
  (|#%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?3878 s)
       (tcp-listener-custodian-reference3885 s)
       ($value
        (impersonate-ref
         tcp-listener-custodian-reference3885
         struct:tcp-listener
         2
         s
         'tcp-listener
         'custodian-reference))))))
(define effect3886
  (begin
    (register-struct-constructor! tcp-listener1.1)
    (register-struct-predicate! 1/tcp-listener?)
    (register-struct-field-accessor! tcp-listener-lnr struct:tcp-listener 0)
    (register-struct-field-accessor! tcp-listener-closed struct:tcp-listener 1)
    (register-struct-field-accessor!
     tcp-listener-custodian-reference
     struct:tcp-listener
     2)
    (void)))
(define 1/tcp-listen
  (let ((tcp-listen_0
         (letrec ((loop_0
                   (|#%name|
                    loop
                    (lambda (hostname4_0
                             max-allow-wait2_0
                             port-no5_0
                             reuse?3_0
                             family_0)
                      (begin
                        (|#%app|
                         (begin
                           (unsafe-start-atomic)
                           (begin0
                             (let ((temp12_0
                                    (|#%name|
                                     temp12
                                     (lambda (addr_0)
                                       (begin
                                         (if (vector? addr_0)
                                           (raise-listen-error_0
                                            hostname4_0
                                            port-no5_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
                                                      hostname4_0
                                                      max-allow-wait2_0
                                                      port-no5_0
                                                      reuse?3_0
                                                      (|#%app|
                                                       rktio_get_ipv4_family
                                                       (unsafe-place-local-ref
                                                        cell.1))))
                                                   (raise-listen-error_0
                                                    hostname4_0
                                                    port-no5_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))))))))
                  (raise-listen-error_0
                   (|#%name|
                    raise-listen-error
                    (lambda (hostname4_0 port-no5_0 what_0 err_0)
                      (begin
                        (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))))))))))
           (|#%name|
            tcp-listen
            (lambda (port-no5_0 max-allow-wait2_0 reuse?3_0 hostname4_0)
              (begin
                (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))
                      (begin
                        (1/security-guard-check-network
                         'tcp-listen
                         hostname4_0
                         port-no5_0
                         'server)
                        (loop_0
                         hostname4_0
                         max-allow-wait2_0
                         port-no5_0
                         reuse?3_0
                         -1)))))))))))
    (|#%name|
     tcp-listen
     (case-lambda
      ((port-no_0) (begin (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
       (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) (begin (do-tcp-accept.1 #f 'tcp-accept listener_0)))))
(define 1/tcp-accept/enable-break
  (|#%name|
   tcp-accept/enable-break
   (lambda (listener_0)
     (begin (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
       (begin
         (if (1/tcp-listener? listener4_0)
           (void)
           (raise-argument-error who3_0 "tcp-listener?" listener4_0))
         (letrec*
          ((loop_0
            (|#%name|
             loop
             (lambda ()
               (begin
                 (begin
                   (unsafe-start-atomic)
                   (if (unbox (tcp-listener-closed listener4_0))
                     (|#%app| closed-error who3_0 listener4_0)
                     (if (|#%app| 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
                               (|#%app| open-input-output-accetped-tcp fd_0)
                               (unsafe-end-atomic)))))
                       (begin
                         (unsafe-end-atomic)
                         (sync
                          (rktio-evt1.1
                           (lambda ()
                             (let ((or-part_0
                                    (unbox (tcp-listener-closed listener4_0))))
                               (if or-part_0
                                 or-part_0
                                 (|#%app| 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
       (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))
           (|#%app| closed-error 'tcp-accept-ready? listener_0)
           (|#%app| accept-ready? listener_0)))))))
(define 1/tcp-accept-evt
  (|#%name|
   tcp-accept-evt
   (lambda (listener_0)
     (begin
       (begin
         (if (1/tcp-listener? listener_0)
           (void)
           (raise-argument-error 'tcp-accept-evt "tcp-listener?" listener_0))
         (accept-evt6.1 listener_0))))))
(define struct:accept-evt
  (make-record-type-descriptor* 'tcp-accept-evt #f #f #f #f 1 1))
(define effect3915
  (struct-type-install-properties!
   struct:accept-evt
   'tcp-accept-evt
   1
   0
   #f
   (list
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (self_0 poll-ctx_0)
        (let ((listener_0 (|#%app| accept-evt-listener self_0)))
          (if (unbox (tcp-listener-closed listener_0))
            (|#%app|
             error-result
             (lambda ()
               (begin
                 (unsafe-start-atomic)
                 (|#%app| closed-error 'tcp-accept-evt listener_0))))
            (if (custodian-shut-down? (current-custodian))
              (let ((c_0 (current-custodian)))
                (|#%app|
                 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 (|#%app| 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)
                      (|#%app|
                       error-result
                       (lambda ()
                         (raise-network-error
                          'tcp-accept-evt
                          fd_0
                          "accept from listener failed"))))
                    (values
                     (list
                      (call-with-values
                       (lambda ()
                         (|#%app| open-input-output-accetped-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 accept-evt6.1
  (|#%name|
   accept-evt
   (record-constructor
    (make-record-constructor-descriptor struct:accept-evt #f #f))))
(define accept-evt?3914
  (|#%name| tcp-accept-evt? (record-predicate struct:accept-evt)))
(define accept-evt?
  (|#%name|
   tcp-accept-evt?
   (lambda (v)
     (if (accept-evt?3914 v)
       #t
       ($value
        (if (impersonator? v) (accept-evt?3914 (impersonator-val v)) #f))))))
(define accept-evt-listener3935
  (|#%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?3914 s)
       (accept-evt-listener3935 s)
       ($value
        (impersonate-ref
         accept-evt-listener3935
         struct:accept-evt
         0
         s
         'tcp-accept-evt
         'listener))))))
(define effect3936
  (begin
    (register-struct-constructor! accept-evt6.1)
    (register-struct-predicate! accept-evt?)
    (register-struct-field-accessor! accept-evt-listener struct:accept-evt 0)
    (void)))
(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-accetped-tcp
  (lambda (fd_0)
    (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 ()
       (begin (check-string s_0) (values s_0 (unsafe-string-length s_0))))
     (case-lambda
      ((vec_0 len_0)
       (begin
         #f
         (letrec*
          ((for-loop_0
            (|#%name|
             for-loop
             (lambda (v_0 pos_0)
               (begin
                 (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))))
      (args (raise-binding-result-arity-error 2 args))))))
(define struct:udp (make-record-type-descriptor* 'udp #f #f #f #f 3 7))
(define effect3944
  (struct-type-install-properties!
   struct:udp
   'udp
   3
   0
   #f
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   '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 (|#%name| udp-s (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 set-udp-s! (|#%name| set-udp-s! (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 effect3945
  (begin
    (register-struct-constructor! udp1.1)
    (register-struct-predicate! 1/udp?)
    (register-struct-field-accessor! udp-s struct:udp 0)
    (register-struct-field-accessor! udp-is-bound? struct:udp 1)
    (register-struct-field-accessor! udp-is-connected? struct:udp 2)
    (register-struct-field-mutator! set-udp-s! struct:udp 0)
    (register-struct-field-mutator! set-udp-is-bound?! struct:udp 1)
    (register-struct-field-mutator! set-udp-is-connected?! struct:udp 2)
    (void)))
(define 1/udp-open-socket
  (let ((udp-open-socket_0
         (letrec ((procz1
                   (|#%name|
                    temp21
                    (lambda (addr_0)
                      (begin
                        (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"))
                            (udp1.1 s_0 #f #f))))))))
           (|#%name|
            udp-open-socket
            (lambda (family-hostname2_0 family-port-no3_0)
              (begin
                (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 procz1))
                      (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
      (() (begin (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 1/udp-close
  (|#%name|
   udp-close
   (lambda (u_0)
     (begin
       (begin
         (if (1/udp? u_0) (void) (raise-argument-error 'udp-close "udp?" u_0))
         (unsafe-start-atomic)
         (begin0
           (if (udp-s u_0)
             (begin
               (|#%app|
                rktio_close
                (unsafe-place-local-ref cell.1)
                (udp-s u_0))
               (set-udp-s! u_0 #f))
             (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
       (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
              (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
                         (|#%name|
                          temp30
                          (lambda (addr_0)
                            (begin
                              (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)
                                          (udp-s u5_0)
                                          addr_0
                                          reuse?4_0)))
                                    (begin
                                      (if (vector? b_0)
                                        (begin
                                          (unsafe-end-atomic)
                                          (raise-network-error
                                           'udp-bind!
                                           b_0
                                           (let ((app_0
                                                  (if reuse?4_0
                                                    " as reusable"
                                                    "")))
                                             (let ((app_1
                                                    (if hostname6_0
                                                      hostname6_0
                                                      "<unspec>")))
                                               (string-append
                                                "can't bind"
                                                app_0
                                                "\n  address: "
                                                app_1
                                                "\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)
       (begin (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
       (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
       (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)
                         (udp-s 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
                    (|#%name|
                     temp41
                     (lambda (addr_0)
                       (begin
                         (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)
                                   (udp-s 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)
     (begin
       (let ((handle-error_0
              (if (eq? handle-error8_0 unsafe-undefined)
                handle-error-immediately
                handle-error8_0)))
         (if (udp-s 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
       (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)
                     (udp-s 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
       (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)
                     (udp-s 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
         (letrec ((convert_0
                   (|#%name|
                    convert
                    (lambda (bstr_0)
                      (begin (1/bytes->string/utf-8 bstr_0 '#\x3f))))))
           (|#%name|
            tcp-addresses
            (lambda (p2_0 port-numbers?1_0)
              (begin
                (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)
                                    (udp-s 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))))))
                     (case-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 ((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))))))))))
                      (args
                       (raise-binding-result-arity-error 2 args))))))))))))
    (|#%name|
     tcp-addresses
     (case-lambda
      ((p_0) (begin (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)
            (begin
              (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) (begin (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)
            (begin
              (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) (begin (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)
            (begin
              (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)
       (begin (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)
            (begin
              (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)
       (begin
         (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)
            (begin
              (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)
       (begin
         (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)
            (begin
              (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)
       (begin
         (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)
            (begin
              (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) (begin (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)
            (begin
              (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)
       (begin
         (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
       (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 (udp-s u_0))))
              (if or-part_0
                or-part_0
                (not
                 (eqv?
                  (|#%app|
                   rktio_poll_write_ready
                   (unsafe-place-local-ref cell.1)
                   (udp-s u_0))
                  0)))))
          (lambda (ps_0)
            (|#%app|
             rktio_poll_add
             (unsafe-place-local-ref cell.1)
             (udp-s 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
       (begin
         (unsafe-start-atomic)
         (begin0
           (let ((temp127_0
                  (|#%name|
                   temp127
                   (lambda (addr_0)
                     (begin
                       (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
  (letrec ((procz1 (lambda (thunk_0) thunk_0)))
    (lambda (who_0 u_0 hostname_0 port-no_0 bstr_0 start_0 end_0)
      (begin
        (unsafe-start-atomic)
        (begin0
          (let ((temp141_0
                 (|#%name|
                  temp141
                  (lambda (addr_0)
                    (begin
                      (udp-sending-evt66.1
                       u_0
                       (lambda ()
                         (begin
                           (if addr_0
                             (register-address-finalizer addr_0)
                             (void))
                           (let ((temp149_0 procz1))
                             (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
  (letrec ((loop_0
            (|#%name|
             loop
             (lambda (addr61_0
                      bstr62_0
                      enable-break?54_0
                      end64_0
                      handle-error_0
                      start63_0
                      u60_0
                      wait?53_0
                      who59_0)
               (begin
                 (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)
                                        (udp-s 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 (udp-s u60_0))))
                                                (if or-part_0
                                                  or-part_0
                                                  (not
                                                   (eqv?
                                                    (|#%app|
                                                     rktio_poll_write_ready
                                                     (unsafe-place-local-ref
                                                      cell.1)
                                                     (udp-s u60_0))
                                                    0)))))
                                            (lambda (ps_0)
                                              (|#%app|
                                               rktio_poll_add
                                               (unsafe-place-local-ref cell.1)
                                               (udp-s u60_0)
                                               ps_0
                                               2))))
                                          (unsafe-start-atomic)
                                          (loop_0
                                           addr61_0
                                           bstr62_0
                                           enable-break?54_0
                                           end64_0
                                           handle-error_0
                                           start63_0
                                           u60_0
                                           wait?53_0
                                           who59_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)))))))
    (|#%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)
       (begin
         (let ((handle-error_0
                (if (eq? handle-error55_0 unsafe-undefined)
                  handle-error-immediately
                  handle-error55_0)))
           (loop_0
            addr61_0
            bstr62_0
            enable-break?54_0
            end64_0
            handle-error_0
            start63_0
            u60_0
            wait?53_0
            who59_0)))))))
(define struct:udp-sending-evt
  (make-record-type-descriptor* 'udp-send-evt #f #f #f #f 2 3))
(define effect4001
  (struct-type-install-properties!
   struct:udp-sending-evt
   'udp-send-evt
   2
   0
   #f
   (list
    (cons prop:authentic #t)
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (self_0 poll-ctx_0)
        (let ((try_0 (|#%app| 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)
                      (udp-s (|#%app| udp-sending-evt-u self_0))
                      ps_0
                      1)))
                  (values #f self_0))))))))))
   (current-inspector)
   #f
   '(0 1)
   #f
   '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 effect4009
  (begin
    (register-struct-constructor! udp-sending-evt66.1)
    (register-struct-predicate! udp-sending-evt?)
    (register-struct-field-accessor!
     udp-sending-evt-u
     struct:udp-sending-evt
     0)
    (register-struct-field-accessor!
     udp-sending-evt-try
     struct:udp-sending-evt
     1)
    (void)))
(define struct:udp-sending-ready-evt
  (make-record-type-descriptor*
   'udp-send-ready-evt
   struct:rktio-evt
   #f
   #f
   #f
   0
   0))
(define effect4010
  (struct-type-install-properties!
   struct:udp-sending-ready-evt
   'udp-send-ready-evt
   0
   0
   struct:rktio-evt
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   '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 effect4011
  (begin
    (register-struct-constructor! udp-sending-ready-evt67.1)
    (register-struct-predicate! udp-sending-ready-evt?)
    (void)))
(define 1/udp-receive!
  (let ((udp-receive!_0
         (|#%name|
          udp-receive!
          (lambda (u3_0 bstr4_0 start1_0 end2_0)
            (begin
              (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) (begin (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)
            (begin
              (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) (begin (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)
            (begin
              (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)
       (begin (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
       (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
         (letrec ((procz1 (lambda (thunk_0) thunk_0)))
           (|#%name|
            udp-receive!-evt
            (lambda (u25_0 bstr26_0 start23_0 end24_0)
              (begin
                (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 procz1))
                         (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) (begin (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
       (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 (udp-s u_0))))
              (if or-part_0
                or-part_0
                (not
                 (eqv?
                  (|#%app|
                   rktio_poll_read_ready
                   (unsafe-place-local-ref cell.1)
                   (udp-s u_0))
                  0)))))
          (lambda (ps_0)
            (|#%app|
             rktio_poll_add
             (unsafe-place-local-ref cell.1)
             (udp-s 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
  (letrec ((loop_0
            (|#%name|
             loop
             (lambda (bstr35_0
                      enable-break?28_0
                      end37_0
                      handle-error_0
                      start36_0
                      u34_0
                      wait?27_0
                      who33_0)
               (begin
                 (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)
                                    (udp-s 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 (udp-s u34_0))))
                                            (if or-part_0
                                              or-part_0
                                              (not
                                               (eqv?
                                                (|#%app|
                                                 rktio_poll_read_ready
                                                 (unsafe-place-local-ref
                                                  cell.1)
                                                 (udp-s u34_0))
                                                0)))))
                                        (lambda (ps_0)
                                          (|#%app|
                                           rktio_poll_add
                                           (unsafe-place-local-ref cell.1)
                                           (udp-s u34_0)
                                           ps_0
                                           1))))
                                      (unsafe-start-atomic)
                                      (loop_0
                                       bstr35_0
                                       enable-break?28_0
                                       end37_0
                                       handle-error_0
                                       start36_0
                                       u34_0
                                       wait?27_0
                                       who33_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 (bytes=?
                                                  (car address_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)))))))
    (|#%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)
       (begin
         (let ((handle-error_0
                (if (eq? handle-error29_0 unsafe-undefined)
                  handle-error-immediately
                  handle-error29_0)))
           (loop_0
            bstr35_0
            enable-break?28_0
            end37_0
            handle-error_0
            start36_0
            u34_0
            wait?27_0
            who33_0)))))))
(define cell.1$2 (unsafe-make-place-local #vu8()))
(define cell.2 (unsafe-make-place-local ""))
(define struct:udp-receiving-evt
  (make-record-type-descriptor* 'udp-receive-evt #f #f #f #f 2 3))
(define effect4034
  (struct-type-install-properties!
   struct:udp-receiving-evt
   'udp-receive-evt
   2
   0
   #f
   (list
    (cons prop:authentic #t)
    (cons
     prop:evt
     (|#%app|
      poller
      (lambda (self_0 poll-ctx_0)
        (let ((try_0 (|#%app| 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)
                     (udp-s (|#%app| udp-receiving-evt-u self_0))
                     ps_0
                     2)))
                 (values #f self_0)))))))))))
   (current-inspector)
   #f
   '(0 1)
   #f
   '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 effect4042
  (begin
    (register-struct-constructor! udp-receiving-evt39.1)
    (register-struct-predicate! udp-receiving-evt?)
    (register-struct-field-accessor!
     udp-receiving-evt-u
     struct:udp-receiving-evt
     0)
    (register-struct-field-accessor!
     udp-receiving-evt-try
     struct:udp-receiving-evt
     1)
    (void)))
(define struct:udp-receiving-ready-evt
  (make-record-type-descriptor*
   'udp-receive-ready-evt
   struct:rktio-evt
   #f
   #f
   #f
   0
   0))
(define effect4043
  (struct-type-install-properties!
   struct:udp-receiving-ready-evt
   'udp-receive-ready-evt
   0
   0
   struct:rktio-evt
   (list (cons prop:authentic #t))
   (current-inspector)
   #f
   '()
   #f
   '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 effect4044
  (begin
    (register-struct-constructor! udp-receiving-ready-evt40.1)
    (register-struct-predicate! udp-receiving-ready-evt?)
    (void)))
(define 1/udp-set-receive-buffer-size!
  (|#%name|
   udp-set-receive-buffer-size!
   (lambda (u_0 size_0)
     (begin
       (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)
                       (udp-s 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
       (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
            (1/format
             (string-append "~a: given size is too large\n" "  given size: ~e")
             who_0
             size_0)))
       (|#%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)
     (begin
       (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)
     (begin
       (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
                   (|#%name|
                    temp10
                    (lambda (multicast-addr_0)
                      (begin
                        (let ((temp12_0 "interface "))
                          (let ((temp15_0 (if hostname_0 -1 #f)))
                            (let ((temp16_0 (udp-default-family)))
                              (let ((temp18_0
                                     (|#%name|
                                      temp18
                                      (lambda (intf-addr_0)
                                        (begin
                                          (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)
                                                    (udp-s 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
       (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)
                     (udp-s 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
       (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
                      (|#%name|
                       temp31
                       (lambda (addr_0)
                         (begin
                           (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)
                                     (udp-s 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
       (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)
                     (udp-s 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
       (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)
                     (udp-s 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
       (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)
                     (udp-s 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
       (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)
                     (udp-s 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
                                 (let ((app_1 path-bytes))
                                   (|#%app| app_1 (->path dll-name_0)))
                                 '#\x3f)
                                "[all opened]")))))
                      (if err-str_0
                        (raise
                         (let ((app_0
                                (let ((app_0 (symbol->string who_0)))
                                  (string-append
                                   app_0
                                   ": "
                                   msg_0
                                   "\n  system error: "
                                   (->string err-str_0)))))
                           (|#%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 ((app_0 (symbol->string who_0)))
                (string-append
                 app_0
                 ": "
                 msg_0
                 "\n  system error: "
                 (->string err-str_0)))))
         (|#%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
       (|#%app|
        exn:fail:unsupported
        "default-load-extension: extensions are not supported"
        (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 1/unsafe-poller
  (|#%name|
   unsafe-poller
   (lambda (proc_0)
     (begin
       (|#%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))
             (case-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))
                    (case-lambda
                     ((vals_1 evt_1)
                      (begin
                        (if vals_1
                          (sandman-poll-ctx-merge-timeout
                           poll-ctx_0
                           (current-inexact-milliseconds))
                          (void))
                        (values #f self_0)))
                     (args (raise-binding-result-arity-error 2 args))))
                   (values #f evt_0))))
              (args (raise-binding-result-arity-error 2 args)))))))))))
(define 1/unsafe-poll-ctx-fd-wakeup
  (|#%name|
   unsafe-poll-ctx-fd-wakeup
   (lambda (poll-ctx_0 fd_0 mode_0)
     (begin
       (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)
     (begin
       (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)
     (begin
       (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 ()
     (begin (|#%app| rktio_signal_received (unsafe-place-local-ref cell.1))))))
(define 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)
     (begin (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
       (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 read?_0 1 0)))
                       (let ((app_1 (if write?_0 2 0)))
                         (let ((app_2 (if (memq 'text mode_0) 4 0)))
                           (bitwise-ior
                            app_0
                            app_1
                            app_2
                            (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
       (let ((temp11_0 (string->symbol (1/bytes->string/utf-8 name_0))))
         (let ((temp12_0 (not (memq 'no-close mode_0))))
           (let ((temp11_1 temp11_0))
             (open-input-output-tcp.1 temp12_0 system-fd_0 temp11_1))))))))
(define 1/unsafe-port->file-descriptor
  (|#%name|
   unsafe-port->file-descriptor
   (lambda (p_0)
     (begin
       (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)
     (begin (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
      (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)
     (begin (unsafe-fd->semaphore system-fd_0 mode_0 #f)))))
(define 1/unsafe-socket->semaphore
  (|#%name|
   unsafe-socket->semaphore
   (lambda (system-fd_0 mode_0)
     (begin (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
              (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) (begin (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 windows-version-table
  (let ((or-part_0 (primitive-table '|#%windows-version|)))
    (if or-part_0
      or-part_0
      (error '|#%windows-version| "windows-version not supported by host"))))
(define get-windows-version
  (hash-ref windows-version-table 'get-windows-version))
(define uname-paths
  (list
   "/bin/uname"
   "/usr/bin/uname"
   "/sbin/uname"
   "/usr/sbin/uname"
   "/usr/local/bin/uname"
   "/usr/local/uname"))
(define get-machine-info
  (lambda ()
    (let ((tmp_0 (system-type)))
      (if (eq? tmp_0 'windows)
        (call-with-values
         (lambda () (|#%app| get-windows-version))
         (case-lambda
          ((major_0 minor_0 build-number_0 CSD-vers_0)
           (1/format
            "Windows NT ~a.~a (Build ~a)~a~a"
            major_0
            minor_0
            build-number_0
            (if (equal? CSD-vers_0 #vu8()) "" " ")
            CSD-vers_0))
          (args (raise-binding-result-arity-error 4 args))))
        (call-with-escape-continuation
         (lambda (done_0)
           (begin
             (with-continuation-mark*
              push-authentic
              parameterization-key
              (let ((app_0
                     (continuation-mark-set-first #f parameterization-key)))
                (extend-parameterization
                 app_0
                 1/current-security-guard
                 (1/unsafe-make-security-guard-at-root)))
              (begin
                (begin
                  (letrec*
                   ((for-loop_0
                     (|#%name|
                      for-loop
                      (lambda (lst_0)
                        (begin
                          (if (pair? lst_0)
                            (let ((uname_0 (unsafe-car lst_0)))
                              (let ((rest_0 (unsafe-cdr lst_0)))
                                (begin
                                  (if (1/file-exists? uname_0)
                                    (call-with-values
                                     (lambda ()
                                       (do-subprocess #f #f #f uname_0 "-a"))
                                     (case-lambda
                                      ((subproc_0 stdout_0 stdin_0 stderr_0)
                                       (begin
                                         (1/close-output-port stdin_0)
                                         (begin
                                           (1/close-input-port stderr_0)
                                           (let ((bstr_0
                                                  (1/read-bytes
                                                   1024
                                                   stdout_0)))
                                             (begin
                                               (1/close-input-port stdout_0)
                                               (1/subprocess-wait subproc_0)
                                               (if (bytes? bstr_0)
                                                 (letrec*
                                                  ((loop_0
                                                    (|#%name|
                                                     loop
                                                     (lambda (i_0)
                                                       (begin
                                                         (if (zero? i_0)
                                                           (|#%app| done_0 "")
                                                           (if (char-whitespace?
                                                                (integer->char
                                                                 (unsafe-bytes-ref
                                                                  bstr_0
                                                                  (sub1 i_0))))
                                                             (loop_0
                                                              (sub1 i_0))
                                                             (|#%app|
                                                              done_0
                                                              (1/bytes->string/locale
                                                               (subbytes
                                                                bstr_0
                                                                0
                                                                i_0))))))))))
                                                  (loop_0
                                                   (unsafe-bytes-length
                                                    bstr_0)))
                                                 (void)))))))
                                      (args
                                       (raise-binding-result-arity-error
                                        4
                                        args))))
                                    (void))
                                  (for-loop_0 rest_0))))
                            (values)))))))
                   (for-loop_0 uname-paths)))
                (void)))
             "<unknown machine>")))))))
(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) (andmap2 string? l_0) #f)
           (void)
           (raise-argument-error
            'current-command-line-arguments
            "(vectorof string?)"
            l_0))
         (list->vector (map2 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)
     (with-continuation-mark*
      authentic
      parameterization-key
      (let ((app_0 (continuation-mark-set-first #f parameterization-key)))
        (let ((app_1 installed-read-accept-reader))
          (extend-parameterization
           app_0
           app_1
           #t
           installed-read-accept-lang
           #f)))
      (|#%app| installed-read-syntax src_0 in_0)))
   (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| (|#%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 cell.1$1 (unsafe-make-place-local hash2610))
(define 1/cache-configuration
  (|#%name|
   cache-configuration
   (lambda (index_0 thunk_0)
     (begin
       (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")))
     (case-lambda
      ((parent-in-fd_0 child-in-fd_0)
       (let ((clean-in_0
              (|#%name|
               clean-in
               (lambda ()
                 (begin
                   (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")))
          (case-lambda
           ((parent-out-fd_0 child-out-fd_0)
            (let ((clean-out+in_0
                   (|#%name|
                    clean-out+in
                    (lambda ()
                      (begin
                        (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")))
               (case-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))))
                (args (raise-binding-result-arity-error 2 args))))))
           (args (raise-binding-result-arity-error 2 args))))))
      (args (raise-binding-result-arity-error 2 args))))))
(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
                      (format-rktio-message
                       'dynamic-place
                       new-fd_0
                       base-msg_0)))
                 (|#%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) 0)))
      (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
                      (format-rktio-message 'dynamic-place p_0 base-msg_0)))
                 (|#%app| exn:fail app_0 (current-continuation-marks))))))
          (void))
        (call-with-values
         (lambda () (|#%app| rktio_pipe_results p_0))
         (case-lambda
          ((in_0 out_0) (begin (|#%app| rktio_free p_0) (values in_0 out_0)))
          (args (raise-binding-result-arity-error 2 args))))))))
(define reverse-pipe
  (lambda (cleanup_0 during_0)
    (call-with-values
     (lambda () (pipe cleanup_0 during_0))
     (case-lambda
      ((in_0 out_0) (values out_0 in_0))
      (args (raise-binding-result-arity-error 2 args))))))
(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)
      (sync-locale!))))
(define io-place-destroy! (lambda () (rktio-place-destroy!)))
