Skip to content

Instantly share code, notes, and snippets.

@samth

samth/expander.rktl

Created Feb 2, 2021
Embed
What would you like to do?
This file has been truncated, but you can view the full file.
;; This is not the original source code. Instead, this is the code after
;; fully expanding and flattening into a single linklet.
(module expander '#%kernel
(#%require '#%paramz '#%unsafe '#%flfxnum '#%linklet '#%extfl)
(#%provide
(rename boot boot)
(rename 1/bound-identifier=? bound-identifier=?)
(rename 1/compile compile)
(rename compile-keep-source-locations! compile-keep-source-locations!)
(rename 1/compiled-expression-recompile compiled-expression-recompile)
(rename 1/current-compile current-compile)
(rename 1/current-compiled-file-roots current-compiled-file-roots)
(rename 1/current-eval current-eval)
(rename 1/current-library-collection-links current-library-collection-links)
(rename 1/current-library-collection-paths current-library-collection-paths)
(rename 1/current-load current-load)
(rename 1/current-load/use-compiled current-load/use-compiled)
(rename 1/current-namespace current-namespace)
(rename datum->kernel-syntax datum->kernel-syntax)
(rename 1/datum->syntax datum->syntax)
(rename declare-primitive-module! declare-primitive-module!)
(rename 1/dynamic-require dynamic-require)
(rename embedded-load embedded-load)
(rename 1/eval eval)
(rename eval$1 eval-top-level)
(rename expand$1 expand)
(rename expander-place-init! expander-place-init!)
(rename 1/find-library-collection-links find-library-collection-links)
(rename 1/find-library-collection-paths find-library-collection-paths)
(rename find-main-config find-main-config)
(rename 1/identifier-binding identifier-binding)
(rename identifier? identifier?)
(rename 1/load load)
(rename 1/load-extension load-extension)
(rename 1/load/use-compiled load/use-compiled)
(rename make-namespace make-namespace)
(rename maybe-raise-missing-module maybe-raise-missing-module)
(rename maybe-syntax->datum maybe-syntax->datum)
(rename 1/module->language-info module->language-info)
(rename 1/module-compiled-exports module-compiled-exports)
(rename 1/module-compiled-indirect-exports module-compiled-indirect-exports)
(rename 1/module-declared? module-declared?)
(rename 1/module-path-index-join module-path-index-join)
(rename 1/module-path-index? module-path-index?)
(rename 1/module-path? module-path?)
(rename 1/module-predefined? module-predefined?)
(rename namespace->instance namespace->instance)
(rename 1/namespace-attach-module namespace-attach-module)
(rename 1/namespace-attach-module-declaration namespace-attach-module-declaration)
(rename namespace-datum-introduce namespace-datum-introduce)
(rename 1/namespace-mapped-symbols namespace-mapped-symbols)
(rename 1/namespace-module-identifier namespace-module-identifier)
(rename 1/namespace-require namespace-require)
(rename 1/namespace-syntax-introduce namespace-syntax-introduce)
(rename 1/namespace-variable-value namespace-variable-value)
(rename path-list-string->path-list path-list-string->path-list)
(rename 1/read read)
(rename 1/read-accept-compiled read-accept-compiled)
(rename 1/read-syntax read-syntax)
(rename 1/resolved-module-path? resolved-module-path?)
(rename seal seal)
(rename 1/syntax->datum syntax->datum)
(rename 1/syntax-debug-info syntax-debug-info)
(rename 1/syntax-e syntax-e)
(rename syntax-property$1 syntax-property)
(rename 1/syntax-shift-phase-level syntax-shift-phase-level)
(rename syntax?$1 syntax?)
(rename 1/use-collection-link-paths use-collection-link-paths)
(rename 1/use-compiled-file-check use-compiled-file-check)
(rename 1/use-compiled-file-paths use-compiled-file-paths)
(rename 1/use-user-specific-search-paths use-user-specific-search-paths))
(define-values (call/ec) call-with-escape-continuation)
(define-values
(qq-append)
(lambda (a_0 b_0) (begin (if (list? a_0) (append a_0 b_0) (raise-argument-error 'unquote-splicing "list?" a_0)))))
(define-values
(bad-list$1)
(lambda (who_0 orig-l_0) (begin 'bad-list (raise-mismatch-error who_0 "not a proper list: " orig-l_0))))
(define-values
(memq memv member)
(let-values ()
(let-values ()
(values
(let-values (((memq_0)
(lambda (v_0 orig-l_1)
(begin
'memq
((letrec-values (((loop_0)
(lambda (ls_0)
(begin
'loop
(if (null? ls_0)
(let-values () #f)
(if (not (pair? ls_0))
(let-values () (bad-list$1 'memq orig-l_1))
(if (eq? v_0 (car ls_0))
(let-values () ls_0)
(let-values () (loop_0 (cdr ls_0))))))))))
loop_0)
orig-l_1)))))
memq_0)
(let-values (((memv_0)
(lambda (v_1 orig-l_2)
(begin
'memv
((letrec-values (((loop_1)
(lambda (ls_1)
(begin
'loop
(if (null? ls_1)
(let-values () #f)
(if (not (pair? ls_1))
(let-values () (bad-list$1 'memv orig-l_2))
(if (eqv? v_1 (car ls_1))
(let-values () ls_1)
(let-values () (loop_1 (cdr ls_1))))))))))
loop_1)
orig-l_2)))))
memv_0)
(let-values (((default_0)
(let-values (((member_0)
(lambda (v_2 orig-l_3)
(begin
'member
((letrec-values (((loop_2)
(lambda (ls_2)
(begin
'loop
(if (null? ls_2)
(let-values () #f)
(if (not (pair? ls_2))
(let-values () (bad-list$1 'member orig-l_3))
(if (equal? v_2 (car ls_2))
(let-values () ls_2)
(let-values () (loop_2 (cdr ls_2))))))))))
loop_2)
orig-l_3)))))
member_0)))
(let-values (((member_1)
(case-lambda
((v_3 orig-l_4) (begin 'member (default_0 v_3 orig-l_4)))
((v_4 orig-l_5 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))
((let-values (((member_2)
(lambda (v_5 orig-l_6)
(begin
'member
((letrec-values (((loop_3)
(lambda (ls_3)
(begin
'loop
(if (null? ls_3)
(let-values () #f)
(if (not (pair? ls_3))
(let-values () (bad-list$1 'member orig-l_6))
(if (eq?_0 v_5 (car ls_3))
(let-values () ls_3)
(let-values () (loop_3 (cdr ls_3))))))))))
loop_3)
orig-l_6)))))
member_2)
v_4
orig-l_5))))))
member_1))))))
(define-values (current-parameterization) (lambda () (begin (continuation-mark-set-first #f parameterization-key))))
(define-values
(call-with-parameterization)
(lambda (paramz_0 thunk_0)
(begin
(begin
(if (parameterization? paramz_0)
(void)
(let-values () (raise-argument-error 'call-with-parameterization "parameterization?" 0 paramz_0 thunk_0)))
(if (if (procedure? thunk_0) (procedure-arity-includes? thunk_0 0) #f)
(void)
(let-values () (raise-argument-error 'call-with-parameterization "(-> any)" 1 paramz_0 thunk_0)))
(with-continuation-mark parameterization-key paramz_0 (thunk_0))))))
(define-values
(struct:break-paramz make-break-paramz break-paramz? break-paramz-ref break-paramz-set!)
(make-struct-type 'break-parameterization #f 1 0 #f))
(define-values
(current-break-parameterization)
(lambda () (begin (make-break-paramz (continuation-mark-set-first #f break-enabled-key)))))
(define-values
(call-with-break-parameterization)
(lambda (paramz_1 thunk_1)
(begin
(begin
(if (break-paramz? paramz_1)
(void)
(let-values ()
(raise-argument-error 'call-with-break-parameterization "break-parameterization?" 0 paramz_1 thunk_1)))
(if (if (procedure? thunk_1) (procedure-arity-includes? thunk_1 0) #f)
(void)
(let-values () (raise-argument-error 'call-with-parameterization "(-> any)" 1 paramz_1 thunk_1)))
(begin0
(with-continuation-mark break-enabled-key (break-paramz-ref paramz_1 0) (begin (check-for-break) (thunk_1)))
(check-for-break))))))
(define-values
(select-handler/no-breaks)
(lambda (e_0 bpz_0 l_0)
(begin
(with-continuation-mark
break-enabled-key
(make-thread-cell #f)
((letrec-values (((loop_4)
(lambda (l_1)
(begin
'loop
(if (null? l_1)
(let-values () (raise e_0))
(if ((caar l_1) e_0)
(let-values ()
(begin0
((cdar l_1) e_0)
(with-continuation-mark break-enabled-key bpz_0 (check-for-break))))
(let-values () (loop_4 (cdr l_1)))))))))
loop_4)
l_0)))))
(define-values (false-thread-cell) (make-thread-cell #f))
(define-values (handler-prompt-key) (make-continuation-prompt-tag 'handler-prompt-tag))
(define-values
(call-handled-body)
(lambda (bpz_1 handle-proc_0 body-thunk_0)
(begin
(with-continuation-mark
break-enabled-key
false-thread-cell
(call-with-continuation-prompt
(lambda (bpz_2 body-thunk_1)
(with-continuation-mark
break-enabled-key
bpz_2
(with-continuation-mark
exception-handler-key
(lambda (e_1) (abort-current-continuation handler-prompt-key e_1))
(body-thunk_1))))
handler-prompt-key
handle-proc_0
bpz_1
body-thunk_0)))))
(define-values
(call-with-exception-handler)
(lambda (exnh_0 thunk_2) (begin (begin0 (with-continuation-mark exception-handler-key exnh_0 (thunk_2)) (void)))))
(define-values (not-there) (gensym))
(define-values
(do-hash-update)
(lambda (who_1 mut?_0 set_0 ht_0 key_0 xform_0 default_1)
(begin
(begin
(if (variable-reference-from-unsafe? (#%variable-reference))
(void)
(let-values ()
(begin
(if (if (hash? ht_0) (if mut?_0 (not (immutable? ht_0)) (immutable? ht_0)) #f)
(void)
(let-values ()
(raise-argument-error
who_1
(if mut?_0 "(and/c hash? (not/c immutable?))" "(and/c hash? immutable?)")
ht_0)))
(if (if (procedure? xform_0) (procedure-arity-includes? xform_0 1) #f)
(void)
(let-values () (raise-argument-error who_1 "(any/c . -> . any/c)" xform_0))))))
(let-values (((v_6) (hash-ref ht_0 key_0 default_1)))
(if (eq? v_6 not-there)
(raise-mismatch-error who_1 "no value found for key: " key_0)
(set_0 ht_0 key_0 (xform_0 v_6))))))))
(define-values
(hash-update)
(case-lambda
((ht_1 key_1 xform_1 default_2) (begin (do-hash-update 'hash-update #f hash-set ht_1 key_1 xform_1 default_2)))
((ht_2 key_2 xform_2) (hash-update ht_2 key_2 xform_2 not-there))))
(define-values
(hash-update!)
(case-lambda
((ht_3 key_3 xform_3 default_3) (begin (do-hash-update 'hash-update! #t hash-set! ht_3 key_3 xform_3 default_3)))
((ht_4 key_4 xform_4) (hash-update! ht_4 key_4 xform_4 not-there))))
(define-values
(hash-ref!)
(lambda (ht_5 key_5 new_0)
(begin
(begin
(if (if (hash? ht_5) (not (immutable? ht_5)) #f)
(void)
(let-values () (raise-argument-error 'hash-ref! "(and/c hash? (not/c immutable?))" 0 ht_5 key_5 new_0)))
(let-values (((v_7) (hash-ref ht_5 key_5 not-there)))
(if (eq? not-there v_7)
(let-values (((n_0) (if (procedure? new_0) (new_0) new_0))) (begin (hash-set! ht_5 key_5 n_0) n_0))
v_7))))))
(define-values
(path-string?)
(lambda (s_0)
(begin
(let-values (((or-part_0) (path? s_0)))
(if or-part_0
or-part_0
(if (string? s_0)
(let-values (((or-part_1) (relative-path? s_0))) (if or-part_1 or-part_1 (absolute-path? s_0)))
#f))))))
(define-values (bsbs) (string '#\\ '#\\))
(define-values
(normal-case-path)
(lambda (s_1)
(begin
(begin
(if (let-values (((or-part_2) (path-for-some-system? s_1))) (if or-part_2 or-part_2 (path-string? s_1)))
(void)
(let-values () (raise-argument-error 'normal-path-case "(or/c path-for-some-system? path-string?)" s_1)))
(if (if (path-for-some-system? s_1) (eq? (path-convention-type s_1) 'windows) (eq? (system-type) 'windows))
(let-values ()
(let-values (((bstr_0) (if (string? s_1) #f (path->bytes s_1))))
(if (if (string? s_1) (regexp-match? '#rx"^[\\][\\][?][\\]" s_1) #f)
(let-values () (string->path s_1))
(if (if bstr_0 (regexp-match? '#rx#"^[\\][\\][?][\\]" bstr_0) #f)
(let-values () s_1)
(let-values ()
(let-values (((norm_0)
(lambda (s_2)
(begin 'norm (string-locale-downcase (regexp-replace* '#rx"/" s_2 bsbs)))))
((norm-tail_0)
(lambda (s_3)
(begin
'norm-tail
(if (regexp-match? '#rx"[/\\][. ]+[/\\]*$" s_3)
s_3
(regexp-replace* '#rx"(?<=[^ ./\\])[ .]+([/\\]*)$" s_3 "\\1")))))
((finish_0) (lambda (bstr_1) (begin 'finish (bytes->path bstr_1 'windows)))))
(if (string? s_1)
(let-values () (finish_0 (string->bytes/locale (norm_0 (norm-tail_0 s_1)))))
(let-values ()
(let-values (((c_0) (bytes-open-converter "" "UTF-8")))
(finish_0
((letrec-values (((loop_5)
(lambda (offset_0)
(begin
'loop
(let-values (((new-bstr_0 used_0 status_0)
(bytes-convert
c_0
bstr_0
offset_0
(bytes-length bstr_0))))
(let-values (((s_4) (bytes->string/locale new-bstr_0)))
(let-values (((tail-s_0)
(if (eq? status_0 'complete)
(norm-tail_0 s_4)
s_4)))
(let-values (((done_0)
(string->bytes/locale (norm_0 tail-s_0))))
(if (eq? status_0 'complete)
(let-values () done_0)
(if (eq? status_0 'aborts)
(let-values ()
(bytes-append
done_0
(subbytes bstr_0 (+ offset_0 used_0))))
(let-values ()
(bytes-append
done_0
(subbytes
bstr_0
(+ offset_0 used_0)
(+ offset_0 used_0 1))
(loop_5 (+ offset_0 used_0 1))))))))))))))
loop_5)
0)))))))))))
(if (string? s_1) (let-values () (string->path s_1)) (let-values () s_1)))))))
(define-values
(check-extension-call)
(lambda (s_5 sfx_0 who_2 sep_0 trust-sep?_0)
(begin
(begin
(let-values (((err-msg_0 err-index_0)
(if (not
(let-values (((or-part_3) (path-for-some-system? s_5)))
(if or-part_3 or-part_3 (path-string? s_5))))
(let-values () (values "(or/c path-for-some-system? path-string?)" 0))
(if (not (let-values (((or-part_4) (string? sfx_0))) (if or-part_4 or-part_4 (bytes? sfx_0))))
(let-values () (values "(or/c string? bytes?)" 1))
(if (not
(let-values (((or-part_5) trust-sep?_0))
(if or-part_5
or-part_5
(let-values (((or-part_6) (string? sep_0)))
(if or-part_6 or-part_6 (bytes? sep_0))))))
(let-values () (values "(or/c string? bytes?)" 2))
(let-values () (values #f #f)))))))
(if err-msg_0
(let-values ()
(if trust-sep?_0
(raise-argument-error who_2 err-msg_0 err-index_0 s_5 sfx_0)
(raise-argument-error who_2 err-msg_0 err-index_0 s_5 sfx_0 sep_0)))
(void)))
(let-values (((base_0 name_0 dir?_0) (split-path s_5)))
(begin
(if (not base_0)
(let-values () (raise-mismatch-error who_2 "cannot add an extension to a root path: " s_5))
(void))
(values base_0 name_0)))))))
(define-values
(path-adjust-extension)
(lambda (name_1 sep_1 rest-bytes_0 s_6 sfx_1 trust-sep?_1)
(begin
(let-values (((base_1 name_2) (check-extension-call s_6 sfx_1 name_1 sep_1 trust-sep?_1)))
(let-values (((bs_0) (path-element->bytes name_2)))
(let-values (((finish_1)
(lambda (i_0 sep_2 i2_0)
(begin
'finish
(bytes->path-element
(bytes-append
(subbytes bs_0 0 i_0)
(if (string? sep_2) (string->bytes/locale sep_2 (char->integer '#\?)) sep_2)
(rest-bytes_0 bs_0 i2_0)
(if (string? sfx_1) (string->bytes/locale sfx_1 (char->integer '#\?)) sfx_1))
(if (path-for-some-system? s_6)
(path-convention-type s_6)
(system-path-convention-type)))))))
(let-values (((new-name_0)
(letrec-values (((loop_6)
(lambda (i_1)
(begin
'loop
(if (zero? i_1)
(finish_1 (bytes-length bs_0) #"" (bytes-length bs_0))
(let-values (((i_2) (sub1 i_1)))
(if (if (not (zero? i_2))
(eq? (char->integer '#\.) (bytes-ref bs_0 i_2))
#f)
(finish_1 i_2 sep_1 (add1 i_2))
(loop_6 i_2))))))))
(loop_6 (bytes-length bs_0)))))
(if (path-for-some-system? base_1) (build-path base_1 new-name_0) new-name_0))))))))
(define-values
(path-replace-extension)
(lambda (s_7 sfx_2) (begin (path-adjust-extension 'path-replace-extension #"" (lambda (bs_1 i_3) #"") s_7 sfx_2 #t))))
(define-values
(path-add-extension)
(case-lambda
((s_8 sfx_3) (begin (path-adjust-extension 'path-add-extension #"_" subbytes s_8 sfx_3 #t)))
((s_9 sfx_4 sep_3) (path-adjust-extension 'path-add-extension sep_3 subbytes s_9 sfx_4 #f))))
(define-values
(reroot-path)
(lambda (p_0 root_0)
(begin
(let-values ((()
(begin
(if (let-values (((or-part_7) (path-string? p_0)))
(if or-part_7 or-part_7 (path-for-some-system? p_0)))
(void)
(let-values ()
(raise-argument-error 'reroot-path "(or/c path-string? path-for-some-system?)" 0 p_0 root_0)))
(values))))
(let-values ((()
(begin
(if (let-values (((or-part_8) (path-string? root_0)))
(if or-part_8 or-part_8 (path-for-some-system? root_0)))
(void)
(let-values ()
(raise-argument-error
'reroot-path
"(or/c path-string? path-for-some-system?)"
1
p_0
root_0)))
(values))))
(let-values (((conv_0)
(if (path-for-some-system? p_0) (path-convention-type p_0) (system-path-convention-type))))
(let-values ((()
(begin
(if (let-values (((or-part_9) (complete-path? p_0)))
(if or-part_9 or-part_9 (eq? (system-path-convention-type) conv_0)))
(void)
(let-values ()
(raise-arguments-error
'reroot-path
"path is not complete and not the platform's convention"
"path"
p_0
"platform convention type"
(system-path-convention-type))))
(values))))
(let-values ((()
(begin
(if (eq?
(if (path-for-some-system? root_0)
(path-convention-type root_0)
(system-path-convention-type))
conv_0)
(void)
(let-values ()
(raise-arguments-error
'reroot-path
"given paths use different conventions"
"path"
p_0
"root path"
root_0)))
(values))))
(let-values (((c-p_0)
(normal-case-path
(cleanse-path (if (complete-path? p_0) p_0 (path->complete-path p_0))))))
(let-values (((bstr_2) (path->bytes c-p_0)))
(if (eq? conv_0 'unix)
(let-values ()
(if (bytes=? bstr_2 #"/")
(if (path-for-some-system? root_0) root_0 (string->path root_0))
(build-path root_0 (bytes->path (subbytes (path->bytes c-p_0) 1) conv_0))))
(if (eq? conv_0 'windows)
(let-values ()
(build-path
root_0
(bytes->path
(if (regexp-match? '#rx"^\\\\\\\\[?]\\\\[a-z]:" bstr_2)
(let-values ()
(bytes-append #"\\\\?\\REL\\" (subbytes bstr_2 4 5) #"\\" (subbytes bstr_2 6)))
(if (regexp-match? '#rx"^\\\\\\\\[?]\\\\UNC\\\\" bstr_2)
(let-values () (bytes-append #"\\\\?\\REL\\" (subbytes bstr_2 4)))
(if (regexp-match? '#rx"^\\\\\\\\[?]\\\\UNC\\\\" bstr_2)
(let-values () (bytes-append #"\\\\?\\REL\\" (subbytes bstr_2 4)))
(if (regexp-match? '#rx"^\\\\\\\\" bstr_2)
(let-values () (bytes-append #"UNC\\" (subbytes bstr_2 2)))
(if (regexp-match? '#rx"^[a-z]:" bstr_2)
(let-values () (bytes-append (subbytes bstr_2 0 1) (subbytes bstr_2 2)))
(void))))))
conv_0)))
(void)))))))))))))
(define-values (rx:path-list) #f)
(define-values
(init-rx:path-list!)
(lambda ()
(begin
(if rx:path-list
(void)
(let-values ()
(set! rx:path-list
(byte-regexp
(string->bytes/utf-8
(let-values (((sep_4) (if (eq? (system-type) 'windows) ";" ":")))
(format "([^~a]*)~a(.*)" sep_4 sep_4))))))))))
(define-values
(cons-path)
(lambda (default_4 s_10 l_2)
(begin
(let-values (((s_11) (if (eq? (system-type) 'windows) (regexp-replace* '#rx#"\"" s_10 #"") s_10)))
(if (bytes=? s_11 #"") (append default_4 l_2) (cons (bytes->path s_11) l_2))))))
(define-values
(path-list-string->path-list)
(lambda (s_12 default_5)
(begin
(begin
(if (let-values (((or-part_10) (bytes? s_12))) (if or-part_10 or-part_10 (string? s_12)))
(void)
(let-values () (raise-argument-error 'path-list-string->path-list "(or/c bytes? string?)" s_12)))
(if (if (list? default_5) (andmap path? default_5) #f)
(void)
(let-values () (raise-argument-error 'path-list-string->path-list "(listof path?)" default_5)))
(init-rx:path-list!)
((letrec-values (((loop_7)
(lambda (s_2)
(begin
'loop
(let-values (((m_0) (regexp-match rx:path-list s_2)))
(if m_0
(cons-path default_5 (cadr m_0) (loop_7 (caddr m_0)))
(cons-path default_5 s_2 null)))))))
loop_7)
(if (string? s_12) (string->bytes/utf-8 s_12) s_12))))))
(define-values
(find-executable-path)
(case-lambda
((program_0 libpath_0 reverse?_0)
(begin
(begin
(if (path-string? program_0)
(void)
(let-values () (raise-argument-error 'find-executable-path "path-string?" program_0)))
(if (let-values (((or-part_11) (not libpath_0)))
(if or-part_11 or-part_11 (if (path-string? libpath_0) (relative-path? libpath_0) #f)))
(void)
(let-values ()
(raise-argument-error 'find-executable-path "(or/c #f (and/c path-string? relative-path?))" libpath_0)))
(letrec-values (((found-exec_0)
(lambda (exec-name_0)
(begin
'found-exec
(if libpath_0
(let-values (((base_2 name_3 isdir?_0) (split-path exec-name_0)))
(let-values (((next_0)
(lambda ()
(begin
'next
(let-values (((resolved_0) (resolve-path exec-name_0)))
(if (equal? resolved_0 exec-name_0)
(let-values () #f)
(if (relative-path? resolved_0)
(let-values () (found-exec_0 (build-path base_2 resolved_0)))
(let-values () (found-exec_0 resolved_0)))))))))
(let-values (((or-part_12) (if reverse?_0 (next_0) #f)))
(if or-part_12
or-part_12
(let-values (((or-part_13)
(if (path? base_2)
(let-values (((lib_0) (build-path base_2 libpath_0)))
(if (let-values (((or-part_14) (directory-exists? lib_0)))
(if or-part_14 or-part_14 (file-exists? lib_0)))
lib_0
#f))
#f)))
(if or-part_13 or-part_13 (if (not reverse?_0) (next_0) #f)))))))
exec-name_0)))))
(if (if (relative-path? program_0)
(let-values (((base_3 name_4 dir?_1) (split-path program_0))) (eq? base_3 'relative))
#f)
(let-values (((paths-str_0) (environment-variables-ref (current-environment-variables) #"PATH"))
((win-add_0)
(lambda (s_13)
(begin 'win-add (if (eq? (system-type) 'windows) (cons (bytes->path #".") s_13) s_13)))))
((letrec-values (((loop_8)
(lambda (paths_0)
(begin
'loop
(if (null? paths_0)
#f
(let-values (((base_4) (path->complete-path (car paths_0))))
(let-values (((name_5) (build-path base_4 program_0)))
(if (file-exists? name_5) (found-exec_0 name_5) (loop_8 (cdr paths_0))))))))))
loop_8)
(win-add_0
(if paths-str_0 (path-list-string->path-list (bytes->string/locale paths-str_0 '#\?) null) null))))
(let-values (((p_1) (path->complete-path program_0))) (if (file-exists? p_1) (found-exec_0 p_1) #f)))))))
((program_1 libpath_1) (find-executable-path program_1 libpath_1 #f))
((program_2) (find-executable-path program_2 #f #f))))
(define-values
(call-with-default-reading-parameterization)
(lambda (thunk_3)
(begin
(if (if (procedure? thunk_3) (procedure-arity-includes? thunk_3 0) #f)
(with-continuation-mark
parameterization-key
(extend-parameterization
(continuation-mark-set-first #f parameterization-key)
read-case-sensitive
#t
1/read-square-bracket-as-paren
#t
1/read-curly-brace-as-paren
#t
1/read-square-bracket-with-tag
#f
1/read-curly-brace-with-tag
#f
1/read-accept-box
#t
1/read-accept-compiled
#f
read-accept-bar-quote
#t
1/read-accept-graph
#t
1/read-decimal-as-inexact
#t
1/read-single-flonum
#f
1/read-cdot
#f
1/read-accept-dot
#t
1/read-accept-infix-dot
#t
1/read-accept-quasiquote
#t
1/read-accept-reader
#f
1/read-accept-lang
#t
1/current-readtable
#f)
(thunk_3))
(raise-argument-error 'call-with-default-reading-parameterization "(procedure-arity-includes/c 0)" thunk_3)))))
(define-values
(prop:keyword-impersonator keyword-impersonator? keyword-impersonator-ref)
(make-struct-type-property 'keyword-impersonator))
(define-values
(keyword-procedure-impersonator-of)
(lambda (v_8)
(begin (if (keyword-impersonator? v_8) (let-values () ((keyword-impersonator-ref v_8) v_8)) (let-values () #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-values (keyword-procedure-required) (make-struct-field-accessor keyword-procedure-ref 2))
(define-values (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_9 info-l_0) (if (exact-integer? v_9) (make-struct-field-accessor (list-ref info-l_0 3) v_9) #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-values
(procedure-keywords)
(lambda (p_2)
(begin
(if (keyword-procedure? p_2)
(let-values () (values (keyword-procedure-required p_2) (keyword-procedure-allowed p_2)))
(if (procedure? p_2)
(let-values ()
(if (new-procedure? p_2)
(let-values (((v_10) (new-procedure-ref p_2)))
(if (procedure? v_10)
(procedure-keywords v_10)
(let-values (((a_1) (procedure-accessor-ref p_2)))
(if a_1 (procedure-keywords (a_1 p_2)) (values null null)))))
(values null null)))
(let-values () (raise-argument-error 'procedure-keywords "procedure?" p_2)))))))
(define-values (print-values) (lambda vs_0 (begin (begin (for-each (current-print) vs_0) (apply values vs_0)))))
(define-values
(reverse$1)
(lambda (l_3)
(begin
'reverse
(begin
(if (variable-reference-from-unsafe? (#%variable-reference))
(void)
(if (list? l_3) (void) (raise-argument-error 'reverse "list?" l_3)))
(letrec-values (((loop_9)
(lambda (a_2 l_2) (begin 'loop (if (null? l_2) a_2 (loop_9 (cons (car l_2) a_2) (cdr l_2)))))))
(loop_9 null l_3))))))
(define-values
(sort vector-sort vector-sort!)
(let-values ()
(let-values (((generic-sort_0)
(lambda (A_0 less-than?_0 n_1)
(begin
'generic-sort
(let-values ()
(let-values ()
(let-values (((n/2-_0) (unsafe-fxrshift n_1 1)))
(let-values (((n/2+_0) (unsafe-fx- n_1 n/2-_0)))
(letrec-values (((copying-mergesort_0)
(lambda (Alo_0 Blo_0 n_2)
(begin
'copying-mergesort
(if (unsafe-fx= n_2 1)
(let-values ()
(unsafe-vector-set! A_0 Blo_0 (unsafe-vector-ref A_0 Alo_0)))
(if (unsafe-fx= n_2 2)
(let-values ()
(let-values (((x_0) (unsafe-vector-ref A_0 Alo_0))
((y_0)
(unsafe-vector-ref A_0 (unsafe-fx+ Alo_0 1))))
(if (less-than?_0 y_0 x_0)
(begin
(unsafe-vector-set! A_0 Blo_0 y_0)
(unsafe-vector-set! A_0 (unsafe-fx+ Blo_0 1) x_0))
(begin
(unsafe-vector-set! A_0 Blo_0 x_0)
(unsafe-vector-set! A_0 (unsafe-fx+ Blo_0 1) y_0)))))
(if (unsafe-fx< n_2 16)
(let-values ()
(begin
(unsafe-vector-set!
A_0
Blo_0
(unsafe-vector-ref A_0 Alo_0))
((letrec-values (((iloop_0)
(lambda (i_4)
(begin
'iloop
(if (unsafe-fx< i_4 n_2)
(let-values ()
(let-values (((ref-i_0)
(unsafe-vector-ref
A_0
(unsafe-fx+
Alo_0
i_4))))
((letrec-values (((jloop_0)
(lambda (j_0)
(begin
'jloop
(let-values (((ref-j-1_0)
(unsafe-vector-ref
A_0
(unsafe-fx-
j_0
1))))
(if (if (unsafe-fx<
Blo_0
j_0)
(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_4
1)))))))))
jloop_0)
(unsafe-fx+ Blo_0 i_4))))
(void))))))
iloop_0)
1)))
(let-values ()
(let-values (((n/2-_1) (unsafe-fxrshift n_2 1)))
(let-values (((n/2+_1) (unsafe-fx- n_2 n/2-_1)))
(let-values (((Amid1_0) (unsafe-fx+ Alo_0 n/2-_1))
((Amid2_0) (unsafe-fx+ Alo_0 n/2+_1))
((Bmid1_0) (unsafe-fx+ Blo_0 n/2-_1)))
(begin
(copying-mergesort_0 Amid1_0 Bmid1_0 n/2+_1)
(copying-mergesort_0 Alo_0 Amid2_0 n/2-_1)
(let-values (((b2_0) (unsafe-fx+ Blo_0 n_2)))
((letrec-values (((loop_10)
(lambda (a1_0 b1_0 c1_0)
(begin
'loop
(let-values (((x_1)
(unsafe-vector-ref
A_0
a1_0))
((y_1)
(unsafe-vector-ref
A_0
b1_0)))
(if (not
(less-than?_0
y_1
x_1))
(begin
(unsafe-vector-set!
A_0
c1_0
x_1)
(let-values (((a1_1)
(unsafe-fx+
a1_0
1))
((c1_1)
(unsafe-fx+
c1_0
1)))
(if (unsafe-fx<
c1_1
b1_0)
(let-values ()
(loop_10
a1_1
b1_0
c1_1))
(void))))
(begin
(unsafe-vector-set!
A_0
c1_0
y_1)
(let-values (((b1_1)
(unsafe-fx+
b1_0
1))
((c1_2)
(unsafe-fx+
c1_0
1)))
(if (unsafe-fx<=
b2_0
b1_1)
((letrec-values (((loop_11)
(lambda (a1_2
c1_3)
(begin
'loop
(if (unsafe-fx<
c1_3
b1_1)
(let-values ()
(begin
(unsafe-vector-set!
A_0
c1_3
(unsafe-vector-ref
A_0
a1_2))
(loop_11
(unsafe-fx+
a1_2
1)
(unsafe-fx+
c1_3
1))))
(void))))))
loop_11)
a1_0
c1_2)
(loop_10
a1_0
b1_1
c1_2))))))))))
loop_10)
Amid2_0
Bmid1_0
Blo_0))))))))))))))
(let-values (((Alo_1) 0)
((Amid1_1) n/2-_0)
((Amid2_1) n/2+_0)
((Ahi_0) n_1)
((B1lo_0) n_1))
(begin
(copying-mergesort_0 Amid1_1 B1lo_0 n/2+_0)
(if (zero? n/2-_0)
(void)
(let-values () (copying-mergesort_0 Alo_1 Amid2_1 n/2-_0)))
(let-values (((b2_1) Ahi_0))
((letrec-values (((loop_12)
(lambda (a1_3 b1_2 c1_4)
(begin
'loop
(let-values (((x_2) (unsafe-vector-ref A_0 a1_3))
((y_2) (unsafe-vector-ref A_0 b1_2)))
(if (less-than?_0 x_2 y_2)
(begin
(unsafe-vector-set! A_0 c1_4 x_2)
(let-values (((a1_4) (unsafe-fx+ a1_3 1))
((c1_5) (unsafe-fx+ c1_4 1)))
(if (unsafe-fx< c1_5 b1_2)
(let-values () (loop_12 a1_4 b1_2 c1_5))
(void))))
(begin
(unsafe-vector-set! A_0 c1_4 y_2)
(let-values (((b1_3) (unsafe-fx+ b1_2 1))
((c1_6) (unsafe-fx+ c1_4 1)))
(if (unsafe-fx<= b2_1 b1_3)
((letrec-values (((loop_13)
(lambda (a1_5 c1_7)
(begin
'loop
(if (unsafe-fx< c1_7 b1_3)
(let-values ()
(begin
(unsafe-vector-set!
A_0
c1_7
(unsafe-vector-ref
A_0
a1_5))
(loop_13
(unsafe-fx+ a1_5 1)
(unsafe-fx+
c1_7
1))))
(void))))))
loop_13)
a1_3
c1_6)
(loop_12 a1_3 b1_3 c1_6))))))))))
loop_12)
B1lo_0
Amid2_1
Alo_1)))))))))))))
(let-values (((generic-sort/key_0)
(lambda (A_1 less-than?_1 n_3 key_6)
(begin
'generic-sort/key
(let-values ()
(let-values ()
(let-values (((n/2-_2) (unsafe-fxrshift n_3 1)))
(let-values (((n/2+_2) (unsafe-fx- n_3 n/2-_2)))
(letrec-values (((copying-mergesort_1)
(lambda (Alo_2 Blo_1 n_4)
(begin
'copying-mergesort
(if (unsafe-fx= n_4 1)
(let-values ()
(unsafe-vector-set! A_1 Blo_1 (unsafe-vector-ref A_1 Alo_2)))
(if (unsafe-fx= n_4 2)
(let-values ()
(let-values (((x_3) (unsafe-vector-ref A_1 Alo_2))
((y_3)
(unsafe-vector-ref A_1 (unsafe-fx+ Alo_2 1))))
(if (if key_6
(less-than?_1 (key_6 y_3) (key_6 x_3))
(less-than?_1 y_3 x_3))
(begin
(unsafe-vector-set! A_1 Blo_1 y_3)
(unsafe-vector-set! A_1 (unsafe-fx+ Blo_1 1) x_3))
(begin
(unsafe-vector-set! A_1 Blo_1 x_3)
(unsafe-vector-set! A_1 (unsafe-fx+ Blo_1 1) y_3)))))
(if (unsafe-fx< n_4 16)
(let-values ()
(begin
(unsafe-vector-set!
A_1
Blo_1
(unsafe-vector-ref A_1 Alo_2))
((letrec-values (((iloop_1)
(lambda (i_5)
(begin
'iloop
(if (unsafe-fx< i_5 n_4)
(let-values ()
(let-values (((ref-i_1)
(unsafe-vector-ref
A_1
(unsafe-fx+
Alo_2
i_5))))
((letrec-values (((jloop_1)
(lambda (j_1)
(begin
'jloop
(let-values (((ref-j-1_1)
(unsafe-vector-ref
A_1
(unsafe-fx-
j_1
1))))
(if (if (unsafe-fx<
Blo_1
j_1)
(if key_6
(less-than?_1
(key_6
ref-i_1)
(key_6
ref-j-1_1))
(less-than?_1
ref-i_1
ref-j-1_1))
#f)
(begin
(unsafe-vector-set!
A_1
j_1
ref-j-1_1)
(jloop_1
(unsafe-fx-
j_1
1)))
(begin
(unsafe-vector-set!
A_1
j_1
ref-i_1)
(iloop_1
(unsafe-fx+
i_5
1)))))))))
jloop_1)
(unsafe-fx+ Blo_1 i_5))))
(void))))))
iloop_1)
1)))
(let-values ()
(let-values (((n/2-_3) (unsafe-fxrshift n_4 1)))
(let-values (((n/2+_3) (unsafe-fx- n_4 n/2-_3)))
(let-values (((Amid1_2) (unsafe-fx+ Alo_2 n/2-_3))
((Amid2_2) (unsafe-fx+ Alo_2 n/2+_3))
((Bmid1_1) (unsafe-fx+ Blo_1 n/2-_3)))
(begin
(copying-mergesort_1 Amid1_2 Bmid1_1 n/2+_3)
(copying-mergesort_1 Alo_2 Amid2_2 n/2-_3)
(let-values (((b2_2) (unsafe-fx+ Blo_1 n_4)))
((letrec-values (((loop_14)
(lambda (a1_6 b1_4 c1_8)
(begin
'loop
(let-values (((x_4)
(unsafe-vector-ref
A_1
a1_6))
((y_4)
(unsafe-vector-ref
A_1
b1_4)))
(if (not
(if key_6
(less-than?_1
(key_6 y_4)
(key_6 x_4))
(less-than?_1
y_4
x_4)))
(begin
(unsafe-vector-set!
A_1
c1_8
x_4)
(let-values (((a1_7)
(unsafe-fx+
a1_6
1))
((c1_9)
(unsafe-fx+
c1_8
1)))
(if (unsafe-fx<
c1_9
b1_4)
(let-values ()
(loop_14
a1_7
b1_4
c1_9))
(void))))
(begin
(unsafe-vector-set!
A_1
c1_8
y_4)
(let-values (((b1_5)
(unsafe-fx+
b1_4
1))
((c1_10)
(unsafe-fx+
c1_8
1)))
(if (unsafe-fx<=
b2_2
b1_5)
((letrec-values (((loop_15)
(lambda (a1_8
c1_11)
(begin
'loop
(if (unsafe-fx<
c1_11
b1_5)
(let-values ()
(begin
(unsafe-vector-set!
A_1
c1_11
(unsafe-vector-ref
A_1
a1_8))
(loop_15
(unsafe-fx+
a1_8
1)
(unsafe-fx+
c1_11
1))))
(void))))))
loop_15)
a1_6
c1_10)
(loop_14
a1_6
b1_5
c1_10))))))))))
loop_14)
Amid2_2
Bmid1_1
Blo_1))))))))))))))
(let-values (((Alo_3) 0)
((Amid1_3) n/2-_2)
((Amid2_3) n/2+_2)
((Ahi_1) n_3)
((B1lo_1) n_3))
(begin
(copying-mergesort_1 Amid1_3 B1lo_1 n/2+_2)
(if (zero? n/2-_2)
(void)
(let-values () (copying-mergesort_1 Alo_3 Amid2_3 n/2-_2)))
(let-values (((b2_3) Ahi_1))
((letrec-values (((loop_16)
(lambda (a1_9 b1_6 c1_12)
(begin
'loop
(let-values (((x_5) (unsafe-vector-ref A_1 a1_9))
((y_5) (unsafe-vector-ref A_1 b1_6)))
(if (if key_6
(less-than?_1 (key_6 x_5) (key_6 y_5))
(less-than?_1 x_5 y_5))
(begin
(unsafe-vector-set! A_1 c1_12 x_5)
(let-values (((a1_10) (unsafe-fx+ a1_9 1))
((c1_13) (unsafe-fx+ c1_12 1)))
(if (unsafe-fx< c1_13 b1_6)
(let-values () (loop_16 a1_10 b1_6 c1_13))
(void))))
(begin
(unsafe-vector-set! A_1 c1_12 y_5)
(let-values (((b1_7) (unsafe-fx+ b1_6 1))
((c1_14) (unsafe-fx+ c1_12 1)))
(if (unsafe-fx<= b2_3 b1_7)
((letrec-values (((loop_17)
(lambda (a1_11 c1_15)
(begin
'loop
(if (unsafe-fx<
c1_15
b1_7)
(let-values ()
(begin
(unsafe-vector-set!
A_1
c1_15
(unsafe-vector-ref
A_1
a1_11))
(loop_17
(unsafe-fx+
a1_11
1)
(unsafe-fx+
c1_15
1))))
(void))))))
loop_17)
a1_9
c1_14)
(loop_16 a1_9 b1_7 c1_14))))))))))
loop_16)
B1lo_1
Amid2_3
Alo_3)))))))))))))
(values
(case-lambda
((lst_0 less-than?_2)
(let-values (((n_5) (length lst_0)))
(let-values ()
(if (unsafe-fx= n_5 0)
(let-values () lst_0)
(if ((letrec-values (((loop_18)
(lambda (last_0 next_1)
(begin
'loop
(let-values (((or-part_15) (null? next_1)))
(if or-part_15
or-part_15
(if (not (less-than?_2 (unsafe-car next_1) last_0))
(loop_18 (unsafe-car next_1) (unsafe-cdr next_1))
#f)))))))
loop_18)
(car lst_0)
(cdr lst_0))
(let-values () lst_0)
(if (unsafe-fx<= n_5 3)
(let-values ()
(if (unsafe-fx= n_5 1)
(let-values () lst_0)
(if (unsafe-fx= n_5 2)
(let-values () (list (cadr lst_0) (car lst_0)))
(let-values ()
(let-values (((a_3) (car lst_0)) ((b_1) (cadr lst_0)) ((c_1) (caddr lst_0)))
(if (less-than?_2 b_1 a_3)
(if (less-than?_2 c_1 b_1)
(list c_1 b_1 a_3)
(if (less-than?_2 c_1 a_3) (list b_1 c_1 a_3) (list b_1 a_3 c_1)))
(if (less-than?_2 c_1 a_3) (list c_1 a_3 b_1) (list a_3 c_1 b_1))))))))
(let-values ()
(let-values (((vec_0) (make-vector (+ n_5 (ceiling (/ n_5 2))))))
(begin
((letrec-values (((loop_19)
(lambda (i_6 lst_1)
(begin
'loop
(if (pair? lst_1)
(let-values ()
(begin
(vector-set! vec_0 i_6 (car lst_1))
(loop_19 (add1 i_6) (cdr lst_1))))
(void))))))
loop_19)
0
lst_0)
(generic-sort_0 vec_0 less-than?_2 n_5)
((letrec-values (((loop_20)
(lambda (i_7 r_0)
(begin
'loop
(let-values (((i_8) (sub1 i_7)))
(if (< i_8 0)
r_0
(loop_20 i_8 (cons (vector-ref vec_0 i_8) r_0))))))))
loop_20)
n_5
'()))))))))))
((lst_2 less-than?_3 getkey_0)
(if (if getkey_0 (not (eq? values getkey_0)) #f)
(sort lst_2 less-than?_3 getkey_0 #f)
(sort lst_2 less-than?_3)))
((lst_3 less-than?_4 getkey_1 cache-keys?_0)
(if (if getkey_1 (not (eq? values getkey_1)) #f)
(let-values (((n_6) (length lst_3)))
(let-values ()
(if (unsafe-fx= n_6 0)
(let-values () lst_3)
(if cache-keys?_0
(let-values ()
(let-values (((vec_1) (make-vector (+ n_6 (ceiling (/ n_6 2))))))
(begin
((letrec-values (((loop_21)
(lambda (i_9 lst_4)
(begin
'loop
(if (pair? lst_4)
(let-values ()
(let-values (((x_6) (car lst_4)))
(begin
(unsafe-vector-set! vec_1 i_9 (cons (getkey_1 x_6) x_6))
(loop_21 (unsafe-fx+ i_9 1) (cdr lst_4)))))
(void))))))
loop_21)
0
lst_3)
(generic-sort/key_0 vec_1 less-than?_4 n_6 unsafe-car)
((letrec-values (((loop_22)
(lambda (i_10 r_1)
(begin
'loop
(let-values (((i_11) (unsafe-fx- i_10 1)))
(if (unsafe-fx< i_11 0)
r_1
(loop_22
i_11
(cons (unsafe-cdr (unsafe-vector-ref vec_1 i_11)) r_1))))))))
loop_22)
n_6
'()))))
(if ((letrec-values (((loop_23)
(lambda (last_1 next_2)
(begin
'loop
(let-values (((or-part_16) (null? next_2)))
(if or-part_16
or-part_16
(if (not
(if getkey_1
(less-than?_4
(getkey_1 (unsafe-car next_2))
(getkey_1 last_1))
(less-than?_4 (unsafe-car next_2) last_1)))
(loop_23 (unsafe-car next_2) (unsafe-cdr next_2))
#f)))))))
loop_23)
(car lst_3)
(cdr lst_3))
(let-values () lst_3)
(if (unsafe-fx<= n_6 3)
(let-values ()
(if (unsafe-fx= n_6 1)
(let-values () lst_3)
(if (unsafe-fx= n_6 2)
(let-values () (list (cadr lst_3) (car lst_3)))
(let-values ()
(let-values (((a_4) (car lst_3)) ((b_2) (cadr lst_3)) ((c_2) (caddr lst_3)))
(if (if getkey_1 (less-than?_4 (getkey_1 b_2) (getkey_1 a_4)) (less-than?_4 b_2 a_4))
(if (if getkey_1
(less-than?_4 (getkey_1 c_2) (getkey_1 b_2))
(less-than?_4 c_2 b_2))
(list c_2 b_2 a_4)
(if (if getkey_1
(less-than?_4 (getkey_1 c_2) (getkey_1 a_4))
(less-than?_4 c_2 a_4))
(list b_2 c_2 a_4)
(list b_2 a_4 c_2)))
(if (if getkey_1
(less-than?_4 (getkey_1 c_2) (getkey_1 a_4))
(less-than?_4 c_2 a_4))
(list c_2 a_4 b_2)
(list a_4 c_2 b_2))))))))
(let-values ()
(let-values (((vec_2) (make-vector (+ n_6 (ceiling (/ n_6 2))))))
(begin
((letrec-values (((loop_24)
(lambda (i_12 lst_5)
(begin
'loop
(if (pair? lst_5)
(let-values ()
(begin
(vector-set! vec_2 i_12 (car lst_5))
(loop_24 (add1 i_12) (cdr lst_5))))
(void))))))
loop_24)
0
lst_3)
(generic-sort/key_0 vec_2 less-than?_4 n_6 getkey_1)
((letrec-values (((loop_25)
(lambda (i_13 r_2)
(begin
'loop
(let-values (((i_14) (sub1 i_13)))
(if (< i_14 0)
r_2
(loop_25 i_14 (cons (vector-ref vec_2 i_14) r_2))))))))
loop_25)
n_6
'()))))))))))
(sort lst_3 less-than?_4))))
(case-lambda
((vec_3 less-than?_5 start_0 end_0)
(let-values (((n_7) (- end_0 start_0)))
(let-values (((dst-vec_0) (make-vector n_7)))
(let-values (((dst-start_0) 0))
(begin
(if (unsafe-fx= n_7 0)
(let-values () (void))
(if ((letrec-values (((loop_26)
(lambda (prev-val_0 next-index_0)
(begin
'loop
(let-values (((or-part_17) (unsafe-fx= next-index_0 end_0)))
(if or-part_17
or-part_17
(let-values (((next-val_0) (unsafe-vector-ref vec_3 next-index_0)))
(if (not (less-than?_5 next-val_0 prev-val_0))
(loop_26 next-val_0 (unsafe-fx+ next-index_0 1))
#f))))))))
loop_26)
(unsafe-vector-ref vec_3 start_0)
(unsafe-fx+ start_0 1))
(let-values () (let-values () (vector-copy! dst-vec_0 dst-start_0 vec_3 start_0 end_0)))
(if (unsafe-fx<= n_7 3)
(let-values ()
(begin
(let-values () (vector-copy! dst-vec_0 dst-start_0 vec_3 start_0 end_0))
(if (unsafe-fx= n_7 1)
(let-values () (void))
(if (unsafe-fx= n_7 2)
(let-values ()
(let-values (((tmp_0) (unsafe-vector-ref dst-vec_0 (unsafe-fx+ dst-start_0 0))))
(begin
(unsafe-vector-set!
dst-vec_0
(unsafe-fx+ dst-start_0 0)
(unsafe-vector-ref dst-vec_0 (unsafe-fx+ dst-start_0 1)))
(unsafe-vector-set! dst-vec_0 (unsafe-fx+ dst-start_0 1) tmp_0))))
(let-values ()
(let-values (((a_5) (unsafe-vector-ref dst-vec_0 (unsafe-fx+ dst-start_0 0)))
((b_3) (unsafe-vector-ref dst-vec_0 (unsafe-fx+ dst-start_0 1)))
((c_3) (unsafe-vector-ref dst-vec_0 (unsafe-fx+ dst-start_0 2))))
(if (less-than?_5 b_3 a_5)
(let-values ()
(if (less-than?_5 c_3 b_3)
(let-values ()
(begin
(unsafe-vector-set! dst-vec_0 (unsafe-fx+ dst-start_0 0) c_3)
(unsafe-vector-set! dst-vec_0 (unsafe-fx+ dst-start_0 2) a_5)))
(if (less-than?_5 c_3 a_5)
(let-values ()
(begin
(unsafe-vector-set! dst-vec_0 (unsafe-fx+ dst-start_0 0) b_3)
(unsafe-vector-set! dst-vec_0 (unsafe-fx+ dst-start_0 1) c_3)
(unsafe-vector-set! dst-vec_0 (unsafe-fx+ dst-start_0 2) a_5)))
(let-values ()
(begin
(unsafe-vector-set! dst-vec_0 (unsafe-fx+ dst-start_0 0) b_3)
(unsafe-vector-set! dst-vec_0 (unsafe-fx+ dst-start_0 1) a_5))))))
(if (less-than?_5 c_3 a_5)
(let-values ()
(begin
(unsafe-vector-set! dst-vec_0 (unsafe-fx+ dst-start_0 0) c_3)
(unsafe-vector-set! dst-vec_0 (unsafe-fx+ dst-start_0 1) a_5)
(unsafe-vector-set! dst-vec_0 (unsafe-fx+ dst-start_0 2) b_3)))
(let-values ()
(begin
(unsafe-vector-set! dst-vec_0 (unsafe-fx+ dst-start_0 1) c_3)
(unsafe-vector-set! dst-vec_0 (unsafe-fx+ dst-start_0 2) b_3)))))))))))
(let-values ()
(let-values (((work-vec_0) (make-vector (+ n_7 (ceiling (/ n_7 2))) #f)))
(begin
(vector-copy! work-vec_0 0 vec_3 start_0 end_0)
(generic-sort_0 work-vec_0 less-than?_5 n_7)
(vector-copy! dst-vec_0 dst-start_0 work-vec_0 0 n_7)))))))
dst-vec_0)))))
((vec_4 less-than?_6 start_1 end_1 getkey_2 cache-keys?_1)
(if (if getkey_2 (not (eq? values getkey_2)) #f)
(let-values (((n_8) (- end_1 start_1)))
(let-values (((dst-vec_1) (make-vector n_8)))
(let-values (((dst-start_1) 0))
(begin
(if (unsafe-fx= n_8 0)
(let-values () (void))
(if cache-keys?_1
(let-values ()
(let-values (((work-vec_1) (make-vector (+ n_8 (ceiling (/ n_8 2))) #t)))
(begin
((letrec-values (((loop_27)
(lambda (i_15)
(begin
'loop
(if (unsafe-fx< i_15 n_8)
(let-values ()
(begin
(let-values (((x_7)
(unsafe-vector-ref
vec_4
(unsafe-fx+ i_15 start_1))))
(unsafe-vector-set!
work-vec_1
i_15
(cons (getkey_2 x_7) x_7)))
(loop_27 (unsafe-fx+ i_15 1))))
(void))))))
loop_27)
0)
(generic-sort/key_0 work-vec_1 less-than?_6 n_8 unsafe-car)
((letrec-values (((loop_28)
(lambda (i_16)
(begin
'loop
(if (unsafe-fx< i_16 n_8)
(let-values ()
(begin
(unsafe-vector-set!
dst-vec_1
(unsafe-fx+ i_16 dst-start_1)
(unsafe-cdr (unsafe-vector-ref work-vec_1 i_16)))
(loop_28 (unsafe-fx+ i_16 1))))
(void))))))
loop_28)
0))))
(if ((letrec-values (((loop_29)
(lambda (prev-val_1 next-index_1)
(begin
'loop
(let-values (((or-part_18) (unsafe-fx= next-index_1 end_1)))
(if or-part_18
or-part_18
(let-values (((next-val_1)
(unsafe-vector-ref vec_4 next-index_1)))
(if (not
(if getkey_2
(less-than?_6
(getkey_2 next-val_1)
(getkey_2 prev-val_1))
(less-than?_6 next-val_1 prev-val_1)))
(loop_29 next-val_1 (unsafe-fx+ next-index_1 1))
#f))))))))
loop_29)
(unsafe-vector-ref vec_4 start_1)
(unsafe-fx+ start_1 1))
(let-values () (let-values () (vector-copy! dst-vec_1 dst-start_1 vec_4 start_1 end_1)))
(if (unsafe-fx<= n_8 3)
(let-values ()
(begin
(let-values () (vector-copy! dst-vec_1 dst-start_1 vec_4 start_1 end_1))
(if (unsafe-fx= n_8 1)
(let-values () (void))
(if (unsafe-fx= n_8 2)
(let-values ()
(let-values (((tmp_1) (unsafe-vector-ref dst-vec_1 (unsafe-fx+ dst-start_1 0))))
(begin
(unsafe-vector-set!
dst-vec_1
(unsafe-fx+ dst-start_1 0)
(unsafe-vector-ref dst-vec_1 (unsafe-fx+ dst-start_1 1)))
(unsafe-vector-set! dst-vec_1 (unsafe-fx+ dst-start_1 1) tmp_1))))
(let-values ()
(let-values (((a_6) (unsafe-vector-ref dst-vec_1 (unsafe-fx+ dst-start_1 0)))
((b_4) (unsafe-vector-ref dst-vec_1 (unsafe-fx+ dst-start_1 1)))
((c_4) (unsafe-vector-ref dst-vec_1 (unsafe-fx+ dst-start_1 2))))
(if (if getkey_2
(less-than?_6 (getkey_2 b_4) (getkey_2 a_6))
(less-than?_6 b_4 a_6))
(let-values ()
(if (if getkey_2
(less-than?_6 (getkey_2 c_4) (getkey_2 b_4))
(less-than?_6 c_4 b_4))
(let-values ()
(begin
(unsafe-vector-set! dst-vec_1 (unsafe-fx+ dst-start_1 0) c_4)
(unsafe-vector-set! dst-vec_1 (unsafe-fx+ dst-start_1 2) a_6)))
(if (if getkey_2
(less-than?_6 (getkey_2 c_4) (getkey_2 a_6))
(less-than?_6 c_4 a_6))
(let-values ()
(begin
(unsafe-vector-set! dst-vec_1 (unsafe-fx+ dst-start_1 0) b_4)
(unsafe-vector-set! dst-vec_1 (unsafe-fx+ dst-start_1 1) c_4)
(unsafe-vector-set! dst-vec_1 (unsafe-fx+ dst-start_1 2) a_6)))
(let-values ()
(begin
(unsafe-vector-set! dst-vec_1 (unsafe-fx+ dst-start_1 0) b_4)
(unsafe-vector-set! dst-vec_1 (unsafe-fx+ dst-start_1 1) a_6))))))
(if (if getkey_2
(less-than?_6 (getkey_2 c_4) (getkey_2 a_6))
(less-than?_6 c_4 a_6))
(let-values ()
(begin
(unsafe-vector-set! dst-vec_1 (unsafe-fx+ dst-start_1 0) c_4)
(unsafe-vector-set! dst-vec_1 (unsafe-fx+ dst-start_1 1) a_6)
(unsafe-vector-set! dst-vec_1 (unsafe-fx+ dst-start_1 2) b_4)))
(let-values ()
(begin
(unsafe-vector-set! dst-vec_1 (unsafe-fx+ dst-start_1 1) c_4)
(unsafe-vector-set! dst-vec_1 (unsafe-fx+ dst-start_1 2) b_4)))))))))))
(let-values ()
(let-values (((work-vec_2) (make-vector (+ n_8 (ceiling (/ n_8 2))) #f)))
(begin
(vector-copy! work-vec_2 0 vec_4 start_1 end_1)
(generic-sort/key_0 work-vec_2 less-than?_6 n_8 getkey_2)
(vector-copy! dst-vec_1 dst-start_1 work-vec_2 0 n_8))))))))
dst-vec_1))))
(vector-sort vec_4 less-than?_6 start_1 end_1))))
(case-lambda
((vec_5 less-than?_7 start_2 end_2)
(let-values (((n_9) (- end_2 start_2)))
(let-values (((dst-vec_2) vec_5))
(let-values (((dst-start_2) start_2))
(begin
(if (unsafe-fx= n_9 0)
(let-values () (void))
(if ((letrec-values (((loop_30)
(lambda (prev-val_2 next-index_2)
(begin
'loop
(let-values (((or-part_19) (unsafe-fx= next-index_2 end_2)))
(if or-part_19
or-part_19
(let-values (((next-val_2) (unsafe-vector-ref vec_5 next-index_2)))
(if (not (less-than?_7 next-val_2 prev-val_2))
(loop_30 next-val_2 (unsafe-fx+ next-index_2 1))
#f))))))))
loop_30)
(unsafe-vector-ref vec_5 start_2)
(unsafe-fx+ start_2 1))
(let-values () (void))
(if (unsafe-fx<= n_9 3)
(let-values ()
(begin
(void)
(if (unsafe-fx= n_9 1)
(let-values () (void))
(if (unsafe-fx= n_9 2)
(let-values ()
(let-values (((tmp_2) (unsafe-vector-ref dst-vec_2 (unsafe-fx+ dst-start_2 0))))
(begin
(unsafe-vector-set!
dst-vec_2
(unsafe-fx+ dst-start_2 0)
(unsafe-vector-ref dst-vec_2 (unsafe-fx+ dst-start_2 1)))
(unsafe-vector-set! dst-vec_2 (unsafe-fx+ dst-start_2 1) tmp_2))))
(let-values ()
(let-values (((a_7) (unsafe-vector-ref dst-vec_2 (unsafe-fx+ dst-start_2 0)))
((b_5) (unsafe-vector-ref dst-vec_2 (unsafe-fx+ dst-start_2 1)))
((c_5) (unsafe-vector-ref dst-vec_2 (unsafe-fx+ dst-start_2 2))))
(if (less-than?_7 b_5 a_7)
(let-values ()
(if (less-than?_7 c_5 b_5)
(let-values ()
(begin
(unsafe-vector-set! dst-vec_2 (unsafe-fx+ dst-start_2 0) c_5)
(unsafe-vector-set! dst-vec_2 (unsafe-fx+ dst-start_2 2) a_7)))
(if (less-than?_7 c_5 a_7)
(let-values ()
(begin
(unsafe-vector-set! dst-vec_2 (unsafe-fx+ dst-start_2 0) b_5)
(unsafe-vector-set! dst-vec_2 (unsafe-fx+ dst-start_2 1) c_5)
(unsafe-vector-set! dst-vec_2 (unsafe-fx+ dst-start_2 2) a_7)))
(let-values ()
(begin
(unsafe-vector-set! dst-vec_2 (unsafe-fx+ dst-start_2 0) b_5)
(unsafe-vector-set! dst-vec_2 (unsafe-fx+ dst-start_2 1) a_7))))))
(if (less-than?_7 c_5 a_7)
(let-values ()
(begin
(unsafe-vector-set! dst-vec_2 (unsafe-fx+ dst-start_2 0) c_5)
(unsafe-vector-set! dst-vec_2 (unsafe-fx+ dst-start_2 1) a_7)
(unsafe-vector-set! dst-vec_2 (unsafe-fx+ dst-start_2 2) b_5)))
(let-values ()
(begin
(unsafe-vector-set! dst-vec_2 (unsafe-fx+ dst-start_2 1) c_5)
(unsafe-vector-set! dst-vec_2 (unsafe-fx+ dst-start_2 2) b_5)))))))))))
(let-values ()
(let-values (((work-vec_3) (make-vector (+ n_9 (ceiling (/ n_9 2))) #f)))
(begin
(vector-copy! work-vec_3 0 vec_5 start_2 end_2)
(generic-sort_0 work-vec_3 less-than?_7 n_9)
(vector-copy! dst-vec_2 dst-start_2 work-vec_3 0 n_9)))))))
(void))))))
((vec_6 less-than?_8 start_3 end_3 getkey_3 cache-keys?_2)
(if (if getkey_3 (not (eq? values getkey_3)) #f)
(let-values (((n_10) (- end_3 start_3)))
(let-values (((dst-vec_3) vec_6))
(let-values (((dst-start_3) start_3))
(begin
(if (unsafe-fx= n_10 0)
(let-values () (void))
(if cache-keys?_2
(let-values ()
(let-values (((work-vec_4) (make-vector (+ n_10 (ceiling (/ n_10 2))) #t)))
(begin
((letrec-values (((loop_31)
(lambda (i_17)
(begin
'loop
(if (unsafe-fx< i_17 n_10)
(let-values ()
(begin
(let-values (((x_8)
(unsafe-vector-ref
vec_6
(unsafe-fx+ i_17 start_3))))
(unsafe-vector-set!
work-vec_4
i_17
(cons (getkey_3 x_8) x_8)))
(loop_31 (unsafe-fx+ i_17 1))))
(void))))))
loop_31)
0)
(generic-sort/key_0 work-vec_4 less-than?_8 n_10 unsafe-car)
((letrec-values (((loop_32)
(lambda (i_18)
(begin
'loop
(if (unsafe-fx< i_18 n_10)
(let-values ()
(begin
(unsafe-vector-set!
dst-vec_3
(unsafe-fx+ i_18 dst-start_3)
(unsafe-cdr (unsafe-vector-ref work-vec_4 i_18)))
(loop_32 (unsafe-fx+ i_18 1))))
(void))))))
loop_32)
0))))
(if ((letrec-values (((loop_33)
(lambda (prev-val_3 next-index_3)
(begin
'loop
(let-values (((or-part_20) (unsafe-fx= next-index_3 end_3)))
(if or-part_20
or-part_20
(let-values (((next-val_3)
(unsafe-vector-ref vec_6 next-index_3)))
(if (not
(if getkey_3
(less-than?_8
(getkey_3 next-val_3)
(getkey_3 prev-val_3))
(less-than?_8 next-val_3 prev-val_3)))
(loop_33 next-val_3 (unsafe-fx+ next-index_3 1))
#f))))))))
loop_33)
(unsafe-vector-ref vec_6 start_3)
(unsafe-fx+ start_3 1))
(let-values () (void))
(if (unsafe-fx<= n_10 3)
(let-values ()
(begin
(void)
(if (unsafe-fx= n_10 1)
(let-values () (void))
(if (unsafe-fx= n_10 2)
(let-values ()
(let-values (((tmp_3) (unsafe-vector-ref dst-vec_3 (unsafe-fx+ dst-start_3 0))))
(begin
(unsafe-vector-set!
dst-vec_3
(unsafe-fx+ dst-start_3 0)
(unsafe-vector-ref dst-vec_3 (unsafe-fx+ dst-start_3 1)))
(unsafe-vector-set! dst-vec_3 (unsafe-fx+ dst-start_3 1) tmp_3))))
(let-values ()
(let-values (((a_8) (unsafe-vector-ref dst-vec_3 (unsafe-fx+ dst-start_3 0)))
((b_6) (unsafe-vector-ref dst-vec_3 (unsafe-fx+ dst-start_3 1)))
((c_6) (unsafe-vector-ref dst-vec_3 (unsafe-fx+ dst-start_3 2))))
(if (if getkey_3
(less-than?_8 (getkey_3 b_6) (getkey_3 a_8))
(less-than?_8 b_6 a_8))
(let-values ()
(if (if getkey_3
(less-than?_8 (getkey_3 c_6) (getkey_3 b_6))
(less-than?_8 c_6 b_6))
(let-values ()
(begin
(unsafe-vector-set! dst-vec_3 (unsafe-fx+ dst-start_3 0) c_6)
(unsafe-vector-set! dst-vec_3 (unsafe-fx+ dst-start_3 2) a_8)))
(if (if getkey_3
(less-than?_8 (getkey_3 c_6) (getkey_3 a_8))
(less-than?_8 c_6 a_8))
(let-values ()
(begin
(unsafe-vector-set! dst-vec_3 (unsafe-fx+ dst-start_3 0) b_6)
(unsafe-vector-set! dst-vec_3 (unsafe-fx+ dst-start_3 1) c_6)
(unsafe-vector-set! dst-vec_3 (unsafe-fx+ dst-start_3 2) a_8)))
(let-values ()
(begin
(unsafe-vector-set! dst-vec_3 (unsafe-fx+ dst-start_3 0) b_6)
(unsafe-vector-set! dst-vec_3 (unsafe-fx+ dst-start_3 1) a_8))))))
(if (if getkey_3
(less-than?_8 (getkey_3 c_6) (getkey_3 a_8))
(less-than?_8 c_6 a_8))
(let-values ()
(begin
(unsafe-vector-set! dst-vec_3 (unsafe-fx+ dst-start_3 0) c_6)
(unsafe-vector-set! dst-vec_3 (unsafe-fx+ dst-start_3 1) a_8)
(unsafe-vector-set! dst-vec_3 (unsafe-fx+ dst-start_3 2) b_6)))
(let-values ()
(begin
(unsafe-vector-set! dst-vec_3 (unsafe-fx+ dst-start_3 1) c_6)
(unsafe-vector-set! dst-vec_3 (unsafe-fx+ dst-start_3 2) b_6)))))))))))
(let-values ()
(let-values (((work-vec_5) (make-vector (+ n_10 (ceiling (/ n_10 2))) #f)))
(begin
(vector-copy! work-vec_5 0 vec_6 start_3 end_3)
(generic-sort/key_0 work-vec_5 less-than?_8 n_10 getkey_3)
(vector-copy! dst-vec_3 dst-start_3 work-vec_5 0 n_10))))))))
(void)))))
(vector-sort! vec_6 less-than?_8 start_3 end_3)))))))))
(define-values
(prop:stream stream-via-prop? stream-ref)
(make-struct-type-property
'stream
(lambda (v_11 si_0)
(begin
(if (if (vector? v_11)
(if (= 3 (vector-length v_11))
(if (procedure? (vector-ref v_11 0))
(if (procedure-arity-includes? (vector-ref v_11 0) 1)
(if (procedure? (vector-ref v_11 1))
(if (procedure-arity-includes? (vector-ref v_11 1) 1)
(if (procedure? (vector-ref v_11 2)) (procedure-arity-includes? (vector-ref v_11 2) 1) #f)
#f)
#f)
#f)
#f)
#f)
#f)
(void)
(let-values ()
(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_11)))
(vector->immutable-vector v_11)))
'()
#t))
(define-values
(prop:gen-sequence sequence-via-prop? sequence-ref)
(make-struct-type-property
'sequence
(lambda (v_12 si_1)
(begin
(if (if (procedure? v_12) (procedure-arity-includes? v_12 1) #f)
(void)
(let-values () (raise-argument-error 'guard-for-prop:sequence "(procedure-arity-includes/c 1)" v_12)))
v_12))))
(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_13) (let-values (((cont?_0) (range-ref v_13 2))) (if cont?_0 (not (cont?_0 (range-ref v_13 0))) #f)))
(lambda (v_14) (range-ref v_14 0))
(lambda (v_15) (make-range ((range-ref v_15 1) (range-ref v_15 0)) (range-ref v_15 1) (range-ref v_15 2)))))
(cons
prop:gen-sequence
(lambda (v_16) (values values #f (range-ref v_16 1) (range-ref v_16 0) (range-ref v_16 2) #f #f))))))
(define-values
(check-range)
(lambda (a_9 b_7 step_0)
(begin
(begin
(if (real? a_9) (void) (let-values () (raise-argument-error 'in-range "real?" a_9)))
(if (real? b_7) (void) (let-values () (raise-argument-error 'in-range "real?" b_7)))
(if (real? step_0) (void) (let-values () (raise-argument-error 'in-range "real?" step_0)))))))
(define-values
(check-naturals)
(lambda (n_11)
(begin
(if (if (integer? n_11) (if (exact? n_11) (>= n_11 0) #f) #f)
(void)
(let-values () (raise-argument-error 'in-naturals "exact-nonnegative-integer?" n_11))))))
(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_17) (not (pair? (list-stream-ref v_17 0))))
(lambda (v_18) (car (list-stream-ref v_18 0)))
(lambda (v_19) (make-list-stream (cdr (list-stream-ref v_19 0))))))
(cons prop:gen-sequence (lambda (v_20) (values car cdr values (list-stream-ref v_20 0) pair? #f #f))))))
(define-values
(check-list)
(lambda (l_4) (begin (if (list? l_4) (void) (let-values () (raise-argument-error 'in-list "list?" l_4))))))
(define-values
(check-in-hash)
(lambda (ht_6)
(begin
(if ((lambda (ht_7) (hash? ht_7)) ht_6) (void) (let-values () (raise-argument-error 'in-hash "hash?" ht_6))))))
(define-values
(check-in-immutable-hash)
(lambda (ht_8)
(begin
(if ((lambda (ht_9) (if (hash? ht_9) (immutable? ht_9) #f)) ht_8)
(void)
(let-values () (raise-argument-error 'in-immutable-hash "(and/c hash? immutable?)" ht_8))))))
(define-values
(check-in-hash-keys)
(lambda (ht_10)
(begin
(if ((lambda (ht_11) (hash? ht_11)) ht_10)
(void)
(let-values () (raise-argument-error 'in-hash-keys "hash?" ht_10))))))
(define-values
(check-in-immutable-hash-keys)
(lambda (ht_12)
(begin
(if ((lambda (ht_13) (if (hash? ht_13) (immutable? ht_13) #f)) ht_12)
(void)
(let-values () (raise-argument-error 'in-immutable-hash-keys "(and/c hash? immutable?)" ht_12))))))
(define-values
(check-in-hash-values)
(lambda (ht_14)
(begin
(if ((lambda (ht_15) (hash? ht_15)) ht_14)
(void)
(let-values () (raise-argument-error 'in-hash-values "hash?" ht_14))))))
(define-values
(check-ranges)
(lambda (who_3 type-name_0 vec_7 start_4 stop_0 step_1 len_0)
(begin
(begin
(if (if (exact-nonnegative-integer? start_4)
(let-values (((or-part_21) (< start_4 len_0))) (if or-part_21 or-part_21 (= len_0 start_4 stop_0)))
#f)
(void)
(let-values () (raise-range-error who_3 type-name_0 "starting " start_4 vec_7 0 (sub1 len_0))))
(if (if (exact-integer? stop_0) (if (<= -1 stop_0) (<= stop_0 len_0) #f) #f)
(void)
(let-values () (raise-range-error who_3 type-name_0 "stopping " stop_0 vec_7 -1 len_0)))
(if (if (exact-integer? step_1) (not (zero? step_1)) #f)
(void)
(let-values () (raise-argument-error who_3 "(and/c exact-integer? (not/c zero?))" step_1)))
(if (if (< start_4 stop_0) (< step_1 0) #f)
(let-values ()
(raise-arguments-error
who_3
"starting index less than stopping index, but given a negative step"
"starting index"
start_4
"stopping index"
stop_0
"step"
step_1))
(void))
(if (if (< stop_0 start_4) (> step_1 0) #f)
(let-values ()
(raise-arguments-error
who_3
"starting index more than stopping index, but given a positive step"
"starting index"
start_4
"stopping index"
stop_0
"step"
step_1))
(void))))))
(define-values
(normalise-inputs)
(lambda (who_4 type-name_1 vector?_0 unsafe-vector-length_0 vec_8 start_5 stop_1 step_2)
(begin
(begin
(if (vector?_0 vec_8) (void) (let-values () (raise-argument-error who_4 type-name_1 vec_8)))
(let-values (((len_1) (unsafe-vector-length_0 vec_8)))
(let-values (((stop*_0) (if stop_1 stop_1 len_1)))
(begin
(check-ranges who_4 type-name_1 vec_8 start_5 stop*_0 step_2 len_1)
(values vec_8 start_5 stop*_0 step_2))))))))
(define-values
(unsafe-normalise-inputs)
(lambda (unsafe-vector-length_1 vec_9 start_6 stop_2 step_3)
(begin
(values
vec_9
start_6
(let-values (((or-part_22) stop_2)) (if or-part_22 or-part_22 (unsafe-vector-length_1 vec_9)))
step_3))))
(define-values
(check-vector)
(lambda (v_21) (begin (if (vector? v_21) (void) (let-values () (raise-argument-error 'in-vector "vector" v_21))))))
(define-values
(check-string)
(lambda (v_22) (begin (if (string? v_22) (void) (let-values () (raise-argument-error 'in-string "string" v_22))))))
(define-values
(check-bytes)
(lambda (v_23) (begin (if (bytes? v_23) (void) (let-values () (raise-argument-error 'in-bytes "bytes" v_23))))))
(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_24) ((do-stream-ref v_24 0)))
(lambda (v_25) ((do-stream-ref v_25 1)))
(lambda (v_26) ((do-stream-ref v_26 2))))))))
(define-values (empty-stream) (make-do-stream (lambda () #t) void void))
(define-values
(grow-vector)
(lambda (vec_10)
(begin
(let-values (((n_12) (vector-length vec_10)))
(let-values (((new-vec_0) (make-vector (* 2 n_12))))
(begin (vector-copy! new-vec_0 0 vec_10 0 n_12) new-vec_0))))))
(define-values
(shrink-vector)
(lambda (vec_11 i_19)
(begin (let-values (((new-vec_1) (make-vector i_19))) (begin (vector-copy! new-vec_1 0 vec_11 0 i_19) new-vec_1)))))
(define-values
(map2)
(let-values (((map_0)
(case-lambda
((f_0 l_5)
(begin
'map
(if (if (variable-reference-from-unsafe? (#%variable-reference))
#t
(if (procedure? f_0) (if (procedure-arity-includes? f_0 1) (list? l_5) #f) #f))
((letrec-values (((loop_34)
(lambda (l_6)
(begin
'loop
(if (null? l_6)
(let-values () null)
(let-values ()
(let-values (((r_3) (cdr l_6)))
(cons (f_0 (car l_6)) (loop_34 r_3)))))))))
loop_34)
l_5)
(gen-map f_0 (list l_5)))))
((f_1 l1_0 l2_0)
(if (if (variable-reference-from-unsafe? (#%variable-reference))
#t
(if (procedure? f_1)
(if (procedure-arity-includes? f_1 2)
(if (list? l1_0) (if (list? l2_0) (= (length l1_0) (length l2_0)) #f) #f)
#f)
#f))
((letrec-values (((loop_35)
(lambda (l1_1 l2_1)
(begin
'loop
(if (null? l1_1)
(let-values () null)
(let-values ()
(let-values (((r1_0) (cdr l1_1)) ((r2_0) (cdr l2_1)))
(cons (f_1 (car l1_1) (car l2_1)) (loop_35 r1_0 r2_0)))))))))
loop_35)
l1_0
l2_0)
(gen-map f_1 (list l1_0 l2_0))))
((f_2 l_7 . args_0) (gen-map f_2 (cons l_7 args_0))))))
map_0))
(define-values
(for-each2)
(let-values (((for-each_0)
(case-lambda
((f_3 l_8)
(begin
'for-each
(if (if (variable-reference-from-unsafe? (#%variable-reference))
#t
(if (procedure? f_3) (if (procedure-arity-includes? f_3 1) (list? l_8) #f) #f))
((letrec-values (((loop_36)
(lambda (l_9)
(begin
'loop
(if (null? l_9)
(let-values () (void))
(let-values ()
(let-values (((r_4) (cdr l_9)))
(begin (f_3 (car l_9)) (loop_36 r_4)))))))))
loop_36)
l_8)
(gen-for-each f_3 (list l_8)))))
((f_4 l1_2 l2_2)
(if (if (variable-reference-from-unsafe? (#%variable-reference))
#t
(if (procedure? f_4)
(if (procedure-arity-includes? f_4 2)
(if (list? l1_2) (if (list? l2_2) (= (length l1_2) (length l2_2)) #f) #f)
#f)
#f))
((letrec-values (((loop_37)
(lambda (l1_3 l2_3)
(begin
'loop
(if (null? l1_3)
(let-values () (void))
(let-values ()
(let-values (((r1_1) (cdr l1_3)) ((r2_1) (cdr l2_3)))
(begin (f_4 (car l1_3) (car l2_3)) (loop_37 r1_1 r2_1)))))))))
loop_37)
l1_2
l2_2)
(gen-for-each f_4 (list l1_2 l2_2))))
((f_5 l_10 . args_1) (gen-for-each f_5 (cons l_10 args_1))))))
for-each_0))
(define-values
(andmap2)
(let-values (((andmap_0)
(case-lambda
((f_6 l_11)
(begin
'andmap
(if (if (variable-reference-from-unsafe? (#%variable-reference))
#t
(if (procedure? f_6) (if (procedure-arity-includes? f_6 1) (list? l_11) #f) #f))
(if (null? l_11)
#t
((letrec-values (((loop_38)
(lambda (l_12)
(begin
'loop
(if (null? (cdr l_12))
(let-values () (f_6 (car l_12)))
(let-values ()
(let-values (((r_5) (cdr l_12)))
(if (f_6 (car l_12)) (loop_38 r_5) #f))))))))
loop_38)
l_11))
(gen-andmap f_6 (list l_11)))))
((f_7 l1_4 l2_4)
(if (if (variable-reference-from-unsafe? (#%variable-reference))
#t
(if (procedure? f_7)
(if (procedure-arity-includes? f_7 2)
(if (list? l1_4) (if (list? l2_4) (= (length l1_4) (length l2_4)) #f) #f)
#f)
#f))
(if (null? l1_4)
#t
((letrec-values (((loop_39)
(lambda (l1_5 l2_5)
(begin
'loop
(if (null? (cdr l1_5))
(let-values () (f_7 (car l1_5) (car l2_5)))
(let-values ()
(let-values (((r1_2) (cdr l1_5)) ((r2_2) (cdr l2_5)))
(if (f_7 (car l1_5) (car l2_5)) (loop_39 r1_2 r2_2) #f))))))))
loop_39)
l1_4
l2_4))
(gen-andmap f_7 (list l1_4 l2_4))))
((f_8 l_13 . args_2) (gen-andmap f_8 (cons l_13 args_2))))))
andmap_0))
(define-values
(ormap2)
(let-values (((ormap_0)
(case-lambda
((f_9 l_14)
(begin
'ormap
(if (if (variable-reference-from-unsafe? (#%variable-reference))
#t
(if (procedure? f_9) (if (procedure-arity-includes? f_9 1) (list? l_14) #f) #f))
(if (null? l_14)
#f
((letrec-values (((loop_40)
(lambda (l_15)
(begin
'loop
(if (null? (cdr l_15))
(let-values () (f_9 (car l_15)))
(let-values ()
(let-values (((r_6) (cdr l_15)))
(let-values (((or-part_23) (f_9 (car l_15))))
(if or-part_23 or-part_23 (loop_40 r_6))))))))))
loop_40)
l_14))
(gen-ormap f_9 (list l_14)))))
((f_10 l1_6 l2_6)
(if (if (variable-reference-from-unsafe? (#%variable-reference))
#t
(if (procedure? f_10)
(if (procedure-arity-includes? f_10 2)
(if (list? l1_6) (if (list? l2_6) (= (length l1_6) (length l2_6)) #f) #f)
#f)
#f))
(if (null? l1_6)
#f
((letrec-values (((loop_41)
(lambda (l1_7 l2_7)
(begin
'loop
(if (null? (cdr l1_7))
(let-values () (f_10 (car l1_7) (car l2_7)))
(let-values ()
(let-values (((r1_3) (cdr l1_7)) ((r2_3) (cdr l2_7)))
(let-values (((or-part_24) (f_10 (car l1_7) (car l2_7))))
(if or-part_24 or-part_24 (loop_41 r1_3 r2_3))))))))))
loop_41)
l1_6
l2_6))
(gen-ormap f_10 (list l1_6 l2_6))))
((f_11 l_16 . args_3) (gen-ormap f_11 (cons l_16 args_3))))))
ormap_0))
(define-values
(check-args)
(lambda (who_5 f_12 ls_4)
(begin
(begin
(if (procedure? f_12) (void) (let-values () (raise-argument-error who_5 "procedure?" f_12)))
((letrec-values (((loop_42)
(lambda (prev-len_0 ls_5 i_20)
(begin
'loop
(if (null? ls_5)
(void)
(let-values ()
(let-values (((l_17) (car ls_5)))
(begin
(if (list? l_17) (void) (let-values () (raise-argument-error who_5 "list?" l_17)))
(let-values (((len_2) (length l_17)))
(begin
(if (if prev-len_0 (not (= len_2 prev-len_0)) #f)
(let-values ()
(raise-arguments-error
who_5
"all lists must have same size"
"first list length"
prev-len_0
"other list length"
len_2
"procedure"
f_12))
(void))
(loop_42 len_2 (cdr ls_5) (add1 i_20))))))))))))
loop_42)
#f
ls_4
1)
(if (procedure-arity-includes? f_12 (length ls_4))
(void)
(let-values ()
(let-values (((required-keywords_0 optional-keywords_0) (procedure-keywords f_12)))
(apply
raise-arguments-error
who_5
(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"))
"given procedure"
(unquoted-printing-string
(let-values (((or-part_25)
(let-values (((n_13) (object-name f_12))) (if (symbol? n_13) (symbol->string n_13) #f))))
(if or-part_25 or-part_25 "#<procedure>")))
(append
(let-values (((a_10) (procedure-arity f_12)))
(if (pair? required-keywords_0)
(let-values () null)
(if (integer? a_10)
(let-values () (list "expected" a_10))
(if (arity-at-least? a_10)
(let-values ()
(list
"expected"
(unquoted-printing-string
(string-append "at least " (number->string (arity-at-least-value a_10))))))
(let-values () null)))))
(if (pair? required-keywords_0) (let-values () null) (let-values () (list "given" (length ls_4))))
(if (pair? required-keywords_0)
(let-values ()
(list
"required keywords"
(unquoted-printing-string
(apply
string-append
(cdr
((letrec-values (((loop_43)
(lambda (kws_0)
(begin
'loop
(if (null? kws_0)
(let-values () null)
(let-values ()
(list*
" "
(string-append "#:" (keyword->string (car kws_0)))
(loop_43 (cdr kws_0)))))))))
loop_43)
required-keywords_0))))))
(let-values () null))
(let-values (((w_0) (quotient (error-print-width) (length ls_4))))
(if (> w_0 10)
(list
"argument lists..."
(unquoted-printing-string
(apply
string-append
((letrec-values (((loop_44)
(lambda (ls_6)
(begin
'loop
(if (null? ls_6)
(let-values () null)
(let-values ()
(cons
(string-append "\n " ((error-value->string-handler) (car ls_6) w_0))
(loop_44 (cdr ls_6)))))))))
loop_44)
ls_4))))
null)))))))))))
(define-values
(gen-map)
(lambda (f_13 ls_7)
(begin
(begin
(if (variable-reference-from-unsafe? (#%variable-reference)) #t (check-args 'map f_13 ls_7))
((letrec-values (((loop_45)
(lambda (ls_8)
(begin
'loop
(if (null? (car ls_8))
(let-values () null)
(let-values ()
(let-values (((next-ls_0) (map2 cdr ls_8)))
(cons (apply f_13 (map2 car ls_8)) (loop_45 next-ls_0)))))))))
loop_45)
ls_7)))))
(define-values
(gen-for-each)
(lambda (f_14 ls_9)
(begin
(begin
(if (variable-reference-from-unsafe? (#%variable-reference)) #t (check-args 'for-each f_14 ls_9))
((letrec-values (((loop_46)
(lambda (ls_10)
(begin
'loop
(if (null? (car ls_10))
(void)
(let-values ()
(let-values (((next-ls_1) (map2 cdr ls_10)))
(begin (apply f_14 (map2 car ls_10)) (loop_46 next-ls_1)))))))))
loop_46)
ls_9)))))
(define-values
(gen-andmap)
(lambda (f_15 ls_11)
(begin
(begin
(if (variable-reference-from-unsafe? (#%variable-reference)) #t (check-args 'andmap f_15 ls_11))
((letrec-values (((loop_47)
(lambda (ls_12)
(begin
'loop
(if (null? (car ls_12))
(let-values () #t)
(if (null? (cdar ls_12))
(let-values () (apply f_15 (map2 car ls_12)))
(let-values ()
(let-values (((next-ls_2) (map2 cdr ls_12)))
(if (apply f_15 (map2 car ls_12)) (loop_47 next-ls_2) #f)))))))))
loop_47)
ls_11)))))
(define-values
(gen-ormap)
(lambda (f_16 ls_13)
(begin
(begin
(if (variable-reference-from-unsafe? (#%variable-reference)) #t (check-args 'ormap f_16 ls_13))
((letrec-values (((loop_48)
(lambda (ls_14)
(begin
'loop
(if (null? (car ls_14))
(let-values () #f)
(if (null? (cdar ls_14))
(let-values () (apply f_16 (map2 car ls_14)))
(let-values ()
(let-values (((next-ls_3) (map2 cdr ls_14)))
(let-values (((or-part_26) (apply f_16 (map2 car ls_14))))
(if or-part_26 or-part_26 (loop_48 next-ls_3)))))))))))
loop_48)
ls_13)))))
(define-values
(hash-keys)
(lambda (h_0)
(begin
((letrec-values (((loop_9)
(lambda (pos_0)
(begin
'loop
(if pos_0
(cons (hash-iterate-key h_0 pos_0) (loop_9 (hash-iterate-next h_0 pos_0)))
null)))))
loop_9)
(hash-iterate-first h_0)))))
(define-values
(sort.1)
(lambda (cache-keys?2_0 key1_0 lst5_0 less?6_0)
(begin
'sort
(let-values (((lst_6) lst5_0))
(let-values (((less?_0) less?6_0))
(let-values (((getkey_4) key1_0))
(let-values (((cache-keys?_3) cache-keys?2_0))
(let-values ()
(begin
(if (list? lst_6) (void) (let-values () (raise-argument-error 'sort "list?" lst_6)))
(if (if (procedure? less?_0) (procedure-arity-includes? less?_0 2) #f)
(void)
(let-values () (raise-argument-error 'sort "(any/c any/c . -> . any/c)" less?_0)))
(if (if getkey_4 (not (if (procedure? getkey_4) (procedure-arity-includes? getkey_4 1) #f)) #f)
(let-values () (raise-argument-error 'sort "(any/c . -> . any/c)" getkey_4))
(void))
(if getkey_4 (sort lst_6 less?_0 getkey_4 cache-keys?_3) (sort lst_6 less?_0)))))))))))
(define-values
(filter)
(lambda (f_17 list_0)
(begin
(begin
(if (if (procedure? f_17) (procedure-arity-includes? f_17 1) #f)
(void)
(let-values () (raise-argument-error 'filter "(any/c . -> . any/c)" f_17)))
(if (list? list_0) (void) (let-values () (raise-argument-error 'filter "list?" list_0)))
((letrec-values (((loop_49)
(lambda (l_18 result_0)
(begin
'loop
(if (null? l_18)
(reverse$1 result_0)
(loop_49 (cdr l_18) (if (f_17 (car l_18)) (cons (car l_18) result_0) result_0)))))))
loop_49)
list_0
null)))))
(define-values (binary-or-text-desc) "(or/c 'binary 'text)")
(define-values
(open-input-file.1)
(lambda (for-module?2_0 mode1_0 path5_0)
(begin
'open-input-file
(let-values (((path_0) path5_0))
(let-values (((mode_0) mode1_0))
(let-values (((for-module?_0) for-module?2_0))
(let-values ()
(begin
(if (path-string? path_0)
(void)
(let-values () (raise-argument-error 'open-input-file "path-string?" path_0)))
(if (memq mode_0 '(binary text))
(void)
(let-values () (raise-argument-error 'open-input-file binary-or-text-desc mode_0)))
(open-input-file path_0 mode_0 (if for-module?_0 'module 'none))))))))))
(define-values
(with-input-from-file.1)
(lambda (mode31_0 path33_0 proc34_0)
(begin
'with-input-from-file
(let-values (((path_1) path33_0))
(let-values (((proc_0) proc34_0))
(let-values (((mode_1) mode31_0))
(let-values ()
(begin
(if (path-string? path_1)
(void)
(let-values () (raise-argument-error 'with-input-from-file "path-string?" path_1)))
(if (if (procedure? proc_0) (procedure-arity-includes? proc_0 0) #f)
(void)
(let-values () (raise-argument-error 'with-input-from-file "(-> any)" proc_0)))
(if (memq mode_1 '(binary text))
(void)
(let-values () (raise-argument-error 'with-input-from-file binary-or-text-desc mode_1)))
(with-input-from-file path_1 proc_0 mode_1)))))))))
(define-values
(call-with-input-file*.1)
(lambda (mode43_0 path45_0 proc46_0)
(begin
'call-with-input-file*
(let-values (((path_2) path45_0))
(let-values (((proc_1) proc46_0))
(let-values (((mode_2) mode43_0))
(let-values ()
(begin
(if (path-string? path_2)
(void)
(let-values () (raise-argument-error 'call-with-input-file* "path-string?" path_2)))
(if (if (procedure? proc_1) (procedure-arity-includes? proc_1 1) #f)
(void)
(let-values () (raise-argument-error 'call-with-input-file* "(input-port? . -> . any)" proc_1)))
(if (memq mode_2 '(binary text))
(void)
(let-values () (raise-argument-error 'call-with-input-file* binary-or-text-desc mode_2)))
(let-values (((p_3) (open-input-file path_2 mode_2)))
(dynamic-wind void (lambda () (proc_1 p_3)) (lambda () (close-input-port p_3))))))))))))
(define-values (the-empty-hash) '#hash())
(define-values (the-empty-hasheq) '#hasheq())
(define-values (the-empty-hasheqv) '#hasheqv())
(define-values
(set)
(case-lambda
(() (begin the-empty-hash))
(l_19
(let-values (((lst_7) l_19))
(begin
(if (variable-reference-from-unsafe? (#%variable-reference)) (void) (let-values () (check-list lst_7)))
((letrec-values (((for-loop_0)
(lambda (s_14 lst_8)
(begin
'for-loop
(if (pair? lst_8)
(let-values (((e_2) (unsafe-car lst_8)) ((rest_0) (unsafe-cdr lst_8)))
(let-values (((s_15)
(let-values (((s_16) s_14))
(let-values (((s_17) (let-values () (hash-set s_16 e_2 #t))))
(values s_17)))))
(if (not #f) (for-loop_0 s_15 rest_0) s_15)))
s_14)))))
for-loop_0)
the-empty-hash
lst_7))))))
(define-values
(seteq)
(case-lambda
(() (begin the-empty-hasheq))
(l_17
(let-values (((lst_9) l_17))
(begin
(if (variable-reference-from-unsafe? (#%variable-reference)) (void) (let-values () (check-list lst_9)))
((letrec-values (((for-loop_1)
(lambda (s_18 lst_10)
(begin
'for-loop
(if (pair? lst_10)
(let-values (((e_3) (unsafe-car lst_10)) ((rest_1) (unsafe-cdr lst_10)))
(let-values (((s_19)
(let-values (((s_20) s_18))
(let-values (((s_21) (let-values () (hash-set s_20 e_3 #t))))
(values s_21)))))
(if (not #f) (for-loop_1 s_19 rest_1) s_19)))
s_18)))))
for-loop_1)
the-empty-hasheq
lst_9))))))
(define-values (seteqv) (lambda () (begin the-empty-hasheqv)))
(define-values (set?) (lambda (s_22) (begin (hash? s_22))))
(define-values (set-empty?) (lambda (s_23) (begin (zero? (hash-count s_23)))))
(define-values (set-member?) (lambda (s_24 e_4) (begin (hash-ref s_24 e_4 #f))))
(define-values (set-count) (lambda (s_25) (begin (hash-count s_25))))
(define-values (set-add) (lambda (s_26 e_5) (begin (hash-set s_26 e_5 #t))))
(define-values (set-remove) (lambda (s_27 e_6) (begin (hash-remove s_27 e_6))))
(define-values (set-first) (lambda (s_28) (begin (hash-iterate-key s_28 (hash-iterate-first s_28)))))
(define-values (subset?) (lambda (s1_0 s2_0) (begin (hash-keys-subset? s1_0 s2_0))))
(define-values
(set=?)
(lambda (s1_1 s2_1)
(begin
(let-values (((or-part_27) (eq? s1_1 s2_1)))
(if or-part_27 or-part_27 (if (= (hash-count s1_1) (hash-count s2_1)) (hash-keys-subset? s1_1 s2_1) #f))))))
(define-values
(set-subtract)
(lambda (s1_2 s2_2)
(begin
(let-values (((ht_16) s2_2))
(begin
(if (variable-reference-from-unsafe? (#%variable-reference))
(void)
(let-values () (check-in-immutable-hash-keys ht_16)))
((letrec-values (((for-loop_2)
(lambda (s1_3 i_21)
(begin
'for-loop
(if i_21
(let-values (((k_0) (unsafe-immutable-hash-iterate-key ht_16 i_21)))
(let-values (((s1_4)
(let-values (((s1_5) s1_3))
(let-values (((s1_6) (let-values () (hash-remove s1_5 k_0))))
(values s1_6)))))
(if (not #f)
(for-loop_2 s1_4 (unsafe-immutable-hash-iterate-next ht_16 i_21))
s1_4)))
s1_3)))))
for-loop_2)
s1_2
(unsafe-immutable-hash-iterate-first ht_16)))))))
(define-values
(set-union)
(lambda (s1_7 s2_3)
(begin
(if (< (set-count s1_7) (set-count s2_3))
(set-union s2_3 s1_7)
(let-values (((ht_17) s2_3))
(begin
(if (variable-reference-from-unsafe? (#%variable-reference))
(void)
(let-values () (check-in-immutable-hash-keys ht_17)))
((letrec-values (((for-loop_3)
(lambda (s1_8 i_22)
(begin
'for-loop
(if i_22
(let-values (((k_1) (unsafe-immutable-hash-iterate-key ht_17 i_22)))
(let-values (((s1_9)
(let-values (((s1_10) s1_8))
(let-values (((s1_11) (let-values () (hash-set s1_10 k_1 #t))))
(values s1_11)))))
(if (not #f)
(for-loop_3 s1_9 (unsafe-immutable-hash-iterate-next ht_17 i_22))
s1_9)))
s1_8)))))
for-loop_3)
s1_7
(unsafe-immutable-hash-iterate-first ht_17))))))))
(define-values
(set-intersect)
(lambda (s1_12 s2_4)
(begin
(if (< (set-count s1_12) (set-count s2_4))
(set-intersect s2_4 s1_12)
(let-values (((ht_18) s2_4))
(begin
(if (variable-reference-from-unsafe? (#%variable-reference))
(void)
(let-values () (check-in-immutable-hash-keys ht_18)))
((letrec-values (((for-loop_4)
(lambda (s_29 i_23)
(begin
'for-loop
(if i_23
(let-values (((k_2) (unsafe-immutable-hash-iterate-key ht_18 i_23)))
(let-values (((s_30)
(let-values (((s_31) s_29))
(let-values (((s_32)
(let-values ()
(if (hash-ref s1_12 k_2 #f)
s_31
(hash-remove s_31 k_2)))))
(values s_32)))))
(if (not #f)
(for-loop_4 s_30 (unsafe-immutable-hash-iterate-next ht_18 i_23))
s_30)))
s_29)))))
for-loop_4)
s2_4
(unsafe-immutable-hash-iterate-first ht_18))))))))
(define-values
(set-partition)
(lambda (s_33 pred_0 empty-y-set_0 empty-n-set_0)
(begin
(let-values (((ht_19) s_33))
(begin
(if (variable-reference-from-unsafe? (#%variable-reference))
(void)
(let-values () (check-in-immutable-hash-keys ht_19)))
((letrec-values (((for-loop_5)
(lambda (y_6 n_14 i_24)
(begin
'for-loop
(if i_24
(let-values (((v_27) (unsafe-immutable-hash-iterate-key ht_19 i_24)))
(let-values (((y_7 n_15)
(let-values (((y_8) y_6) ((n_16) n_14))
(let-values (((y_9 n_17)
(let-values ()
(if (pred_0 v_27)
(values (set-add y_8 v_27) n_16)
(values y_8 (set-add n_16 v_27))))))
(values y_9 n_17)))))
(if (not #f)
(for-loop_5 y_7 n_15 (unsafe-immutable-hash-iterate-next ht_19 i_24))
(values y_7 n_15))))
(values y_6 n_14))))))
for-loop_5)
empty-y-set_0
empty-n-set_0
(unsafe-immutable-hash-iterate-first ht_19)))))))
(define-values
(set->list)
(lambda (s_34)
(begin
(reverse$1
(let-values (((ht_20) s_34))
(begin
(if (variable-reference-from-unsafe? (#%variable-reference))
(void)
(let-values () (check-in-immutable-hash-keys ht_20)))
((letrec-values (((for-loop_6)
(lambda (fold-var_0 i_25)
(begin
'for-loop
(if i_25
(let-values (((k_3) (unsafe-immutable-hash-iterate-key ht_20 i_25)))
(let-values (((fold-var_1)
(let-values (((fold-var_2) fold-var_0))
(let-values (((fold-var_3)
(let-values ()
(cons (let-values () k_3) fold-var_2))))
(values fold-var_3)))))
(if (not #f)
(for-loop_6 fold-var_1 (unsafe-immutable-hash-iterate-next ht_20 i_25))
fold-var_1)))
fold-var_0)))))
for-loop_6)
null
(unsafe-immutable-hash-iterate-first ht_20))))))))
(define-values
(list->set)
(lambda (l_20)
(begin
(let-values (((lst_11) l_20))
(begin
(if (variable-reference-from-unsafe? (#%variable-reference)) (void) (let-values () (check-list lst_11)))
((letrec-values (((for-loop_7)
(lambda (table_0 lst_12)
(begin
'for-loop
(if (pair? lst_12)
(let-values (((k_4) (unsafe-car lst_12)) ((rest_2) (unsafe-cdr lst_12)))
(let-values (((table_1)
(let-values (((table_2) table_0))
(let-values (((table_3)
(let-values ()
(let-values (((key_7 val_0)
(let-values ()
(values (let-values () k_4) #t))))
(hash-set table_2 key_7 val_0)))))
(values table_3)))))
(if (not #f) (for-loop_7 table_1 rest_2) table_1)))
table_0)))))
for-loop_7)
'#hash()
lst_11))))))
(define-values
(list->seteq)
(lambda (l_21)
(begin
(let-values (((lst_13) l_21))
(begin
(if (variable-reference-from-unsafe? (#%variable-reference)) (void) (let-values () (check-list lst_13)))
((letrec-values (((for-loop_8)
(lambda (table_4 lst_14)
(begin
'for-loop
(if (pair? lst_14)
(let-values (((k_5) (unsafe-car lst_14)) ((rest_3) (unsafe-cdr lst_14)))
(let-values (((table_5)
(let-values (((table_6) table_4))
(let-values (((table_7)
(let-values ()
(let-values (((key_8 val_1)
(let-values ()
(values (let-values () k_5) #t))))
(hash-set table_6 key_8 val_1)))))
(values table_7)))))
(if (not #f) (for-loop_8 table_5 rest_3) table_5)))
table_4)))))
for-loop_8)
'#hasheq()
lst_13))))))
(define-values (start-atomic) (lambda () (begin (unsafe-start-atomic))))
(define-values (end-atomic) (lambda () (begin (unsafe-end-atomic))))
(define-values (start-breakable-atomic) (lambda () (begin (unsafe-start-breakable-atomic))))
(define-values (end-breakable-atomic) (lambda () (begin (unsafe-end-breakable-atomic))))
(define-values (cell.1$10) (unsafe-make-place-local #f))
(define-values
(entered-err-string-handler)
(lambda (s_35 n_18) (begin (call-as-nonatomic (lambda () ((error-value->string-handler) s_35 n_18))))))
(define-values (cell.2$5) (unsafe-make-place-local #f))
(define-values (cell.3$2) (unsafe-make-place-local #f))
(define-values (cell.4$2) (unsafe-make-place-local 0))
(define-values (exited-key) (gensym 'as-exit))
(define-values (lock-tag) (make-continuation-prompt-tag 'lock))
(define-values
(call-as-atomic)
(lambda (f_18)
(begin
(begin
(if (if (procedure? f_18) (procedure-arity-includes? f_18 0) #f)
(void)
(let-values () (raise-type-error 'call-as-atomic "procedure (arity 0)" f_18)))
(if (eq? (unsafe-place-local-ref cell.1$10) (current-thread))
(let-values ()
(dynamic-wind
(lambda ()
(begin
(start-breakable-atomic)
(unsafe-place-local-set! cell.4$2 (add1 (unsafe-place-local-ref cell.4$2)))))
f_18
(lambda ()
(begin
(unsafe-place-local-set! cell.4$2 (sub1 (unsafe-place-local-ref cell.4$2)))
(end-breakable-atomic)))))
(let-values ()
(with-continuation-mark
exited-key
#f
(call-with-continuation-prompt
(lambda ()
(dynamic-wind
(lambda () (begin (start-breakable-atomic) (unsafe-place-local-set! cell.1$10 (current-thread))))
(lambda ()
(begin
(unsafe-place-local-set! cell.2$5 (current-parameterization))
(unsafe-place-local-set! cell.3$2 (current-break-parameterization))
(with-continuation-mark
parameterization-key
(extend-parameterization
(continuation-mark-set-first #f parameterization-key)
error-value->string-handler
entered-err-string-handler)
(let-values ()
(with-continuation-mark
break-enabled-key
(make-thread-cell #f)
(begin
(check-for-break)
(let-values ()
(call-with-exception-handler
(lambda (exn_0)
(if (continuation-mark-set-first #f exited-key)
exn_0
(abort-current-continuation lock-tag (lambda () (raise exn_0)))))
f_18))))))))
(lambda ()
(begin
(unsafe-place-local-set! cell.1$10 #f)
(unsafe-place-local-set! cell.2$5 #f)
(unsafe-place-local-set! cell.3$2 #f)
(end-breakable-atomic)))))
lock-tag
(lambda (t_0) (t_0))))))))))
(define-values
(call-as-nonatomic)
(lambda (f_19)
(begin
(begin
(if (if (procedure? f_19) (procedure-arity-includes? f_19 0) #f)
(void)
(let-values () (raise-type-error 'call-as-nonatomic "procedure (arity 0)" f_19)))
(if (eq? (unsafe-place-local-ref cell.1$10) (current-thread))
(void)
(let-values () (error 'call-as-nonatomic "not in atomic area for ~e" f_19)))
(let-values (((paramz_2) (unsafe-place-local-ref cell.2$5))
((break-paramz_0) (unsafe-place-local-ref cell.3$2))
((extra-depth_0) (unsafe-place-local-ref cell.4$2)))
(with-continuation-mark
exited-key
#t
(call-with-parameterization
paramz_2
(lambda ()
(call-with-break-parameterization
break-paramz_0
(lambda ()
(dynamic-wind
(lambda ()
(begin
(unsafe-place-local-set! cell.1$10 #f)
(unsafe-place-local-set! cell.4$2 0)
(end-breakable-atomic)
((letrec-values (((loop_50)
(lambda (i_26)
(begin
'loop
(if (zero? i_26)
(void)
(let-values () (begin (end-breakable-atomic) (loop_50 (sub1 i_26)))))))))
loop_50)
extra-depth_0)))
f_19
(lambda ()
(begin
(start-breakable-atomic)
(unsafe-place-local-set! cell.2$5 paramz_2)
(unsafe-place-local-set! cell.3$2 break-paramz_0)
((letrec-values (((loop_43)
(lambda (i_27)
(begin
'loop
(if (zero? i_27)
(void)
(let-values ()
(begin (start-breakable-atomic) (loop_43 (sub1 i_27)))))))))
loop_43)
extra-depth_0)
(unsafe-place-local-set! cell.4$2 extra-depth_0)
(unsafe-place-local-set! cell.1$10 (current-thread)))))))))))))))
(define-values (not-an-fX.1) (lambda (who_6 v_28) (begin 'not-an-fX (raise-argument-error who_6 "fixnum?" v_28))))
(define-values (prop:serialize serialize? serialize-ref) (make-struct-type-property 'serialize))
(define-values
(prop:serialize-fill! serialize-fill!? serialize-fill!-ref)
(make-struct-type-property 'serialize-fill!))
(define-values (prop:reach-scopes reach-scopes? reach-scopes-ref) (make-struct-type-property 'reach-scopes))
(define-values
(prop:scope-with-bindings scope-with-bindings? scope-with-bindings-ref)
(make-struct-type-property 'scope-with-bindings))
(define-values
(prop:binding-reach-scopes binding-reach-scopes? binding-reach-scopes-ref)
(make-struct-type-property 'binding-reach-scopes))
(define-values
(log-performance?)
(if (environment-variables-ref (current-environment-variables) #"PLT_EXPANDER_TIMES") #t #f))
(define-values (cell.1$9) (unsafe-make-place-local #f))
(define-values (cell.2$4) (unsafe-make-place-local (make-hasheq)))
(define-values (performance-place-init!) (lambda () (begin (unsafe-place-local-set! cell.2$4 (make-hasheq)))))
(define-values
(struct:region
region1.1
region?
region-path
region-start
region-start-memory
region-as-nested
region-as-nested-memory
set-region-start!
set-region-start-memory!
set-region-as-nested!
set-region-as-nested-memory!)
(let-values (((struct:_0 make-_0 ?_0 -ref_0 -set!_0)
(let-values ()
(let-values () (make-struct-type 'region #f 5 0 #f null (current-inspector) #f '(0) #f 'region)))))
(values
struct:_0
make-_0
?_0
(make-struct-field-accessor -ref_0 0 'path)
(make-struct-field-accessor -ref_0 1 'start)
(make-struct-field-accessor -ref_0 2 'start-memory)
(make-struct-field-accessor -ref_0 3 'as-nested)
(make-struct-field-accessor -ref_0 4 'as-nested-memory)
(make-struct-field-mutator -set!_0 1 'start)
(make-struct-field-mutator -set!_0 2 'start-memory)
(make-struct-field-mutator -set!_0 3 'as-nested)
(make-struct-field-mutator -set!_0 4 'as-nested-memory))))
(define-values
(struct:stat stat2.1 stat? stat-msecs stat-memory stat-count set-stat-msecs! set-stat-memory! set-stat-count!)
(let-values (((struct:_1 make-_1 ?_1 -ref_1 -set!_1)
(let-values ()
(let-values () (make-struct-type 'stat #f 3 0 #f null (current-inspector) #f '() #f 'stat)))))
(values
struct:_1
make-_1
?_1
(make-struct-field-accessor -ref_1 0 'msecs)
(make-struct-field-accessor -ref_1 1 'memory)
(make-struct-field-accessor -ref_1 2 'count)
(make-struct-field-mutator -set!_1 0 'msecs)
(make-struct-field-mutator -set!_1 1 'memory)
(make-struct-field-mutator -set!_1 2 'count))))
(define-values (stat-key) (gensym))
(define-values
(start-performance-region)
(lambda path_3
(begin
(unsafe-place-local-set!
cell.1$9
(cons
(region1.1
(if (unsafe-place-local-ref cell.1$9)
((letrec-values (((loop_51)
(lambda (path_4 enclosing-path_0)
(begin
'loop
(if (null? path_4)
null
(cons
(if (if (eq? '_ (car path_4)) (pair? enclosing-path_0) #f)
(car enclosing-path_0)
(car path_4))
(loop_51
(cdr path_4)
(if (pair? enclosing-path_0) (cdr enclosing-path_0) null))))))))
loop_51)
path_3
(region-path (car (unsafe-place-local-ref cell.1$9))))
path_3)
(current-inexact-milliseconds)
(current-memory-use 'cumulative)
0.0
0)
(unsafe-place-local-ref cell.1$9))))))
(define-values
(end-performance-region)
(lambda ()
(begin
(let-values (((now_0) (current-inexact-milliseconds)))
(let-values (((now-memory_0) (current-memory-use 'cumulative)))
(let-values (((r_7) (car (unsafe-place-local-ref cell.1$9))))
(let-values ((()
(begin (unsafe-place-local-set! cell.1$9 (cdr (unsafe-place-local-ref cell.1$9))) (values))))
(let-values (((full-delta_0) (- now_0 (region-start r_7))))
(let-values (((delta_0) (- full-delta_0 (region-as-nested r_7))))
(let-values (((full-delta-memory_0) (- now-memory_0 (region-start-memory r_7))))
(let-values (((delta-memory_0) (- full-delta-memory_0 (region-as-nested-memory r_7))))
(begin
((letrec-values (((loop_52)
(lambda (accums_0 path_5)
(begin
'loop
(let-values (((key_9) (car path_5)))
(let-values (((accum_0)
(let-values (((or-part_25) (hash-ref accums_0 key_9 #f)))
(if or-part_25
or-part_25
(let-values (((accum_1) (make-hasheq)))
(begin
(hash-set! accums_0 key_9 accum_1)
accum_1))))))
(let-values (((s_36)
(let-values (((or-part_28)
(hash-ref accum_0 stat-key #f)))
(if or-part_28
or-part_28
(let-values (((s_20) (stat2.1 0.0 0 0)))
(begin
(hash-set! accum_0 stat-key s_20)
s_20))))))
(begin
(set-stat-msecs! s_36 (+ delta_0 (stat-msecs s_36)))
(set-stat-memory! s_36 (+ delta-memory_0 (stat-memory s_36)))
(if (null? (cdr path_5))
(let-values () (set-stat-count! s_36 (add1 (stat-count s_36))))
(void))
(if (null? (cdr path_5))
(void)
(let-values () (loop_52 accum_0 (cdr path_5))))))))))))
loop_52)
(unsafe-place-local-ref cell.2$4)
(region-path r_7))
(if (unsafe-place-local-ref cell.1$9)
(let-values ()
(begin
(set-region-as-nested!
(car (unsafe-place-local-ref cell.1$9))
(+ (region-as-nested (car (unsafe-place-local-ref cell.1$9))) full-delta_0))
(set-region-as-nested-memory!
(car (unsafe-place-local-ref cell.1$9))
(+
(region-as-nested-memory (car (unsafe-place-local-ref cell.1$9)))
full-delta-memory_0))))
(void))))))))))))))
(call-with-values
(lambda ()
(if log-performance?
(let-values ()
(void
(plumber-add-flush!
(current-plumber)
(lambda (h_1)
(let-values (((whole-len_0)
(lambda (s_37)
(begin
'whole-len
(caar
(let-values (((or-part_29) (regexp-match-positions '#rx"[.]" s_37)))
(if or-part_29 or-part_29 '(0))))))))
(let-values (((kb_0)
(lambda (b_8)
(begin
'kb
(let-values (((s_28) (number->string (quotient b_8 1024))))
(list->string
(let-values (((lst_15) (reverse$1 (string->list s_28))) ((start_7) 0))
(begin
(if (variable-reference-from-unsafe? (#%variable-reference))
(void)
(let-values () (check-list lst_15)))
(if (variable-reference-from-unsafe? (#%variable-reference))
(void)
(let-values () (check-naturals start_7)))
((letrec-values (((for-loop_9)
(lambda (l_22 lst_16 pos_1)
(begin
'for-loop
(if (if (pair? lst_16) #t #f)
(let-values (((c_7) (unsafe-car lst_16))
((rest_4) (unsafe-cdr lst_16))
((i_28) pos_1))
(let-values (((l_23)
(let-values (((l_24) l_22))
(let-values (((l_25)
(let-values ()
(if (if (positive?
i_28)
(zero?
(modulo i_28 3))
#f)
(let-values ()
(list*
c_7
'#\,
l_24))
(let-values ()
(cons
c_7
l_24))))))
(values l_25)))))
(if (not #f)
(for-loop_9 l_23 rest_4 (+ pos_1 1))
l_23)))
l_22)))))
for-loop_9)
null
lst_15
start_7)))))))))
(let-values (((label-max-len_0 value-max-len_0 memory-max-len_0 count-max-len_0)
((letrec-values (((loop_53)
(lambda (accums_1
label-len_0
value-len_0
memory-len_0
count-len_0
indent_0)
(begin
'loop
(let-values (((ht_21) accums_1))
(begin
(if (variable-reference-from-unsafe? (#%variable-reference))
(void)
(let-values () (check-in-hash ht_21)))
((letrec-values (((for-loop_10)
(lambda (label-len_1
value-len_1
memory-len_1
count-len_1
i_29)
(begin
'for-loop
(if i_29
(let-values (((k_6 v_29)
(hash-iterate-key+value
ht_21
i_29)))
(let-values (((label-len_2
value-len_2
memory-len_2
count-len_2)
(let-values (((label-len_3)
label-len_1)
((value-len_3)
value-len_1)
((memory-len_3)
memory-len_1)
((count-len_3)
count-len_1))
(let-values (((label-len_4
value-len_4
memory-len_4
count-len_4)
(let-values ()
(if (eq?
k_6
stat-key)
(let-values ()
(values
label-len_3
(max
value-len_3
(whole-len_0
(format