(guard (e (#t #f))
  (def-var! "jolt.ir" "const" (letrec ((const (lambda (v) (let fnrec6786 ((v v)) (let* ((_o$6787 (keyword #f "op")) (_o$6788 (keyword #f "const")) (_o$6789 (keyword #f "val")) (_o$6790 v)) (jolt-hash-map _o$6787 _o$6788 _o$6789 _o$6790)))))) const)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "local" (letrec ((local (lambda (name) (let fnrec6791 ((name name)) (let* ((_o$6792 (keyword #f "op")) (_o$6793 (keyword #f "local")) (_o$6794 (keyword #f "name")) (_o$6795 name)) (jolt-hash-map _o$6792 _o$6793 _o$6794 _o$6795)))))) local)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "var-ref" (letrec ((var-ref (lambda (ns name) (let fnrec6796 ((ns ns) (name name)) (let* ((_o$6797 (keyword #f "op")) (_o$6798 (keyword #f "var")) (_o$6799 (keyword #f "ns")) (_o$6800 ns) (_o$6801 (keyword #f "name")) (_o$6802 name)) (jolt-hash-map _o$6797 _o$6798 _o$6799 _o$6800 _o$6801 _o$6802)))))) var-ref)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "the-var" (letrec ((the-var (lambda (ns name) (let fnrec6803 ((ns ns) (name name)) (let* ((_o$6804 (keyword #f "op")) (_o$6805 (keyword #f "the-var")) (_o$6806 (keyword #f "ns")) (_o$6807 ns) (_o$6808 (keyword #f "name")) (_o$6809 name)) (jolt-hash-map _o$6804 _o$6805 _o$6806 _o$6807 _o$6808 _o$6809)))))) the-var)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "host-ref" (letrec ((host-ref (lambda (name) (let fnrec6810 ((name name)) (let* ((_o$6811 (keyword #f "op")) (_o$6812 (keyword #f "host")) (_o$6813 (keyword #f "name")) (_o$6814 name)) (jolt-hash-map _o$6811 _o$6812 _o$6813 _o$6814)))))) host-ref)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "host-static" (letrec ((host-static (lambda (class member) (let fnrec6815 ((class class) (member member)) (let* ((_o$6816 (keyword #f "op")) (_o$6817 (keyword #f "host-static")) (_o$6818 (keyword #f "class")) (_o$6819 class) (_o$6820 (keyword #f "member")) (_o$6821 member)) (jolt-hash-map _o$6816 _o$6817 _o$6818 _o$6819 _o$6820 _o$6821)))))) host-static)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "host-new" (letrec ((host-new (lambda (class args) (let fnrec6822 ((class class) (args args)) (let* ((_o$6823 (keyword #f "op")) (_o$6824 (keyword #f "host-new")) (_o$6825 (keyword #f "class")) (_o$6826 class) (_o$6827 (keyword #f "args")) (_o$6828 args)) (jolt-hash-map _o$6823 _o$6824 _o$6825 _o$6826 _o$6827 _o$6828)))))) host-new)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "if-node" (letrec ((if-node (lambda (test then _else) (let fnrec6829 ((test test) (then then) (_else _else)) (let* ((_o$6830 (keyword #f "op")) (_o$6831 (keyword #f "if")) (_o$6832 (keyword #f "test")) (_o$6833 test) (_o$6834 (keyword #f "then")) (_o$6835 then) (_o$6836 (keyword #f "else")) (_o$6837 _else)) (jolt-hash-map _o$6830 _o$6831 _o$6832 _o$6833 _o$6834 _o$6835 _o$6836 _o$6837)))))) if-node)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "do-node" (letrec ((do-node (lambda (statements ret) (let fnrec6838 ((statements statements) (ret ret)) (let* ((_o$6839 (keyword #f "op")) (_o$6840 (keyword #f "do")) (_o$6841 (keyword #f "statements")) (_o$6842 statements) (_o$6843 (keyword #f "ret")) (_o$6844 ret)) (jolt-hash-map _o$6839 _o$6840 _o$6841 _o$6842 _o$6843 _o$6844)))))) do-node)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "invoke" (letrec ((invoke (lambda (f args) (let fnrec6845 ((f f) (args args)) (let* ((_o$6846 (keyword #f "op")) (_o$6847 (keyword #f "invoke")) (_o$6848 (keyword #f "fn")) (_o$6849 f) (_o$6850 (keyword #f "args")) (_o$6851 args)) (jolt-hash-map _o$6846 _o$6847 _o$6848 _o$6849 _o$6850 _o$6851)))))) invoke)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "def-node" (letrec ((def-node (case-lambda ((ns name init) (let fnrec6852 ((ns ns) (name name) (init init)) (let* ((_o$6853 (keyword #f "op")) (_o$6854 (keyword #f "def")) (_o$6855 (keyword #f "ns")) (_o$6856 ns) (_o$6857 (keyword #f "name")) (_o$6858 name) (_o$6859 (keyword #f "init")) (_o$6860 init)) (jolt-hash-map _o$6853 _o$6854 _o$6855 _o$6856 _o$6857 _o$6858 _o$6859 _o$6860)))) ((ns name init meta) (let fnrec6861 ((ns ns) (name name) (init init) (meta meta)) (if (jolt-truthy? meta) (let* ((_o$6862 (keyword #f "op")) (_o$6863 (keyword #f "def")) (_o$6864 (keyword #f "ns")) (_o$6865 ns) (_o$6866 (keyword #f "name")) (_o$6867 name) (_o$6868 (keyword #f "init")) (_o$6869 init) (_o$6870 (keyword #f "meta")) (_o$6871 meta)) (jolt-hash-map _o$6862 _o$6863 _o$6864 _o$6865 _o$6866 _o$6867 _o$6868 _o$6869 _o$6870 _o$6871)) (let* ((_o$6872 (keyword #f "op")) (_o$6873 (keyword #f "def")) (_o$6874 (keyword #f "ns")) (_o$6875 ns) (_o$6876 (keyword #f "name")) (_o$6877 name) (_o$6878 (keyword #f "init")) (_o$6879 init)) (jolt-hash-map _o$6872 _o$6873 _o$6874 _o$6875 _o$6876 _o$6877 _o$6878 _o$6879)))))))) def-node)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "let-node" (letrec ((let-node (lambda (bindings body) (let fnrec6880 ((bindings bindings) (body body)) (let* ((_o$6881 (keyword #f "op")) (_o$6882 (keyword #f "let")) (_o$6883 (keyword #f "bindings")) (_o$6884 bindings) (_o$6885 (keyword #f "body")) (_o$6886 body)) (jolt-hash-map _o$6881 _o$6882 _o$6883 _o$6884 _o$6885 _o$6886)))))) let-node)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "fn-node" (letrec ((fn-node (lambda (name arities) (let fnrec6887 ((name name) (arities arities)) (if (jolt-truthy? name) (let* ((_o$6888 (keyword #f "op")) (_o$6889 (keyword #f "fn")) (_o$6890 (keyword #f "name")) (_o$6891 name) (_o$6892 (keyword #f "arities")) (_o$6893 arities)) (jolt-hash-map _o$6888 _o$6889 _o$6890 _o$6891 _o$6892 _o$6893)) (let* ((_o$6894 (keyword #f "op")) (_o$6895 (keyword #f "fn")) (_o$6896 (keyword #f "arities")) (_o$6897 arities)) (jolt-hash-map _o$6894 _o$6895 _o$6896 _o$6897))))))) fn-node)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "vector-node" (letrec ((vector-node (lambda (items) (let fnrec6898 ((items items)) (let* ((_o$6899 (keyword #f "op")) (_o$6900 (keyword #f "vector")) (_o$6901 (keyword #f "items")) (_o$6902 items)) (jolt-hash-map _o$6899 _o$6900 _o$6901 _o$6902)))))) vector-node)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "map-node" (letrec ((map-node (lambda (pairs) (let fnrec6903 ((pairs pairs)) (let* ((_o$6904 (keyword #f "op")) (_o$6905 (keyword #f "map")) (_o$6906 (keyword #f "pairs")) (_o$6907 pairs)) (jolt-hash-map _o$6904 _o$6905 _o$6906 _o$6907)))))) map-node)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "set-node" (letrec ((set-node (lambda (items) (let fnrec6908 ((items items)) (let* ((_o$6909 (keyword #f "op")) (_o$6910 (keyword #f "set")) (_o$6911 (keyword #f "items")) (_o$6912 items)) (jolt-hash-map _o$6909 _o$6910 _o$6911 _o$6912)))))) set-node)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "quote-node" (letrec ((quote-node (lambda (form) (let fnrec6913 ((form form)) (let* ((_o$6914 (keyword #f "op")) (_o$6915 (keyword #f "quote")) (_o$6916 (keyword #f "form")) (_o$6917 form)) (jolt-hash-map _o$6914 _o$6915 _o$6916 _o$6917)))))) quote-node)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "throw-node" (letrec ((throw-node (lambda (expr) (let fnrec6918 ((expr expr)) (let* ((_o$6919 (keyword #f "op")) (_o$6920 (keyword #f "throw")) (_o$6921 (keyword #f "expr")) (_o$6922 expr)) (jolt-hash-map _o$6919 _o$6920 _o$6921 _o$6922)))))) throw-node)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "coerce-node" (letrec ((coerce-node (lambda (kind expr) (let fnrec6923 ((kind kind) (expr expr)) (let* ((_o$6924 (keyword #f "op")) (_o$6925 (keyword #f "coerce")) (_o$6926 (keyword #f "kind")) (_o$6927 kind) (_o$6928 (keyword #f "expr")) (_o$6929 expr)) (jolt-hash-map _o$6924 _o$6925 _o$6926 _o$6927 _o$6928 _o$6929)))))) coerce-node)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "map-ir-children" (letrec ((map-ir-children (lambda (f node) (let fnrec6930 ((f f) (node node)) (let* ((op (jolt-get node (keyword #f "op")))) (if (jolt= op (keyword #f "if")) (let* ((_a$6931 node) (_a$6932 (keyword #f "test")) (_a$6933 (jolt-invoke f (jolt-get node (keyword #f "test")))) (_a$6934 (keyword #f "then")) (_a$6935 (jolt-invoke f (jolt-get node (keyword #f "then")))) (_a$6936 (keyword #f "else")) (_a$6937 (jolt-invoke f (jolt-get node (keyword #f "else"))))) (jolt-assoc _a$6931 _a$6932 _a$6933 _a$6934 _a$6935 _a$6936 _a$6937)) (if (jolt= op (keyword #f "do")) (let* ((_a$6938 node) (_a$6939 (keyword #f "statements")) (_a$6940 (jolt-invoke (var-deref "clojure.core" "mapv") f (jolt-get node (keyword #f "statements")))) (_a$6941 (keyword #f "ret")) (_a$6942 (jolt-invoke f (jolt-get node (keyword #f "ret"))))) (jolt-assoc _a$6938 _a$6939 _a$6940 _a$6941 _a$6942)) (if (jolt= op (keyword #f "throw")) (jolt-assoc node (keyword #f "expr") (jolt-invoke f (jolt-get node (keyword #f "expr")))) (if (jolt= op (keyword #f "coerce")) (jolt-assoc node (keyword #f "expr") (jolt-invoke f (jolt-get node (keyword #f "expr")))) (if (jolt= op (keyword #f "set-var")) (jolt-assoc node (keyword #f "val") (jolt-invoke f (jolt-get node (keyword #f "val")))) (if (jolt= op (keyword #f "set-field")) (let* ((_a$6943 node) (_a$6944 (keyword #f "obj")) (_a$6945 (jolt-invoke f (jolt-get node (keyword #f "obj")))) (_a$6946 (keyword #f "val")) (_a$6947 (jolt-invoke f (jolt-get node (keyword #f "val"))))) (jolt-assoc _a$6943 _a$6944 _a$6945 _a$6946 _a$6947)) (if (jolt= op (keyword #f "defmacro")) (jolt-assoc node (keyword #f "fn") (jolt-invoke f (jolt-get node (keyword #f "fn")))) (if (jolt= op (keyword #f "ffi-callable")) (jolt-assoc node (keyword #f "fn") (jolt-invoke f (jolt-get node (keyword #f "fn")))) (if (jolt= op (keyword #f "invoke")) (let* ((_a$6948 node) (_a$6949 (keyword #f "fn")) (_a$6950 (jolt-invoke f (jolt-get node (keyword #f "fn")))) (_a$6951 (keyword #f "args")) (_a$6952 (jolt-invoke (var-deref "clojure.core" "mapv") f (jolt-get node (keyword #f "args"))))) (jolt-assoc _a$6948 _a$6949 _a$6950 _a$6951 _a$6952)) (if (jolt= op (keyword #f "vector")) (jolt-assoc node (keyword #f "items") (jolt-invoke (var-deref "clojure.core" "mapv") f (jolt-get node (keyword #f "items")))) (if (jolt= op (keyword #f "set")) (jolt-assoc node (keyword #f "items") (jolt-invoke (var-deref "clojure.core" "mapv") f (jolt-get node (keyword #f "items")))) (if (jolt= op (keyword #f "map")) (jolt-assoc node (keyword #f "pairs") (let* ((_a$6956 (var-deref "clojure.core" "mapv")) (_a$6957 (lambda (pr) (let fnrec6953 ((pr pr)) (let* ((_o$6954 (jolt-invoke f (jolt-nth pr 0))) (_o$6955 (jolt-invoke f (jolt-nth pr 1)))) (jolt-vector _o$6954 _o$6955))))) (_a$6958 (jolt-get node (keyword #f "pairs")))) (jolt-invoke _a$6956 _a$6957 _a$6958))) (if (jolt= op (keyword #f "let")) (let* ((_a$6965 node) (_a$6966 (keyword #f "bindings")) (_a$6967 (let* ((_a$6962 (var-deref "clojure.core" "mapv")) (_a$6963 (lambda (b) (let fnrec6959 ((b b)) (let* ((_o$6960 (jolt-nth b 0)) (_o$6961 (jolt-invoke f (jolt-nth b 1)))) (jolt-vector _o$6960 _o$6961))))) (_a$6964 (jolt-get node (keyword #f "bindings")))) (jolt-invoke _a$6962 _a$6963 _a$6964))) (_a$6968 (keyword #f "body")) (_a$6969 (jolt-invoke f (jolt-get node (keyword #f "body"))))) (jolt-assoc _a$6965 _a$6966 _a$6967 _a$6968 _a$6969)) (if (jolt= op (keyword #f "loop")) (let* ((_a$6976 node) (_a$6977 (keyword #f "bindings")) (_a$6978 (let* ((_a$6973 (var-deref "clojure.core" "mapv")) (_a$6974 (lambda (b) (let fnrec6970 ((b b)) (let* ((_o$6971 (jolt-nth b 0)) (_o$6972 (jolt-invoke f (jolt-nth b 1)))) (jolt-vector _o$6971 _o$6972))))) (_a$6975 (jolt-get node (keyword #f "bindings")))) (jolt-invoke _a$6973 _a$6974 _a$6975))) (_a$6979 (keyword #f "body")) (_a$6980 (jolt-invoke f (jolt-get node (keyword #f "body"))))) (jolt-assoc _a$6976 _a$6977 _a$6978 _a$6979 _a$6980)) (if (jolt= op (keyword #f "recur")) (jolt-assoc node (keyword #f "args") (jolt-invoke (var-deref "clojure.core" "mapv") f (jolt-get node (keyword #f "args")))) (if (jolt= op (keyword #f "fn")) (jolt-assoc node (keyword #f "arities") (let* ((_a$6982 (var-deref "clojure.core" "mapv")) (_a$6983 (lambda (a) (let fnrec6981 ((a a)) (jolt-assoc a (keyword #f "body") (jolt-invoke f (jolt-get a (keyword #f "body"))))))) (_a$6984 (jolt-get node (keyword #f "arities")))) (jolt-invoke _a$6982 _a$6983 _a$6984))) (if (jolt= op (keyword #f "def")) (jolt-assoc node (keyword #f "init") (jolt-invoke f (jolt-get node (keyword #f "init")))) (if (jolt= op (keyword #f "host-call")) (let* ((_a$6985 node) (_a$6986 (keyword #f "target")) (_a$6987 (jolt-invoke f (jolt-get node (keyword #f "target")))) (_a$6988 (keyword #f "args")) (_a$6989 (jolt-invoke (var-deref "clojure.core" "mapv") f (jolt-get node (keyword #f "args"))))) (jolt-assoc _a$6985 _a$6986 _a$6987 _a$6988 _a$6989)) (if (jolt= op (keyword #f "host-new")) (jolt-assoc node (keyword #f "args") (jolt-invoke (var-deref "clojure.core" "mapv") f (jolt-get node (keyword #f "args")))) (if (jolt= op (keyword #f "try")) (let* ((n (jolt-assoc node (keyword #f "body") (jolt-invoke f (jolt-get node (keyword #f "body"))))) (n (if (jolt-truthy? (jolt-get node (keyword #f "catch-body"))) (jolt-assoc n (keyword #f "catch-body") (jolt-invoke f (jolt-get node (keyword #f "catch-body")))) n)) (n (if (jolt-truthy? (jolt-get node (keyword #f "finally"))) (jolt-assoc n (keyword #f "finally") (jolt-invoke f (jolt-get node (keyword #f "finally")))) n))) n) (if (jolt-truthy? (keyword #f "else")) node jolt-nil)))))))))))))))))))))))))) map-ir-children)))
(guard (e (#t #f))
  (def-var! "jolt.ir" "reduce-ir-children" (letrec ((reduce-ir-children (lambda (f acc node) (let fnrec6990 ((f f) (acc acc) (node node)) (let* ((op (jolt-get node (keyword #f "op")))) (if (jolt= op (keyword #f "if")) (let* ((_a$6994 f) (_a$6995 (let* ((_a$6991 f) (_a$6992 (jolt-invoke f acc (jolt-get node (keyword #f "test")))) (_a$6993 (jolt-get node (keyword #f "then")))) (jolt-invoke _a$6991 _a$6992 _a$6993))) (_a$6996 (jolt-get node (keyword #f "else")))) (jolt-invoke _a$6994 _a$6995 _a$6996)) (if (jolt= op (keyword #f "do")) (let* ((_a$6997 f) (_a$6998 (jolt-reduce f acc (jolt-get node (keyword #f "statements")))) (_a$6999 (jolt-get node (keyword #f "ret")))) (jolt-invoke _a$6997 _a$6998 _a$6999)) (if (jolt= op (keyword #f "throw")) (jolt-invoke f acc (jolt-get node (keyword #f "expr"))) (if (jolt= op (keyword #f "coerce")) (jolt-invoke f acc (jolt-get node (keyword #f "expr"))) (if (jolt= op (keyword #f "set-var")) (jolt-invoke f acc (jolt-get node (keyword #f "val"))) (if (jolt= op (keyword #f "set-field")) (let* ((_a$7000 f) (_a$7001 (jolt-invoke f acc (jolt-get node (keyword #f "obj")))) (_a$7002 (jolt-get node (keyword #f "val")))) (jolt-invoke _a$7000 _a$7001 _a$7002)) (if (jolt= op (keyword #f "defmacro")) (jolt-invoke f acc (jolt-get node (keyword #f "fn"))) (if (jolt= op (keyword #f "ffi-callable")) (jolt-invoke f acc (jolt-get node (keyword #f "fn"))) (if (jolt= op (keyword #f "invoke")) (let* ((_a$7003 f) (_a$7004 (jolt-invoke f acc (jolt-get node (keyword #f "fn")))) (_a$7005 (jolt-get node (keyword #f "args")))) (jolt-reduce _a$7003 _a$7004 _a$7005)) (if (jolt= op (keyword #f "vector")) (jolt-reduce f acc (jolt-get node (keyword #f "items"))) (if (jolt= op (keyword #f "set")) (jolt-reduce f acc (jolt-get node (keyword #f "items"))) (if (jolt= op (keyword #f "map")) (let* ((_a$7010 (lambda (a pr) (let fnrec7006 ((a a) (pr pr)) (let* ((_a$7007 f) (_a$7008 (jolt-invoke f a (jolt-nth pr 0))) (_a$7009 (jolt-nth pr 1))) (jolt-invoke _a$7007 _a$7008 _a$7009))))) (_a$7011 acc) (_a$7012 (jolt-get node (keyword #f "pairs")))) (jolt-reduce _a$7010 _a$7011 _a$7012)) (if (jolt= op (keyword #f "let")) (let* ((_a$7017 f) (_a$7018 (let* ((_a$7014 (lambda (a b) (let fnrec7013 ((a a) (b b)) (jolt-invoke f a (jolt-nth b 1))))) (_a$7015 acc) (_a$7016 (jolt-get node (keyword #f "bindings")))) (jolt-reduce _a$7014 _a$7015 _a$7016))) (_a$7019 (jolt-get node (keyword #f "body")))) (jolt-invoke _a$7017 _a$7018 _a$7019)) (if (jolt= op (keyword #f "loop")) (let* ((_a$7024 f) (_a$7025 (let* ((_a$7021 (lambda (a b) (let fnrec7020 ((a a) (b b)) (jolt-invoke f a (jolt-nth b 1))))) (_a$7022 acc) (_a$7023 (jolt-get node (keyword #f "bindings")))) (jolt-reduce _a$7021 _a$7022 _a$7023))) (_a$7026 (jolt-get node (keyword #f "body")))) (jolt-invoke _a$7024 _a$7025 _a$7026)) (if (jolt= op (keyword #f "recur")) (jolt-reduce f acc (jolt-get node (keyword #f "args"))) (if (jolt= op (keyword #f "fn")) (let* ((_a$7028 (lambda (a ar) (let fnrec7027 ((a a) (ar ar)) (jolt-invoke f a (jolt-get ar (keyword #f "body")))))) (_a$7029 acc) (_a$7030 (jolt-get node (keyword #f "arities")))) (jolt-reduce _a$7028 _a$7029 _a$7030)) (if (jolt= op (keyword #f "def")) (if (jolt-truthy? (jolt-get node (keyword #f "init"))) (jolt-invoke f acc (jolt-get node (keyword #f "init"))) acc) (if (jolt= op (keyword #f "host-call")) (let* ((_a$7031 f) (_a$7032 (jolt-invoke f acc (jolt-get node (keyword #f "target")))) (_a$7033 (jolt-get node (keyword #f "args")))) (jolt-reduce _a$7031 _a$7032 _a$7033)) (if (jolt= op (keyword #f "host-new")) (jolt-reduce f acc (jolt-get node (keyword #f "args"))) (if (jolt= op (keyword #f "try")) (let* ((a (jolt-invoke f acc (jolt-get node (keyword #f "body")))) (a (if (jolt-truthy? (jolt-get node (keyword #f "catch-body"))) (jolt-invoke f a (jolt-get node (keyword #f "catch-body"))) a)) (a (if (jolt-truthy? (jolt-get node (keyword #f "finally"))) (jolt-invoke f a (jolt-get node (keyword #f "finally"))) a))) a) (if (jolt-truthy? (keyword #f "else")) acc jolt-nil)))))))))))))))))))))))))) reduce-ir-children)))
(guard (e (#t #f))
  (declare-var! "jolt.analyzer" "analyze"))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.analyzer" "handled" (let* ((_o$7034 "quote") (_o$7035 "if") (_o$7036 "do") (_o$7037 "def") (_o$7038 "fn*") (_o$7039 "let*") (_o$7040 "loop*") (_o$7041 "recur") (_o$7042 "throw") (_o$7043 "try") (_o$7044 "syntax-quote") (_o$7045 "var") (_o$7046 "letfn") (_o$7047 "set!") (_o$7048 "defmacro")) (jolt-hash-set _o$7034 _o$7035 _o$7036 _o$7037 _o$7038 _o$7039 _o$7040 _o$7041 _o$7042 _o$7043 _o$7044 _o$7045 _o$7046 _o$7047 _o$7048)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "uncompilable" (letrec ((uncompilable (lambda (why) (let fnrec7049 ((why why)) (jolt-throw (jolt-invoke (var-deref "clojure.core" "str") "jolt/uncompilable: " why)))))) uncompilable)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.analyzer" "gensym-counter" (jolt-invoke (var-deref "clojure.core" "atom") 0) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "gen-name" (letrec ((gen-name (lambda (prefix) (let fnrec7050 ((prefix prefix)) (let* ((n (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.analyzer" "gensym-counter")))) (begin (jolt-invoke (var-deref "clojure.core" "swap!") (var-deref "jolt.analyzer" "gensym-counter") jolt-inc) (jolt-invoke (var-deref "clojure.core" "str") "_r$" prefix n))))))) gen-name)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "empty-env" (letrec ((empty-env (lambda () (let fnrec7051 () (let* ((_o$7052 (keyword #f "locals")) (_o$7053 (jolt-hash-set)) (_o$7054 (keyword #f "hints")) (_o$7055 (jolt-hash-map))) (jolt-hash-map _o$7052 _o$7053 _o$7054 _o$7055)))))) empty-env)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "local?" (letrec ((local? (lambda (env nm) (let fnrec7056 ((env env) (nm nm)) (jolt-contains? (jolt-get env (keyword #f "locals")) nm))))) local?)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "add-locals" (letrec ((add-locals (lambda (env names) (let fnrec7057 ((env env) (names names)) (jolt-invoke (var-deref "clojure.core" "update") env (keyword #f "locals") (lambda (p__85_) (let fnrec7058 ((p__85_ p__85_)) (jolt-reduce jolt-conj p__85_ names)))))))) add-locals)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "with-recur" (letrec ((with-recur (lambda (env name) (let fnrec7059 ((env env) (name name)) (jolt-assoc env (keyword #f "recur") name))))) with-recur)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "hint-of" (letrec ((hint-of (lambda (ctx sym) (let fnrec7060 ((ctx ctx) (sym sym)) (let* ((m (jolt-invoke (var-deref "jolt.host" "form-sym-meta") sym))) (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "nil?") m)) jolt-nil (if (jolt-truthy? (jolt-get m (keyword #f "struct"))) (keyword #f "struct") (if (jolt-truthy? (keyword #f "else")) (let* ((t (jolt-get m (keyword #f "tag")))) (if (jolt-truthy? (let* ((and__25__auto t)) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.host" "record-type?") ctx t) and__25__auto))) (keyword #f "struct") jolt-nil)) jolt-nil)))))))) hint-of)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "add-hint" (letrec ((add-hint (lambda (env nm h) (let fnrec7061 ((env env) (nm nm) (h h)) (if (jolt-truthy? h) (jolt-assoc env (keyword #f "hints") (jolt-assoc (jolt-get env (keyword #f "hints")) nm h)) env))))) add-hint)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "phint-of" (letrec ((phint-of (lambda (ctx sym) (let fnrec7062 ((ctx ctx) (sym sym)) (let* ((m (jolt-invoke (var-deref "jolt.host" "form-sym-meta") sym))) (if (jolt-truthy? m) (let* ((t (jolt-get m (keyword #f "tag")))) (if (jolt-truthy? t) (jolt-invoke (var-deref "jolt.host" "record-ctor-key") ctx t) jolt-nil)) jolt-nil)))))) phint-of)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "tag->nkind" (letrec ((tag->nkind (lambda (t) (let fnrec7063 ((t t)) (let* ((s (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-sym?") t)) (jolt-invoke (var-deref "jolt.host" "form-sym-name") t) (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "string?") t)) t (if (jolt-truthy? (keyword #f "else")) jolt-nil jolt-nil))))) (if (jolt= s "double") (keyword #f "double") (if (jolt= s "long") (keyword #f "long") (if (jolt-truthy? (keyword #f "else")) jolt-nil jolt-nil)))))))) tag->nkind)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "nhint-of" (letrec ((nhint-of (lambda (ctx sym) (let fnrec7064 ((ctx ctx) (sym sym)) (let* ((m (jolt-invoke (var-deref "jolt.host" "form-sym-meta") sym))) (if (jolt-truthy? m) (jolt-invoke (var-deref "jolt.analyzer" "tag->nkind") (jolt-get m (keyword #f "tag"))) jolt-nil)))))) nhint-of)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "with-ret-nhint" (letrec ((with-ret-nhint (lambda (node kind) (let fnrec7065 ((node node) (kind kind)) (if (jolt-truthy? (let* ((and__25__auto kind)) (if (jolt-truthy? and__25__auto) (jolt= (keyword #f "fn") (jolt-get node (keyword #f "op"))) and__25__auto))) (jolt-assoc node (keyword #f "arities") (let* ((_a$7067 (var-deref "clojure.core" "mapv")) (_a$7068 (lambda (a) (let fnrec7066 ((a a)) (if (jolt-truthy? (jolt-get a (keyword #f "ret-nhint"))) a (jolt-assoc a (keyword #f "ret-nhint") kind))))) (_a$7069 (jolt-get node (keyword #f "arities")))) (jolt-invoke _a$7067 _a$7068 _a$7069))) node))))) with-ret-nhint)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-seq" (letrec ((analyze-seq (lambda (ctx forms env) (let fnrec7070 ((ctx ctx) (forms forms) (env env)) (let* ((v (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (p__86_) (let fnrec7071 ((p__86_ p__86_)) (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx p__86_ env))) forms)) (n (jolt-count v))) (if (jolt-zero? n) (jolt-invoke (var-deref "jolt.ir" "const") jolt-nil) (if (jolt= 1 n) (jolt-first v) (if (jolt-truthy? (keyword #f "else")) (let* ((_a$7072 (var-deref "jolt.ir" "do-node")) (_a$7073 (jolt-invoke (var-deref "clojure.core" "subvec") v 0 (jolt-dec n))) (_a$7074 (jolt-peek v))) (jolt-invoke _a$7072 _a$7073 _a$7074)) jolt-nil)))))))) analyze-seq)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-bindings" (letrec ((analyze-bindings (lambda (ctx bvec env) (let fnrec7075 ((ctx ctx) (bvec bvec) (env env)) (let* ((i 0) (env env) (pairs (jolt-vector))) (let loop7076 ((i i) (env env) (pairs pairs)) (if (< i (jolt-count bvec)) (let* ((bsym (jolt-nth bvec i))) (begin (if (jolt-not (jolt-invoke (var-deref "jolt.host" "form-sym?") bsym)) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") "destructuring binding") jolt-nil) (let* ((nm (jolt-invoke (var-deref "jolt.host" "form-sym-name") bsym)) (init (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx (jolt-nth bvec (jolt-inc i)) env))) (let* ((_a$7083 (+ i 2)) (_a$7084 (let* ((_a$7077 (var-deref "jolt.analyzer" "add-hint")) (_a$7078 (jolt-invoke (var-deref "jolt.analyzer" "add-locals") env (jolt-vector nm))) (_a$7079 nm) (_a$7080 (jolt-invoke (var-deref "jolt.analyzer" "hint-of") ctx bsym))) (jolt-invoke _a$7077 _a$7078 _a$7079 _a$7080))) (_a$7085 (jolt-conj pairs (let* ((_o$7081 nm) (_o$7082 init)) (jolt-vector _o$7081 _o$7082))))) (loop7076 _a$7083 _a$7084 _a$7085))))) (let* ((_o$7086 pairs) (_o$7087 env)) (jolt-vector _o$7086 _o$7087))))))))) analyze-bindings)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "parse-params" (letrec ((parse-params (lambda (ctx pvec) (let fnrec7088 ((ctx ctx) (pvec pvec)) (let* ((i 0) (fixed (jolt-vector)) (rest-name jolt-nil) (hints (jolt-vector)) (phints (jolt-vector)) (nhints (jolt-vector))) (let loop7089 ((i i) (fixed fixed) (rest-name rest-name) (hints hints) (phints phints) (nhints nhints)) (if (< i (jolt-count pvec)) (let* ((p (jolt-nth pvec i))) (begin (if (jolt-not (jolt-invoke (var-deref "jolt.host" "form-sym?") p)) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") "destructuring fn param") jolt-nil) (if (jolt= "&" (jolt-invoke (var-deref "jolt.host" "form-sym-name") p)) (let* ((r (jolt-nth pvec (jolt-inc i)))) (begin (if (jolt-not (jolt-invoke (var-deref "jolt.host" "form-sym?") r)) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") "destructuring fn rest") jolt-nil) (let* ((_a$7090 (+ i 2)) (_a$7091 fixed) (_a$7092 (jolt-invoke (var-deref "jolt.host" "form-sym-name") r)) (_a$7093 hints) (_a$7094 phints) (_a$7095 nhints)) (loop7089 _a$7090 _a$7091 _a$7092 _a$7093 _a$7094 _a$7095)))) (let* ((nm (jolt-invoke (var-deref "jolt.host" "form-sym-name") p)) (h (jolt-invoke (var-deref "jolt.analyzer" "hint-of") ctx p)) (ph (jolt-invoke (var-deref "jolt.analyzer" "phint-of") ctx p)) (nh (jolt-invoke (var-deref "jolt.analyzer" "nhint-of") ctx p))) (let* ((_a$7102 (jolt-inc i)) (_a$7103 (jolt-conj fixed nm)) (_a$7104 rest-name) (_a$7105 (if (jolt-truthy? h) (jolt-conj hints (let* ((_o$7096 nm) (_o$7097 h)) (jolt-vector _o$7096 _o$7097))) hints)) (_a$7106 (if (jolt-truthy? ph) (jolt-conj phints (let* ((_o$7098 nm) (_o$7099 ph)) (jolt-vector _o$7098 _o$7099))) phints)) (_a$7107 (if (jolt-truthy? nh) (jolt-conj nhints (let* ((_o$7100 nm) (_o$7101 nh)) (jolt-vector _o$7100 _o$7101))) nhints))) (loop7089 _a$7102 _a$7103 _a$7104 _a$7105 _a$7106 _a$7107)))))) (let* ((_o$7108 (keyword #f "fixed")) (_o$7109 fixed) (_o$7110 (keyword #f "rest")) (_o$7111 rest-name) (_o$7112 (keyword #f "hints")) (_o$7113 hints) (_o$7114 (keyword #f "phints")) (_o$7115 phints) (_o$7116 (keyword #f "nhints")) (_o$7117 nhints)) (jolt-hash-map _o$7108 _o$7109 _o$7110 _o$7111 _o$7112 _o$7113 _o$7114 _o$7115 _o$7116 _o$7117))))))))) parse-params)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "uniquify-params" (letrec ((uniquify-params (lambda (names) (let fnrec7118 ((names names)) (let* ((n (jolt-count names))) (let* ((i 0) (out (jolt-vector))) (let loop7119 ((i i) (out out)) (if (< i n) (let* ((nm (jolt-nth names i)) (dup? (let* ((j (jolt-inc i))) (let loop7120 ((j j)) (if (>= j n) #f (if (jolt= nm (jolt-nth names j)) #t (if (jolt-truthy? (keyword #f "else")) (loop7120 (jolt-inc j)) jolt-nil))))))) (let* ((_a$7121 (jolt-inc i)) (_a$7122 (jolt-conj out (if (jolt-truthy? dup?) (jolt-invoke (var-deref "jolt.analyzer" "gen-name") (jolt-invoke (var-deref "clojure.core" "str") nm "_")) nm)))) (loop7119 _a$7121 _a$7122))) out)))))))) uniquify-params)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-arity" (letrec ((analyze-arity (lambda (ctx pvec body env fn-name) (let fnrec7123 ((ctx ctx) (pvec pvec) (body body) (env env) (fn-name fn-name)) (let* ((pp (jolt-invoke (var-deref "jolt.analyzer" "parse-params") ctx (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "jolt.host" "form-vec-items") pvec)))) (fixed (jolt-invoke (var-deref "jolt.analyzer" "uniquify-params") (jolt-get pp (keyword #f "fixed")))) (rst (jolt-get pp (keyword #f "rest"))) (rname (jolt-invoke (var-deref "jolt.analyzer" "gen-name") (let* ((_a$7124 (var-deref "clojure.core" "str")) (_a$7125 (jolt-invoke (var-deref "jolt.host" "compile-ns") ctx)) (_a$7126 "/") (_a$7127 (let* ((or__26__auto fn-name)) (if (jolt-truthy? or__26__auto) or__26__auto "fn"))) (_a$7128 "--")) (jolt-invoke _a$7124 _a$7125 _a$7126 _a$7127 _a$7128)))) (names (let* ((G__130 (jolt-invoke (var-deref "clojure.core" "vec") fixed))) (let* ((G__131 (if (jolt-truthy? rst) (jolt-conj G__130 rst) G__130))) (let* ((G__132 (if (jolt-truthy? fn-name) (jolt-conj G__131 fn-name) G__131))) G__132)))) (env0 (jolt-invoke (var-deref "jolt.analyzer" "with-recur") (jolt-invoke (var-deref "jolt.analyzer" "add-locals") env names) rname)) (env* (let* ((_a$7134 (lambda (e pr) (let fnrec7129 ((e e) (pr pr)) (let* ((_a$7130 (var-deref "jolt.analyzer" "add-hint")) (_a$7131 e) (_a$7132 (jolt-nth pr 0)) (_a$7133 (jolt-nth pr 1))) (jolt-invoke _a$7130 _a$7131 _a$7132 _a$7133))))) (_a$7135 env0) (_a$7136 (jolt-get pp (keyword #f "hints")))) (jolt-reduce _a$7134 _a$7135 _a$7136))) (arity (let* ((_o$7137 (keyword #f "params")) (_o$7138 fixed) (_o$7139 (keyword #f "recur-name")) (_o$7140 rname) (_o$7141 (keyword #f "body")) (_o$7142 (jolt-invoke (var-deref "jolt.analyzer" "analyze-seq") ctx body env*))) (jolt-hash-map _o$7137 _o$7138 _o$7139 _o$7140 _o$7141 _o$7142))) (arity (if (jolt-truthy? (jolt-seq (jolt-get pp (keyword #f "phints")))) (jolt-assoc arity (keyword #f "phints") (jolt-get pp (keyword #f "phints"))) arity)) (arity (if (jolt-truthy? (jolt-seq (jolt-get pp (keyword #f "nhints")))) (jolt-assoc arity (keyword #f "nhints") (jolt-get pp (keyword #f "nhints"))) arity))) (if (jolt-truthy? rst) (jolt-assoc arity (keyword #f "rest") rst) arity)))))) analyze-arity)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "strip-arglist-meta" (letrec ((strip-arglist-meta (lambda (form) (let fnrec7143 ((form form)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-list?") form)) (let* ((es (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "jolt.host" "form-elements") form)))) (if (jolt-truthy? (let* ((and__25__auto (jolt= 3 (jolt-count es)))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-invoke (var-deref "jolt.host" "form-sym?") (jolt-first es)))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= "with-meta" (jolt-invoke (var-deref "jolt.host" "form-sym-name") (jolt-first es))))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.host" "form-vec?") (jolt-nth es 1)) and__25__auto)) and__25__auto)) and__25__auto))) (jolt-nth es 1) form)) form))))) strip-arglist-meta)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-fn" (letrec ((analyze-fn (lambda (ctx items env) (let fnrec7144 ((ctx ctx) (items items) (env env)) (let* ((named (jolt-invoke (var-deref "jolt.host" "form-sym?") (jolt-nth items 1))) (fn-name (if (jolt-truthy? named) (jolt-invoke (var-deref "jolt.host" "form-sym-name") (jolt-nth items 1)) jolt-nil)) (rest-items (if (jolt-truthy? named) (jolt-drop 2 items) (jolt-drop 1 items))) (first* (jolt-invoke (var-deref "jolt.analyzer" "strip-arglist-meta") (jolt-first rest-items)))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-vec?") first*)) (jolt-invoke (var-deref "jolt.ir" "fn-node") fn-name (jolt-vector (jolt-invoke (var-deref "jolt.analyzer" "analyze-arity") ctx first* (jolt-rest rest-items) env fn-name))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-list?") first*)) (jolt-invoke (var-deref "jolt.ir" "fn-node") fn-name (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (clause) (let fnrec7145 ((clause clause)) (let* ((cl (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "jolt.host" "form-elements") clause)))) (let* ((_a$7146 (var-deref "jolt.analyzer" "analyze-arity")) (_a$7147 ctx) (_a$7148 (jolt-invoke (var-deref "jolt.analyzer" "strip-arglist-meta") (jolt-first cl))) (_a$7149 (jolt-rest cl)) (_a$7150 env) (_a$7151 fn-name)) (jolt-invoke _a$7146 _a$7147 _a$7148 _a$7149 _a$7150 _a$7151))))) rest-items)) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") "fn: bad params") jolt-nil)))))))) analyze-fn)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-try" (letrec ((analyze-try (lambda (ctx items env) (let fnrec7152 ((ctx ctx) (items items) (env env)) (let* ((clauses (jolt-rest items)) (body (jolt-invoke (var-deref "clojure.core" "atom") (jolt-vector))) (catch-sym (jolt-invoke (var-deref "clojure.core" "atom") jolt-nil)) (catch-body (jolt-invoke (var-deref "clojure.core" "atom") jolt-nil)) (finally-body (jolt-invoke (var-deref "clojure.core" "atom") jolt-nil))) (begin (begin (jolt-count (jolt-map (lambda (c) (let fnrec7153 ((c c)) (begin (let* ((head (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-list?") c)) (jolt-first (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "jolt.host" "form-elements") c))) jolt-nil)) (hname (if (jolt-truthy? (let* ((and__25__auto head)) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.host" "form-sym?") head) and__25__auto))) (jolt-invoke (var-deref "jolt.host" "form-sym-name") head) jolt-nil))) (if (jolt= hname "catch") (let* ((cl (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "jolt.host" "form-elements") c)))) (begin (if (jolt-truthy? (let* ((or__26__auto (< (jolt-count cl) 3))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-not (jolt-invoke (var-deref "jolt.host" "form-sym?") (jolt-nth cl 2)))))) (jolt-throw "Unable to parse catch clause; expected (catch class binding body*)") jolt-nil) (jolt-invoke (var-deref "clojure.core" "reset!") catch-sym (jolt-invoke (var-deref "jolt.host" "form-sym-name") (jolt-nth cl 2))) (jolt-invoke (var-deref "clojure.core" "reset!") catch-body (jolt-drop 3 cl)))) (if (jolt= hname "finally") (jolt-invoke (var-deref "clojure.core" "reset!") finally-body (jolt-rest (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "jolt.host" "form-elements") c)))) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "clojure.core" "swap!") body jolt-conj c) jolt-nil)))) jolt-nil))) clauses)) jolt-nil) (let* ((n (let* ((_o$7154 (keyword #f "op")) (_o$7155 (keyword #f "try")) (_o$7156 (keyword #f "body")) (_o$7157 (jolt-invoke (var-deref "jolt.analyzer" "analyze-seq") ctx (jolt-invoke (var-deref "clojure.core" "deref") body) env))) (jolt-hash-map _o$7154 _o$7155 _o$7156 _o$7157))) (n (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "deref") catch-body)) (let* ((_a$7162 n) (_a$7163 (keyword #f "catch-sym")) (_a$7164 (jolt-invoke (var-deref "clojure.core" "deref") catch-sym)) (_a$7165 (keyword #f "catch-body")) (_a$7166 (let* ((_a$7158 (var-deref "jolt.analyzer" "analyze-seq")) (_a$7159 ctx) (_a$7160 (jolt-invoke (var-deref "clojure.core" "deref") catch-body)) (_a$7161 (jolt-invoke (var-deref "jolt.analyzer" "add-locals") env (jolt-vector (jolt-invoke (var-deref "clojure.core" "deref") catch-sym))))) (jolt-invoke _a$7158 _a$7159 _a$7160 _a$7161)))) (jolt-assoc _a$7162 _a$7163 _a$7164 _a$7165 _a$7166)) n)) (n (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "deref") finally-body)) (jolt-assoc n (keyword #f "finally") (jolt-invoke (var-deref "jolt.analyzer" "analyze-seq") ctx (jolt-invoke (var-deref "clojure.core" "deref") finally-body) env)) n))) n))))))) analyze-try)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-letfn" (letrec ((analyze-letfn (lambda (ctx items env) (let fnrec7167 ((ctx ctx) (items items) (env env)) (let* ((specs (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "jolt.host" "form-vec-items") (jolt-nth items 1)))) (names (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (p__87_) (let fnrec7168 ((p__87_ p__87_)) (jolt-invoke (var-deref "jolt.host" "form-sym-name") (jolt-first (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "jolt.host" "form-elements") p__87_)))))) specs)) (env* (jolt-invoke (var-deref "jolt.analyzer" "add-locals") env names)) (binds (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (spec) (let fnrec7169 ((spec spec)) (let* ((cl (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "jolt.host" "form-elements") spec)))) (let* ((_o$7170 (jolt-invoke (var-deref "jolt.host" "form-sym-name") (jolt-first cl))) (_o$7171 (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx (jolt-cons (jolt-invoke (var-deref "clojure.core" "symbol") "fn") cl) env*))) (jolt-vector _o$7170 _o$7171))))) specs))) (let* ((_o$7172 (keyword #f "op")) (_o$7173 (keyword #f "let")) (_o$7174 (keyword #f "letrec")) (_o$7175 #t) (_o$7176 (keyword #f "bindings")) (_o$7177 binds) (_o$7178 (keyword #f "body")) (_o$7179 (jolt-invoke (var-deref "jolt.analyzer" "analyze-seq") ctx (jolt-drop 2 items) env*))) (jolt-hash-map _o$7172 _o$7173 _o$7174 _o$7175 _o$7176 _o$7177 _o$7178 _o$7179))))))) analyze-letfn)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "field-head?" (letrec ((field-head? (lambda (nm) (let fnrec7180 ((nm nm)) (let* ((and__25__auto (> (jolt-count nm) 2))) (if (jolt-truthy? and__25__auto) (jolt= ".-" (jolt-invoke (var-deref "clojure.core" "subs") nm 0 2)) and__25__auto)))))) field-head?)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-def" (letrec ((analyze-def (lambda (ctx items env) (let fnrec7181 ((ctx ctx) (items items) (env env)) (let* ((name-sym (jolt-nth items 1))) (begin (if (jolt-not (jolt-invoke (var-deref "jolt.host" "form-sym?") name-sym)) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") "def name with map metadata") jolt-nil) (if (< (jolt-count items) 3) (let* ((nm (jolt-invoke (var-deref "jolt.host" "form-sym-name") name-sym)) (cur (jolt-invoke (var-deref "jolt.host" "compile-ns") ctx))) (begin (jolt-invoke (var-deref "jolt.host" "host-intern!") ctx cur nm) (let* ((_o$7182 (keyword #f "op")) (_o$7183 (keyword #f "def")) (_o$7184 (keyword #f "ns")) (_o$7185 cur) (_o$7186 (keyword #f "name")) (_o$7187 nm) (_o$7188 (keyword #f "no-init")) (_o$7189 #t)) (jolt-hash-map _o$7182 _o$7183 _o$7184 _o$7185 _o$7186 _o$7187 _o$7188 _o$7189)))) (let* ((nm (jolt-invoke (var-deref "jolt.host" "form-sym-name") name-sym)) (cur (jolt-invoke (var-deref "jolt.host" "compile-ns") ctx)) (has-doc (let* ((and__25__auto (> (jolt-count items) 3))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "string?") (jolt-nth items 2)) and__25__auto))) (val-form (jolt-nth items (if (jolt-truthy? has-doc) 3 2))) (base0 (let* ((or__26__auto (jolt-invoke (var-deref "jolt.host" "form-sym-meta") name-sym))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-hash-map)))) (tag (jolt-get base0 (keyword #f "tag"))) (tag-name (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-sym?") tag)) (jolt-invoke (var-deref "jolt.host" "form-sym-name") tag) (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "string?") tag)) tag (if (jolt-truthy? (keyword #f "else")) jolt-nil jolt-nil)))) (base-meta (if (jolt-truthy? tag-name) (let* ((c (jolt-invoke (var-deref "jolt.host" "resolve-class-hint") tag-name))) (if (jolt-truthy? c) (jolt-assoc base0 (keyword #f "tag") c) base0)) base0)) (node-meta (if (jolt-truthy? has-doc) (jolt-assoc base-meta (keyword #f "doc") (jolt-nth items 2)) base-meta))) (begin (jolt-invoke (var-deref "jolt.host" "host-intern!") ctx cur nm) (jolt-invoke (var-deref "jolt.ir" "def-node") cur nm (let* ((_a$7190 (var-deref "jolt.analyzer" "with-ret-nhint")) (_a$7191 (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx val-form env)) (_a$7192 (jolt-invoke (var-deref "jolt.analyzer" "tag->nkind") tag))) (jolt-invoke _a$7190 _a$7191 _a$7192)) node-meta)))))))))) analyze-def)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-set!" (letrec ((analyze-set! (lambda (ctx items env) (let fnrec7193 ((ctx ctx) (items items) (env env)) (let* ((target (jolt-nth items 1)) (val-node (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx (jolt-nth items 2) env)) (ti (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-list?") target)) (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "jolt.host" "form-elements") target)) jolt-nil)) (thead (if (jolt-truthy? (let* ((and__25__auto ti)) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-pos? (jolt-count ti)))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.host" "form-sym?") (jolt-first ti)) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "jolt.host" "form-sym-name") (jolt-first ti)) jolt-nil))) (if (jolt-truthy? (let* ((and__25__auto thead)) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.analyzer" "field-head?") thead) and__25__auto))) (let* ((_o$7194 (keyword #f "op")) (_o$7195 (keyword #f "set-field")) (_o$7196 (keyword #f "obj")) (_o$7197 (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx (jolt-nth ti 1) env)) (_o$7198 (keyword #f "field")) (_o$7199 (jolt-invoke (var-deref "clojure.core" "subs") thead 2)) (_o$7200 (keyword #f "val")) (_o$7201 val-node)) (jolt-hash-map _o$7194 _o$7195 _o$7196 _o$7197 _o$7198 _o$7199 _o$7200 _o$7201)) (if (jolt-truthy? (let* ((and__25__auto (jolt= thead "."))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (>= (jolt-count ti) 3))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-invoke (var-deref "jolt.host" "form-sym?") (jolt-nth ti 1)))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-invoke (var-deref "jolt.host" "form-sym?") (jolt-nth ti 2)))) (if (jolt-truthy? and__25__auto) (jolt= (keyword #f "class") (jolt-get (jolt-invoke (var-deref "jolt.host" "resolve-global") ctx (jolt-nth ti 1)) (keyword #f "kind"))) and__25__auto)) and__25__auto)) and__25__auto)) and__25__auto))) (let* ((_a$7205 (var-deref "jolt.ir" "invoke")) (_a$7206 (jolt-invoke (var-deref "jolt.ir" "var-ref") "jolt.host" "set-static-field!")) (_a$7207 (let* ((_o$7202 (jolt-invoke (var-deref "jolt.ir" "const") (jolt-get (jolt-invoke (var-deref "jolt.host" "resolve-global") ctx (jolt-nth ti 1)) (keyword #f "name")))) (_o$7203 (jolt-invoke (var-deref "jolt.ir" "const") (jolt-invoke (var-deref "jolt.host" "form-sym-name") (jolt-nth ti 2)))) (_o$7204 val-node)) (jolt-vector _o$7202 _o$7203 _o$7204)))) (jolt-invoke _a$7205 _a$7206 _a$7207)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-sym?") target)) (begin (if (jolt-truthy? (jolt-invoke (var-deref "jolt.analyzer" "local?") env (jolt-invoke (var-deref "jolt.host" "form-sym-name") target))) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") "set! of a local") jolt-nil) (let* ((r (jolt-invoke (var-deref "jolt.host" "resolve-global") ctx target))) (begin (if (jolt-not (jolt= (keyword #f "var") (jolt-get r (keyword #f "kind")))) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") "set! of a non-var") jolt-nil) (let* ((_o$7211 (keyword #f "op")) (_o$7212 (keyword #f "set-var")) (_o$7213 (keyword #f "the-var")) (_o$7214 (let* ((_a$7208 (var-deref "jolt.ir" "the-var")) (_a$7209 (jolt-get r (keyword #f "ns"))) (_a$7210 (jolt-get r (keyword #f "name")))) (jolt-invoke _a$7208 _a$7209 _a$7210))) (_o$7215 (keyword #f "val")) (_o$7216 val-node)) (jolt-hash-map _o$7211 _o$7212 _o$7213 _o$7214 _o$7215 _o$7216))))) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") "set! of an unsupported target") jolt-nil))))))))) analyze-set!)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-special" (letrec ((analyze-special (lambda (ctx op items env) (let fnrec7217 ((ctx ctx) (op op) (items items) (env env)) (let* ((G__133 op)) (if (jolt= G__133 "quote") (jolt-invoke (var-deref "jolt.ir" "quote-node") (jolt-invoke (var-deref "clojure.core" "second") items)) (if (jolt= G__133 "if") (begin (if (jolt-truthy? (let* ((or__26__auto (< (jolt-count items) 3))) (if (jolt-truthy? or__26__auto) or__26__auto (> (jolt-count items) 4)))) (jolt-throw (jolt-invoke (var-deref "clojure.core" "str") "Wrong number of args (" (jolt-dec (jolt-count items)) ") passed to: if")) jolt-nil) (let* ((_a$7218 (var-deref "jolt.ir" "if-node")) (_a$7219 (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx (jolt-nth items 1) env)) (_a$7220 (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx (jolt-nth items 2) env)) (_a$7221 (if (> (jolt-count items) 3) (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx (jolt-nth items 3) env) (jolt-invoke (var-deref "jolt.ir" "const") jolt-nil)))) (jolt-invoke _a$7218 _a$7219 _a$7220 _a$7221))) (if (jolt= G__133 "do") (jolt-invoke (var-deref "jolt.analyzer" "analyze-seq") ctx (jolt-rest items) env) (if (jolt= G__133 "throw") (jolt-invoke (var-deref "jolt.ir" "throw-node") (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx (jolt-nth items 1) env)) (if (jolt= G__133 "def") (jolt-invoke (var-deref "jolt.analyzer" "analyze-def") ctx items env) (if (jolt= G__133 "let*") (let* ((bvec (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "jolt.host" "form-vec-items") (jolt-nth items 1)))) (r (jolt-invoke (var-deref "jolt.analyzer" "analyze-bindings") ctx bvec env))) (let* ((_a$7226 (var-deref "jolt.ir" "let-node")) (_a$7227 (jolt-first r)) (_a$7228 (let* ((_a$7222 (var-deref "jolt.analyzer" "analyze-seq")) (_a$7223 ctx) (_a$7224 (jolt-drop 2 items)) (_a$7225 (jolt-invoke (var-deref "clojure.core" "second") r))) (jolt-invoke _a$7222 _a$7223 _a$7224 _a$7225)))) (jolt-invoke _a$7226 _a$7227 _a$7228))) (if (jolt= G__133 "loop*") (let* ((bvec (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "jolt.host" "form-vec-items") (jolt-nth items 1)))) (rname (jolt-invoke (var-deref "jolt.analyzer" "gen-name") "loop")) (r (jolt-invoke (var-deref "jolt.analyzer" "analyze-bindings") ctx bvec env)) (env** (jolt-invoke (var-deref "jolt.analyzer" "with-recur") (jolt-invoke (var-deref "clojure.core" "second") r) rname))) (let* ((_o$7229 (keyword #f "op")) (_o$7230 (keyword #f "loop")) (_o$7231 (keyword #f "recur-name")) (_o$7232 rname) (_o$7233 (keyword #f "bindings")) (_o$7234 (jolt-first r)) (_o$7235 (keyword #f "body")) (_o$7236 (jolt-invoke (var-deref "jolt.analyzer" "analyze-seq") ctx (jolt-drop 2 items) env**))) (jolt-hash-map _o$7229 _o$7230 _o$7231 _o$7232 _o$7233 _o$7234 _o$7235 _o$7236))) (if (jolt= G__133 "recur") (let* ((rt (jolt-get env (keyword #f "recur")))) (begin (if (jolt-not rt) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") "recur outside loop/fn") jolt-nil) (let* ((_o$7241 (keyword #f "op")) (_o$7242 (keyword #f "recur")) (_o$7243 (keyword #f "recur-name")) (_o$7244 rt) (_o$7245 (keyword #f "args")) (_o$7246 (let* ((_a$7238 (var-deref "clojure.core" "mapv")) (_a$7239 (lambda (p__88_) (let fnrec7237 ((p__88_ p__88_)) (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx p__88_ env)))) (_a$7240 (jolt-rest items))) (jolt-invoke _a$7238 _a$7239 _a$7240)))) (jolt-hash-map _o$7241 _o$7242 _o$7243 _o$7244 _o$7245 _o$7246)))) (if (jolt= G__133 "try") (jolt-invoke (var-deref "jolt.analyzer" "analyze-try") ctx items env) (if (jolt= G__133 "letfn") (jolt-invoke (var-deref "jolt.analyzer" "analyze-letfn") ctx items env) (if (jolt= G__133 "fn*") (jolt-invoke (var-deref "jolt.analyzer" "analyze-fn") ctx items env) (if (jolt= G__133 "syntax-quote") (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx (jolt-invoke (var-deref "jolt.host" "form-syntax-quote-lower") ctx (jolt-invoke (var-deref "clojure.core" "second") items)) env) (if (jolt= G__133 "var") (let* ((sym (jolt-invoke (var-deref "clojure.core" "second") items)) (r (jolt-invoke (var-deref "jolt.host" "resolve-global") ctx sym))) (if (jolt= (keyword #f "var") (jolt-get r (keyword #f "kind"))) (let* ((_a$7247 (var-deref "jolt.ir" "the-var")) (_a$7248 (jolt-get r (keyword #f "ns"))) (_a$7249 (jolt-get r (keyword #f "name")))) (jolt-invoke _a$7247 _a$7248 _a$7249)) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") (jolt-invoke (var-deref "clojure.core" "str") "var of non-var " (jolt-invoke (var-deref "jolt.host" "form-sym-name") sym))))) (if (jolt= G__133 "defmacro") (let* ((name-sym (jolt-nth items 1)) (nm (jolt-invoke (var-deref "jolt.host" "form-sym-name") name-sym)) (cur (jolt-invoke (var-deref "jolt.host" "compile-ns") ctx)) (after (jolt-drop 2 items)) (after (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "string?") (jolt-first after))) (jolt-rest after) after)) (after (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-map?") (jolt-first after))) (jolt-rest after) after)) (fn-form (jolt-cons (jolt-invoke (var-deref "clojure.core" "symbol") "fn") after))) (begin (jolt-invoke (var-deref "jolt.host" "host-intern!") ctx cur nm) (let* ((_o$7250 (keyword #f "op")) (_o$7251 (keyword #f "defmacro")) (_o$7252 (keyword #f "ns")) (_o$7253 cur) (_o$7254 (keyword #f "name")) (_o$7255 nm) (_o$7256 (keyword #f "fn")) (_o$7257 (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx fn-form env))) (jolt-hash-map _o$7250 _o$7251 _o$7252 _o$7253 _o$7254 _o$7255 _o$7256 _o$7257)))) (if (jolt= G__133 "set!") (jolt-invoke (var-deref "jolt.analyzer" "analyze-set!") ctx items env) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") (jolt-invoke (var-deref "clojure.core" "str") "special form " op)))))))))))))))))))))) analyze-special)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "method-head?" (letrec ((method-head? (lambda (nm) (let fnrec7258 ((nm nm)) (let* ((and__25__auto (> (jolt-count nm) 1))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= "." (jolt-invoke (var-deref "clojure.core" "subs") nm 0 1)))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-not (jolt= "-" (jolt-invoke (var-deref "clojure.core" "subs") nm 1 2))))) (if (jolt-truthy? and__25__auto) (jolt-not (jolt= "." (jolt-invoke (var-deref "clojure.core" "subs") nm 1 2))) and__25__auto)) and__25__auto)) and__25__auto)))))) method-head?)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-host-call" (letrec ((analyze-host-call (lambda (ctx hname items env) (let fnrec7259 ((ctx ctx) (hname hname) (items items) (env env)) (begin (if (< (jolt-count items) 2) (jolt-throw (jolt-invoke (var-deref "clojure.core" "str") "Malformed member expression, expecting (.method target ...): " hname)) jolt-nil) (let* ((_o$7264 (keyword #f "op")) (_o$7265 (keyword #f "host-call")) (_o$7266 (keyword #f "method")) (_o$7267 (jolt-invoke (var-deref "clojure.core" "subs") hname 1)) (_o$7268 (keyword #f "target")) (_o$7269 (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx (jolt-nth items 1) env)) (_o$7270 (keyword #f "args")) (_o$7271 (let* ((_a$7261 (var-deref "clojure.core" "mapv")) (_a$7262 (lambda (p__89_) (let fnrec7260 ((p__89_ p__89_)) (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx p__89_ env)))) (_a$7263 (jolt-drop 2 items))) (jolt-invoke _a$7261 _a$7262 _a$7263)))) (jolt-hash-map _o$7264 _o$7265 _o$7266 _o$7267 _o$7268 _o$7269 _o$7270 _o$7271))))))) analyze-host-call)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "ctor-head?" (letrec ((ctor-head? (lambda (nm) (let fnrec7272 ((nm nm)) (let* ((and__25__auto (> (jolt-count nm) 1))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= "." (let* ((_a$7273 (var-deref "clojure.core" "subs")) (_a$7274 nm) (_a$7275 (jolt-dec (jolt-count nm))) (_a$7276 (jolt-count nm))) (jolt-invoke _a$7273 _a$7274 _a$7275 _a$7276))))) (if (jolt-truthy? and__25__auto) (jolt-not (jolt= "." (jolt-invoke (var-deref "clojure.core" "subs") nm 0 1))) and__25__auto)) and__25__auto)))))) ctor-head?)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-ctor" (letrec ((analyze-ctor (lambda (ctx class args env) (let fnrec7277 ((ctx ctx) (class class) (args args) (env env)) (jolt-invoke (var-deref "jolt.ir" "host-new") class (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (p__90_) (let fnrec7278 ((p__90_ p__90_)) (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx p__90_ env))) args)))))) analyze-ctor)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-ffi-fn" (letrec ((analyze-ffi-fn (lambda (ctx items env) (let fnrec7279 ((ctx ctx) (items items) (env env)) (begin (if (jolt-not (<= 4 (jolt-count items) 5)) (jolt-throw (jolt-invoke (var-deref "clojure.core" "str") "jolt.ffi/foreign-fn expects (foreign-fn \"sym\" [argtypes] rettype [:blocking])")) jolt-nil) (let* ((_o$7280 (keyword #f "op")) (_o$7281 (keyword #f "ffi-fn")) (_o$7282 (keyword #f "csym")) (_o$7283 (jolt-nth items 1)) (_o$7284 (keyword #f "argtypes")) (_o$7285 (jolt-invoke (var-deref "clojure.core" "mapv") (var-deref "clojure.core" "name") (jolt-invoke (var-deref "jolt.host" "form-vec-items") (jolt-nth items 2)))) (_o$7286 (keyword #f "rettype")) (_o$7287 (jolt-invoke (var-deref "clojure.core" "name") (jolt-nth items 3))) (_o$7288 (keyword #f "blocking")) (_o$7289 (let* ((and__25__auto (jolt= 5 (jolt-count items)))) (if (jolt-truthy? and__25__auto) (jolt= "blocking" (jolt-invoke (var-deref "clojure.core" "name") (jolt-nth items 4))) and__25__auto)))) (jolt-hash-map _o$7280 _o$7281 _o$7282 _o$7283 _o$7284 _o$7285 _o$7286 _o$7287 _o$7288 _o$7289))))))) analyze-ffi-fn)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-ffi-callable" (letrec ((analyze-ffi-callable (lambda (ctx items env) (let fnrec7290 ((ctx ctx) (items items) (env env)) (begin (if (jolt-not (<= 4 (jolt-count items) 5)) (jolt-throw (jolt-invoke (var-deref "clojure.core" "str") "jolt.ffi/foreign-callable expects (foreign-callable f [argtypes] rettype [:collect-safe])")) jolt-nil) (let* ((_o$7291 (keyword #f "op")) (_o$7292 (keyword #f "ffi-callable")) (_o$7293 (keyword #f "fn")) (_o$7294 (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx (jolt-nth items 1) env)) (_o$7295 (keyword #f "argtypes")) (_o$7296 (jolt-invoke (var-deref "clojure.core" "mapv") (var-deref "clojure.core" "name") (jolt-invoke (var-deref "jolt.host" "form-vec-items") (jolt-nth items 2)))) (_o$7297 (keyword #f "rettype")) (_o$7298 (jolt-invoke (var-deref "clojure.core" "name") (jolt-nth items 3))) (_o$7299 (keyword #f "collect-safe")) (_o$7300 (let* ((and__25__auto (jolt= 5 (jolt-count items)))) (if (jolt-truthy? and__25__auto) (jolt= "collect-safe" (jolt-invoke (var-deref "clojure.core" "name") (jolt-nth items 4))) and__25__auto)))) (jolt-hash-map _o$7291 _o$7292 _o$7293 _o$7294 _o$7295 _o$7296 _o$7297 _o$7298 _o$7299 _o$7300))))))) analyze-ffi-callable)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-dot" (letrec ((analyze-dot (lambda (ctx items env) (let fnrec7301 ((ctx ctx) (items items) (env env)) (begin (if (< (jolt-count items) 3) (jolt-throw (jolt-invoke (var-deref "clojure.core" "str") "Malformed (. target member ...) form")) jolt-nil) (let* ((target (jolt-nth items 1)) (member (jolt-nth items 2)) (class-target (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.host" "form-sym?") target))) (if (jolt-truthy? and__25__auto) (jolt-not (jolt-invoke (var-deref "jolt.analyzer" "local?") env (jolt-invoke (var-deref "jolt.host" "form-sym-name") target))) and__25__auto))) (let* ((r (jolt-invoke (var-deref "jolt.host" "resolve-global") ctx target))) (if (jolt= (keyword #f "class") (jolt-get r (keyword #f "kind"))) (jolt-get r (keyword #f "name")) jolt-nil)) jolt-nil))) (if (jolt-truthy? (let* ((and__25__auto class-target)) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.host" "form-sym?") member) and__25__auto))) (let* ((_a$7306 (var-deref "jolt.ir" "invoke")) (_a$7307 (jolt-invoke (var-deref "jolt.ir" "host-static") class-target (jolt-invoke (var-deref "jolt.host" "form-sym-name") member))) (_a$7308 (let* ((_a$7303 (var-deref "clojure.core" "mapv")) (_a$7304 (lambda (p__91_) (let fnrec7302 ((p__91_ p__91_)) (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx p__91_ env)))) (_a$7305 (jolt-drop 3 items))) (jolt-invoke _a$7303 _a$7304 _a$7305)))) (jolt-invoke _a$7306 _a$7307 _a$7308)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-sym?") member)) (let* ((_o$7313 (keyword #f "op")) (_o$7314 (keyword #f "host-call")) (_o$7315 (keyword #f "method")) (_o$7316 (jolt-invoke (var-deref "jolt.host" "form-sym-name") member)) (_o$7317 (keyword #f "target")) (_o$7318 (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx target env)) (_o$7319 (keyword #f "args")) (_o$7320 (let* ((_a$7310 (var-deref "clojure.core" "mapv")) (_a$7311 (lambda (p__92_) (let fnrec7309 ((p__92_ p__92_)) (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx p__92_ env)))) (_a$7312 (jolt-drop 3 items))) (jolt-invoke _a$7310 _a$7311 _a$7312)))) (jolt-hash-map _o$7313 _o$7314 _o$7315 _o$7316 _o$7317 _o$7318 _o$7319 _o$7320)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-keyword?") member)) (let* ((_a$7321 (var-deref "jolt.ir" "invoke")) (_a$7322 (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx member env)) (_a$7323 (jolt-vector (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx (jolt-nth items 1) env)))) (jolt-invoke _a$7321 _a$7322 _a$7323)) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") "special form . (non-symbol member)") jolt-nil)))))))))) analyze-dot)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-field" (letrec ((analyze-field (lambda (ctx hname items env) (let fnrec7324 ((ctx ctx) (hname hname) (items items) (env env)) (begin (if (< (jolt-count items) 2) (jolt-throw (jolt-invoke (var-deref "clojure.core" "str") "Malformed (.-field target) form")) jolt-nil) (let* ((_o$7325 (keyword #f "op")) (_o$7326 (keyword #f "host-call")) (_o$7327 (keyword #f "method")) (_o$7328 (jolt-invoke (var-deref "clojure.core" "subs") hname 1)) (_o$7329 (keyword #f "target")) (_o$7330 (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx (jolt-nth items 1) env)) (_o$7331 (keyword #f "args")) (_o$7332 (jolt-vector))) (jolt-hash-map _o$7325 _o$7326 _o$7327 _o$7328 _o$7329 _o$7330 _o$7331 _o$7332))))))) analyze-field)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-symbol" (letrec ((analyze-symbol (lambda (ctx form env) (let fnrec7333 ((ctx ctx) (form form) (env env)) (let* ((nm (jolt-invoke (var-deref "jolt.host" "form-sym-name") form)) (ns (jolt-invoke (var-deref "jolt.host" "form-sym-ns") form))) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "clojure.core" "nil?") ns))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.analyzer" "local?") env nm) and__25__auto))) (let* ((h (jolt-get (jolt-get env (keyword #f "hints")) nm))) (if (jolt-truthy? h) (jolt-assoc (jolt-invoke (var-deref "jolt.ir" "local") nm) (keyword #f "hint") h) (jolt-invoke (var-deref "jolt.ir" "local") nm))) (if (jolt-truthy? ns) (let* ((r (jolt-invoke (var-deref "jolt.host" "resolve-global") ctx form))) (if (jolt= (keyword #f "var") (jolt-get r (keyword #f "kind"))) (let* ((G__134 (let* ((_a$7334 (var-deref "jolt.ir" "var-ref")) (_a$7335 (jolt-get r (keyword #f "ns"))) (_a$7336 (jolt-get r (keyword #f "name")))) (jolt-invoke _a$7334 _a$7335 _a$7336)))) (let* ((G__135 (if (jolt-truthy? (jolt-get r (keyword #f "num-ret"))) (jolt-assoc G__134 (keyword #f "num-ret") (jolt-get r (keyword #f "num-ret"))) G__134))) G__135)) (jolt-invoke (var-deref "jolt.ir" "host-static") ns nm))) (if (jolt-truthy? (keyword #f "else")) (let* ((r (jolt-invoke (var-deref "jolt.host" "resolve-global") ctx form))) (let* ((G__136 (jolt-get r (keyword #f "kind")))) (if (jolt= G__136 (keyword #f "var")) (let* ((G__137 (let* ((_a$7337 (var-deref "jolt.ir" "var-ref")) (_a$7338 (jolt-get r (keyword #f "ns"))) (_a$7339 (jolt-get r (keyword #f "name")))) (jolt-invoke _a$7337 _a$7338 _a$7339)))) (let* ((G__138 (if (jolt-truthy? (jolt-get r (keyword #f "num-ret"))) (jolt-assoc G__137 (keyword #f "num-ret") (jolt-get r (keyword #f "num-ret"))) G__137))) G__138)) (if (jolt= G__136 (keyword #f "host")) (jolt-invoke (var-deref "jolt.ir" "host-ref") (jolt-get r (keyword #f "name"))) (if (jolt= G__136 (keyword #f "class")) (jolt-invoke (var-deref "jolt.ir" "const") (jolt-get r (keyword #f "name"))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "late-bind?") ctx)) (jolt-invoke (var-deref "jolt.ir" "var-ref") (jolt-invoke (var-deref "jolt.host" "compile-ns") ctx) nm) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") (jolt-invoke (var-deref "clojure.core" "str") "Unable to resolve symbol: " nm " in this context")))))))) jolt-nil)))))))) analyze-symbol)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze-list" (letrec ((analyze-list (lambda (ctx form env) (let fnrec7340 ((ctx ctx) (form form) (env env)) (let* ((items (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "jolt.host" "form-elements") form)))) (if (jolt-zero? (jolt-count items)) (jolt-invoke (var-deref "jolt.ir" "quote-node") form) (let* ((head (jolt-first items)) (hname (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.host" "form-sym?") head))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "nil?") (jolt-invoke (var-deref "jolt.host" "form-sym-ns") head)) and__25__auto))) (jolt-invoke (var-deref "jolt.host" "form-sym-name") head) jolt-nil)) (shadowed (let* ((and__25__auto hname)) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.analyzer" "local?") env hname) and__25__auto)))) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.host" "form-sym?") head))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-not shadowed))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-not (jolt-contains? (var-deref "jolt.analyzer" "handled") hname)))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.host" "form-macro?") ctx head) and__25__auto)) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx (jolt-invoke (var-deref "jolt.host" "form-expand-1") ctx form) env) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.host" "form-sym?") head))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= "jolt.ffi" (jolt-invoke (var-deref "jolt.host" "form-sym-ns") head)))) (if (jolt-truthy? and__25__auto) (jolt= "__cfn" (jolt-invoke (var-deref "jolt.host" "form-sym-name") head)) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "jolt.analyzer" "analyze-ffi-fn") ctx items env) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.host" "form-sym?") head))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= "jolt.ffi" (jolt-invoke (var-deref "jolt.host" "form-sym-ns") head)))) (if (jolt-truthy? and__25__auto) (jolt= "__ccallable" (jolt-invoke (var-deref "jolt.host" "form-sym-name") head)) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "jolt.analyzer" "analyze-ffi-callable") ctx items env) (if (jolt-truthy? (let* ((and__25__auto hname)) (if (jolt-truthy? and__25__auto) (jolt-contains? (var-deref "jolt.analyzer" "handled") hname) and__25__auto))) (jolt-invoke (var-deref "jolt.analyzer" "analyze-special") ctx hname items env) (if (jolt-truthy? (let* ((and__25__auto hname)) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-not shadowed))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.analyzer" "method-head?") hname) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "jolt.analyzer" "analyze-host-call") ctx hname items env) (if (jolt-truthy? (let* ((and__25__auto hname)) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-not shadowed))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.analyzer" "ctor-head?") hname) and__25__auto)) and__25__auto))) (let* ((_a$7341 (var-deref "jolt.analyzer" "analyze-ctor")) (_a$7342 ctx) (_a$7343 (jolt-invoke (var-deref "clojure.core" "subs") hname 0 (jolt-dec (jolt-count hname)))) (_a$7344 (jolt-rest items)) (_a$7345 env)) (jolt-invoke _a$7341 _a$7342 _a$7343 _a$7344 _a$7345)) (if (jolt-truthy? (let* ((and__25__auto (jolt= hname "new"))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-not shadowed))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (>= (jolt-count items) 2))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.host" "form-sym?") (jolt-nth items 1)) and__25__auto)) and__25__auto)) and__25__auto))) (let* ((_a$7346 (var-deref "jolt.analyzer" "analyze-ctor")) (_a$7347 ctx) (_a$7348 (jolt-invoke (var-deref "jolt.host" "form-sym-name") (jolt-nth items 1))) (_a$7349 (jolt-drop 2 items)) (_a$7350 env)) (jolt-invoke _a$7346 _a$7347 _a$7348 _a$7349 _a$7350)) (if (jolt-truthy? (let* ((and__25__auto (jolt= hname "."))) (if (jolt-truthy? and__25__auto) (jolt-not shadowed) and__25__auto))) (jolt-invoke (var-deref "jolt.analyzer" "analyze-dot") ctx items env) (if (jolt-truthy? (let* ((and__25__auto hname)) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-not shadowed))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.analyzer" "field-head?") hname) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "jolt.analyzer" "analyze-field") ctx hname items env) (if (jolt-truthy? (let* ((and__25__auto hname)) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-not shadowed))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.host" "form-special?") hname) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") (jolt-invoke (var-deref "clojure.core" "str") "special form " hname)) (if (jolt-truthy? (keyword #f "else")) (let* ((n (let* ((_a$7355 (var-deref "jolt.ir" "invoke")) (_a$7356 (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx head env)) (_a$7357 (let* ((_a$7352 (var-deref "clojure.core" "mapv")) (_a$7353 (lambda (p__93_) (let fnrec7351 ((p__93_ p__93_)) (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx p__93_ env)))) (_a$7354 (jolt-rest items))) (jolt-invoke _a$7352 _a$7353 _a$7354)))) (jolt-invoke _a$7355 _a$7356 _a$7357))) (p (jolt-invoke (var-deref "jolt.host" "form-position") form))) (if (jolt-truthy? p) (jolt-assoc n (keyword #f "pos") p) n)) jolt-nil)))))))))))))))))) analyze-list)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "with-coll-meta" (letrec ((with-coll-meta (lambda (ctx form env node) (let fnrec7358 ((ctx ctx) (form form) (env env) (node node)) (let* ((m (jolt-invoke (var-deref "jolt.host" "form-coll-meta") form))) (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "nil?") m)) node (let* ((_a$7361 (var-deref "jolt.ir" "invoke")) (_a$7362 (jolt-invoke (var-deref "jolt.ir" "var-ref") "clojure.core" "with-meta")) (_a$7363 (let* ((_o$7359 node) (_o$7360 (jolt-invoke (var-deref "jolt.analyzer" "analyze") ctx m env))) (jolt-vector _o$7359 _o$7360)))) (jolt-invoke _a$7361 _a$7362 _a$7363)))))))) with-coll-meta)))
(guard (e (#t #f))
  (def-var! "jolt.analyzer" "analyze" (letrec ((analyze (case-lambda ((ctx form) (let fnrec7364 ((ctx ctx) (form form)) (jolt-invoke analyze ctx form (jolt-invoke (var-deref "jolt.analyzer" "empty-env"))))) ((ctx form env) (let fnrec7365 ((ctx ctx) (form form) (env env)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-literal?") form)) (jolt-invoke (var-deref "jolt.ir" "const") form) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-sym?") form)) (jolt-invoke (var-deref "jolt.analyzer" "analyze-symbol") ctx form env) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-vec?") form)) (jolt-invoke (var-deref "jolt.analyzer" "with-coll-meta") ctx form env (jolt-invoke (var-deref "jolt.ir" "vector-node") (let* ((_a$7367 (var-deref "clojure.core" "mapv")) (_a$7368 (lambda (p__94_) (let fnrec7366 ((p__94_ p__94_)) (jolt-invoke analyze ctx p__94_ env)))) (_a$7369 (jolt-invoke (var-deref "jolt.host" "form-vec-items") form))) (jolt-invoke _a$7367 _a$7368 _a$7369)))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-map?") form)) (jolt-invoke (var-deref "jolt.analyzer" "with-coll-meta") ctx form env (jolt-invoke (var-deref "jolt.ir" "map-node") (let* ((_a$7373 (var-deref "clojure.core" "mapv")) (_a$7374 (lambda (p) (let fnrec7370 ((p p)) (let* ((_o$7371 (jolt-invoke analyze ctx (jolt-first p) env)) (_o$7372 (jolt-invoke analyze ctx (jolt-invoke (var-deref "clojure.core" "second") p) env))) (jolt-vector _o$7371 _o$7372))))) (_a$7375 (jolt-invoke (var-deref "jolt.host" "form-map-pairs") form))) (jolt-invoke _a$7373 _a$7374 _a$7375)))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-set?") form)) (jolt-invoke (var-deref "jolt.analyzer" "with-coll-meta") ctx form env (jolt-invoke (var-deref "jolt.ir" "set-node") (let* ((_a$7377 (var-deref "clojure.core" "mapv")) (_a$7378 (lambda (p__95_) (let fnrec7376 ((p__95_ p__95_)) (jolt-invoke analyze ctx p__95_ env)))) (_a$7379 (jolt-invoke (var-deref "jolt.host" "form-set-items") form))) (jolt-invoke _a$7377 _a$7378 _a$7379)))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-list?") form)) (jolt-invoke (var-deref "jolt.analyzer" "analyze-list") ctx form env) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-regex?") form)) (let* ((_o$7380 (keyword #f "op")) (_o$7381 (keyword #f "regex")) (_o$7382 (keyword #f "source")) (_o$7383 (jolt-invoke (var-deref "jolt.host" "form-regex-source") form))) (jolt-hash-map _o$7380 _o$7381 _o$7382 _o$7383)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-inst?") form)) (let* ((_o$7384 (keyword #f "op")) (_o$7385 (keyword #f "inst")) (_o$7386 (keyword #f "source")) (_o$7387 (jolt-invoke (var-deref "jolt.host" "form-inst-source") form))) (jolt-hash-map _o$7384 _o$7385 _o$7386 _o$7387)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-uuid?") form)) (let* ((_o$7388 (keyword #f "op")) (_o$7389 (keyword #f "uuid")) (_o$7390 (keyword #f "source")) (_o$7391 (jolt-invoke (var-deref "jolt.host" "form-uuid-source") form))) (jolt-hash-map _o$7388 _o$7389 _o$7390 _o$7391)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-bigdec?") form)) (let* ((_o$7392 (keyword #f "op")) (_o$7393 (keyword #f "bigdec")) (_o$7394 (keyword #f "source")) (_o$7395 (jolt-invoke (var-deref "jolt.host" "form-bigdec-source") form))) (jolt-hash-map _o$7392 _o$7393 _o$7394 _o$7395)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-ns-value?") form)) (let* ((_o$7396 (keyword #f "op")) (_o$7397 (keyword #f "the-ns")) (_o$7398 (keyword #f "name")) (_o$7399 (jolt-invoke (var-deref "jolt.host" "form-ns-value-name") form))) (jolt-hash-map _o$7396 _o$7397 _o$7398 _o$7399)) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "jolt.analyzer" "uncompilable") "unsupported form") jolt-nil))))))))))))))))) analyze)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.backend-scheme" "native-ops" (let* ((_o$5959 "+") (_o$5960 "+") (_o$5961 "-") (_o$5962 "-") (_o$5963 "*") (_o$5964 "*") (_o$5965 "/") (_o$5966 "/") (_o$5967 "<") (_o$5968 "<") (_o$5969 ">") (_o$5970 ">") (_o$5971 "<=") (_o$5972 "<=") (_o$5973 ">=") (_o$5974 ">=") (_o$5975 "=") (_o$5976 "jolt=") (_o$5977 "inc") (_o$5978 "jolt-inc") (_o$5979 "dec") (_o$5980 "jolt-dec") (_o$5981 "not") (_o$5982 "jolt-not") (_o$5983 "min") (_o$5984 "min") (_o$5985 "max") (_o$5986 "max") (_o$5987 "mod") (_o$5988 "modulo") (_o$5989 "rem") (_o$5990 "remainder") (_o$5991 "quot") (_o$5992 "quotient") (_o$5993 "vector") (_o$5994 "jolt-vector") (_o$5995 "hash-map") (_o$5996 "jolt-hash-map") (_o$5997 "hash-set") (_o$5998 "jolt-hash-set") (_o$5999 "conj") (_o$6000 "jolt-conj") (_o$6001 "get") (_o$6002 "jolt-get") (_o$6003 "nth") (_o$6004 "jolt-nth") (_o$6005 "count") (_o$6006 "jolt-count") (_o$6007 "assoc") (_o$6008 "jolt-assoc") (_o$6009 "dissoc") (_o$6010 "jolt-dissoc") (_o$6011 "contains?") (_o$6012 "jolt-contains?") (_o$6013 "empty?") (_o$6014 "jolt-empty?") (_o$6015 "peek") (_o$6016 "jolt-peek") (_o$6017 "pop") (_o$6018 "jolt-pop") (_o$6019 "first") (_o$6020 "jolt-first") (_o$6021 "rest") (_o$6022 "jolt-rest") (_o$6023 "next") (_o$6024 "jolt-next") (_o$6025 "seq") (_o$6026 "jolt-seq") (_o$6027 "cons") (_o$6028 "jolt-cons") (_o$6029 "list") (_o$6030 "jolt-list") (_o$6031 "reverse") (_o$6032 "jolt-reverse") (_o$6033 "last") (_o$6034 "jolt-last") (_o$6035 "map") (_o$6036 "jolt-map") (_o$6037 "filter") (_o$6038 "jolt-filter") (_o$6039 "remove") (_o$6040 "jolt-remove") (_o$6041 "reduce") (_o$6042 "jolt-reduce") (_o$6043 "into") (_o$6044 "jolt-into") (_o$6045 "concat") (_o$6046 "jolt-concat") (_o$6047 "apply") (_o$6048 "jolt-apply") (_o$6049 "range") (_o$6050 "jolt-range") (_o$6051 "take") (_o$6052 "jolt-take") (_o$6053 "drop") (_o$6054 "jolt-drop") (_o$6055 "keys") (_o$6056 "jolt-keys") (_o$6057 "vals") (_o$6058 "jolt-vals") (_o$6059 "even?") (_o$6060 "jolt-even?") (_o$6061 "odd?") (_o$6062 "jolt-odd?") (_o$6063 "pos?") (_o$6064 "jolt-pos?") (_o$6065 "neg?") (_o$6066 "jolt-neg?") (_o$6067 "zero?") (_o$6068 "jolt-zero?") (_o$6069 "identity") (_o$6070 "jolt-identity") (_o$6071 "ex-info") (_o$6072 "jolt-ex-info")) (jolt-hash-map _o$5959 _o$5960 _o$5961 _o$5962 _o$5963 _o$5964 _o$5965 _o$5966 _o$5967 _o$5968 _o$5969 _o$5970 _o$5971 _o$5972 _o$5973 _o$5974 _o$5975 _o$5976 _o$5977 _o$5978 _o$5979 _o$5980 _o$5981 _o$5982 _o$5983 _o$5984 _o$5985 _o$5986 _o$5987 _o$5988 _o$5989 _o$5990 _o$5991 _o$5992 _o$5993 _o$5994 _o$5995 _o$5996 _o$5997 _o$5998 _o$5999 _o$6000 _o$6001 _o$6002 _o$6003 _o$6004 _o$6005 _o$6006 _o$6007 _o$6008 _o$6009 _o$6010 _o$6011 _o$6012 _o$6013 _o$6014 _o$6015 _o$6016 _o$6017 _o$6018 _o$6019 _o$6020 _o$6021 _o$6022 _o$6023 _o$6024 _o$6025 _o$6026 _o$6027 _o$6028 _o$6029 _o$6030 _o$6031 _o$6032 _o$6033 _o$6034 _o$6035 _o$6036 _o$6037 _o$6038 _o$6039 _o$6040 _o$6041 _o$6042 _o$6043 _o$6044 _o$6045 _o$6046 _o$6047 _o$6048 _o$6049 _o$6050 _o$6051 _o$6052 _o$6053 _o$6054 _o$6055 _o$6056 _o$6057 _o$6058 _o$6059 _o$6060 _o$6061 _o$6062 _o$6063 _o$6064 _o$6065 _o$6066 _o$6067 _o$6068 _o$6069 _o$6070 _o$6071 _o$6072)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.backend-scheme" "core-value-procs" (jolt-invoke (var-deref "clojure.core" "merge") (var-deref "jolt.backend-scheme" "native-ops") (let* ((_o$6073 "+") (_o$6074 "jolt-add") (_o$6075 "-") (_o$6076 "jolt-sub") (_o$6077 "*") (_o$6078 "jolt-mul") (_o$6079 "/") (_o$6080 "jolt-div")) (jolt-hash-map _o$6073 _o$6074 _o$6075 _o$6076 _o$6077 _o$6078 _o$6079 _o$6080))) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.backend-scheme" "op-arity" (let* ((_o$6122 "inc") (_o$6123 (lambda (p__42_) (let fnrec6081 ((p__42_ p__42_)) (jolt= p__42_ 1)))) (_o$6124 "dec") (_o$6125 (lambda (p__43_) (let fnrec6082 ((p__43_ p__43_)) (jolt= p__43_ 1)))) (_o$6126 "not") (_o$6127 (lambda (p__44_) (let fnrec6083 ((p__44_ p__44_)) (jolt= p__44_ 1)))) (_o$6128 "count") (_o$6129 (lambda (p__45_) (let fnrec6084 ((p__45_ p__45_)) (jolt= p__45_ 1)))) (_o$6130 "empty?") (_o$6131 (lambda (p__46_) (let fnrec6085 ((p__46_ p__46_)) (jolt= p__46_ 1)))) (_o$6132 "peek") (_o$6133 (lambda (p__47_) (let fnrec6086 ((p__47_ p__47_)) (jolt= p__47_ 1)))) (_o$6134 "pop") (_o$6135 (lambda (p__48_) (let fnrec6087 ((p__48_ p__48_)) (jolt= p__48_ 1)))) (_o$6136 "mod") (_o$6137 (lambda (p__49_) (let fnrec6088 ((p__49_ p__49_)) (jolt= p__49_ 2)))) (_o$6138 "rem") (_o$6139 (lambda (p__50_) (let fnrec6089 ((p__50_ p__50_)) (jolt= p__50_ 2)))) (_o$6140 "quot") (_o$6141 (lambda (p__51_) (let fnrec6090 ((p__51_ p__51_)) (jolt= p__51_ 2)))) (_o$6142 "contains?") (_o$6143 (lambda (p__52_) (let fnrec6091 ((p__52_ p__52_)) (jolt= p__52_ 2)))) (_o$6144 "get") (_o$6145 (lambda (p__53_) (let fnrec6092 ((p__53_ p__53_)) (let* ((or__26__auto (jolt= p__53_ 2))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= p__53_ 3)))))) (_o$6146 "nth") (_o$6147 (lambda (p__54_) (let fnrec6093 ((p__54_ p__54_)) (let* ((or__26__auto (jolt= p__54_ 2))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= p__54_ 3)))))) (_o$6148 "assoc") (_o$6149 (lambda (p__55_) (let fnrec6094 ((p__55_ p__55_)) (let* ((and__25__auto (>= p__55_ 3))) (if (jolt-truthy? and__25__auto) (jolt-odd? p__55_) and__25__auto))))) (_o$6150 "dissoc") (_o$6151 (lambda (p__56_) (let fnrec6095 ((p__56_ p__56_)) (>= p__56_ 1)))) (_o$6152 "conj") (_o$6153 (lambda (p__57_) (let fnrec6096 ((p__57_ p__57_)) (>= p__57_ 1)))) (_o$6154 "first") (_o$6155 (lambda (p__58_) (let fnrec6097 ((p__58_ p__58_)) (jolt= p__58_ 1)))) (_o$6156 "rest") (_o$6157 (lambda (p__59_) (let fnrec6098 ((p__59_ p__59_)) (jolt= p__59_ 1)))) (_o$6158 "next") (_o$6159 (lambda (p__60_) (let fnrec6099 ((p__60_ p__60_)) (jolt= p__60_ 1)))) (_o$6160 "seq") (_o$6161 (lambda (p__61_) (let fnrec6100 ((p__61_ p__61_)) (jolt= p__61_ 1)))) (_o$6162 "reverse") (_o$6163 (lambda (p__62_) (let fnrec6101 ((p__62_ p__62_)) (jolt= p__62_ 1)))) (_o$6164 "last") (_o$6165 (lambda (p__63_) (let fnrec6102 ((p__63_ p__63_)) (jolt= p__63_ 1)))) (_o$6166 "keys") (_o$6167 (lambda (p__64_) (let fnrec6103 ((p__64_ p__64_)) (jolt= p__64_ 1)))) (_o$6168 "vals") (_o$6169 (lambda (p__65_) (let fnrec6104 ((p__65_ p__65_)) (jolt= p__65_ 1)))) (_o$6170 "even?") (_o$6171 (lambda (p__66_) (let fnrec6105 ((p__66_ p__66_)) (jolt= p__66_ 1)))) (_o$6172 "odd?") (_o$6173 (lambda (p__67_) (let fnrec6106 ((p__67_ p__67_)) (jolt= p__67_ 1)))) (_o$6174 "pos?") (_o$6175 (lambda (p__68_) (let fnrec6107 ((p__68_ p__68_)) (jolt= p__68_ 1)))) (_o$6176 "neg?") (_o$6177 (lambda (p__69_) (let fnrec6108 ((p__69_ p__69_)) (jolt= p__69_ 1)))) (_o$6178 "zero?") (_o$6179 (lambda (p__70_) (let fnrec6109 ((p__70_ p__70_)) (jolt= p__70_ 1)))) (_o$6180 "identity") (_o$6181 (lambda (p__71_) (let fnrec6110 ((p__71_ p__71_)) (jolt= p__71_ 1)))) (_o$6182 "cons") (_o$6183 (lambda (p__72_) (let fnrec6111 ((p__72_ p__72_)) (jolt= p__72_ 2)))) (_o$6184 "filter") (_o$6185 (lambda (p__73_) (let fnrec6112 ((p__73_ p__73_)) (jolt= p__73_ 2)))) (_o$6186 "remove") (_o$6187 (lambda (p__74_) (let fnrec6113 ((p__74_ p__74_)) (jolt= p__74_ 2)))) (_o$6188 "into") (_o$6189 (lambda (p__75_) (let fnrec6114 ((p__75_ p__75_)) (jolt= p__75_ 2)))) (_o$6190 "take") (_o$6191 (lambda (p__76_) (let fnrec6115 ((p__76_ p__76_)) (jolt= p__76_ 2)))) (_o$6192 "drop") (_o$6193 (lambda (p__77_) (let fnrec6116 ((p__77_ p__77_)) (jolt= p__77_ 2)))) (_o$6194 "map") (_o$6195 (lambda (p__78_) (let fnrec6117 ((p__78_ p__78_)) (>= p__78_ 2)))) (_o$6196 "apply") (_o$6197 (lambda (p__79_) (let fnrec6118 ((p__79_ p__79_)) (>= p__79_ 2)))) (_o$6198 "reduce") (_o$6199 (lambda (p__80_) (let fnrec6119 ((p__80_ p__80_)) (let* ((or__26__auto (jolt= p__80_ 2))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= p__80_ 3)))))) (_o$6200 "range") (_o$6201 (lambda (p__81_) (let fnrec6120 ((p__81_ p__81_)) (let* ((and__25__auto (>= p__81_ 0))) (if (jolt-truthy? and__25__auto) (<= p__81_ 3) and__25__auto))))) (_o$6202 "ex-info") (_o$6203 (lambda (p__82_) (let fnrec6121 ((p__82_ p__82_)) (let* ((or__26__auto (jolt= p__82_ 2))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= p__82_ 3))))))) (jolt-hash-map _o$6122 _o$6123 _o$6124 _o$6125 _o$6126 _o$6127 _o$6128 _o$6129 _o$6130 _o$6131 _o$6132 _o$6133 _o$6134 _o$6135 _o$6136 _o$6137 _o$6138 _o$6139 _o$6140 _o$6141 _o$6142 _o$6143 _o$6144 _o$6145 _o$6146 _o$6147 _o$6148 _o$6149 _o$6150 _o$6151 _o$6152 _o$6153 _o$6154 _o$6155 _o$6156 _o$6157 _o$6158 _o$6159 _o$6160 _o$6161 _o$6162 _o$6163 _o$6164 _o$6165 _o$6166 _o$6167 _o$6168 _o$6169 _o$6170 _o$6171 _o$6172 _o$6173 _o$6174 _o$6175 _o$6176 _o$6177 _o$6178 _o$6179 _o$6180 _o$6181 _o$6182 _o$6183 _o$6184 _o$6185 _o$6186 _o$6187 _o$6188 _o$6189 _o$6190 _o$6191 _o$6192 _o$6193 _o$6194 _o$6195 _o$6196 _o$6197 _o$6198 _o$6199 _o$6200 _o$6201 _o$6202 _o$6203)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.backend-scheme" "cmp1-ops" (let* ((_o$6204 "<") (_o$6205 ">") (_o$6206 "<=") (_o$6207 ">=")) (jolt-hash-set _o$6204 _o$6205 _o$6206 _o$6207)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.backend-scheme" "supported-host-methods" (let* ((_o$6208 "isDirectory") (_o$6209 "listFiles")) (jolt-hash-set _o$6208 _o$6209)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.backend-scheme" "bool-returning-ops" (let* ((_o$6210 "<") (_o$6211 "<=") (_o$6212 ">") (_o$6213 ">=") (_o$6214 "jolt=") (_o$6215 "jolt-not") (_o$6216 "jolt-even?") (_o$6217 "jolt-odd?") (_o$6218 "jolt-pos?") (_o$6219 "jolt-neg?") (_o$6220 "jolt-zero?") (_o$6221 "jolt-empty?") (_o$6222 "jolt-contains?")) (jolt-hash-set _o$6210 _o$6211 _o$6212 _o$6213 _o$6214 _o$6215 _o$6216 _o$6217 _o$6218 _o$6219 _o$6220 _o$6221 _o$6222)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.backend-scheme" "dbl-ops" (let* ((_o$6223 "+") (_o$6224 "fl+") (_o$6225 "-") (_o$6226 "fl-") (_o$6227 "*") (_o$6228 "fl*") (_o$6229 "/") (_o$6230 "fl/") (_o$6231 "min") (_o$6232 "flmin") (_o$6233 "max") (_o$6234 "flmax") (_o$6235 "<") (_o$6236 "fl<?") (_o$6237 ">") (_o$6238 "fl>?") (_o$6239 "<=") (_o$6240 "fl<=?") (_o$6241 ">=") (_o$6242 "fl>=?") (_o$6243 "=") (_o$6244 "fl=?") (_o$6245 "==") (_o$6246 "fl=?")) (jolt-hash-map _o$6223 _o$6224 _o$6225 _o$6226 _o$6227 _o$6228 _o$6229 _o$6230 _o$6231 _o$6232 _o$6233 _o$6234 _o$6235 _o$6236 _o$6237 _o$6238 _o$6239 _o$6240 _o$6241 _o$6242 _o$6243 _o$6244 _o$6245 _o$6246)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.backend-scheme" "lng-ops" (let* ((_o$6247 "+") (_o$6248 "fx+") (_o$6249 "-") (_o$6250 "fx-") (_o$6251 "*") (_o$6252 "fx*") (_o$6253 "min") (_o$6254 "fxmin") (_o$6255 "max") (_o$6256 "fxmax") (_o$6257 "unchecked-add") (_o$6258 "fx+") (_o$6259 "unchecked-subtract") (_o$6260 "fx-") (_o$6261 "unchecked-multiply") (_o$6262 "fx*") (_o$6263 "quot") (_o$6264 "fxquotient") (_o$6265 "rem") (_o$6266 "fxremainder") (_o$6267 "mod") (_o$6268 "fxmodulo") (_o$6269 "<") (_o$6270 "fx<?") (_o$6271 ">") (_o$6272 "fx>?") (_o$6273 "<=") (_o$6274 "fx<=?") (_o$6275 ">=") (_o$6276 "fx>=?") (_o$6277 "=") (_o$6278 "fx=?") (_o$6279 "==") (_o$6280 "fx=?")) (jolt-hash-map _o$6247 _o$6248 _o$6249 _o$6250 _o$6251 _o$6252 _o$6253 _o$6254 _o$6255 _o$6256 _o$6257 _o$6258 _o$6259 _o$6260 _o$6261 _o$6262 _o$6263 _o$6264 _o$6265 _o$6266 _o$6267 _o$6268 _o$6269 _o$6270 _o$6271 _o$6272 _o$6273 _o$6274 _o$6275 _o$6276 _o$6277 _o$6278 _o$6279 _o$6280)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "prelude-mode?" (jolt-invoke (var-deref "clojure.core" "atom") #f)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "set-prelude-mode!" (letrec ((set-prelude-mode! (lambda (on) (let fnrec6281 ((on on)) (jolt-invoke (var-deref "clojure.core" "reset!") (var-deref "jolt.backend-scheme" "prelude-mode?") on))))) set-prelude-mode!)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "direct-link?" (jolt-invoke (var-deref "clojure.core" "atom") #f)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "set-direct-link!" (letrec ((set-direct-link! (lambda (on) (let fnrec6282 ((on on)) (jolt-invoke (var-deref "clojure.core" "reset!") (var-deref "jolt.backend-scheme" "direct-link?") on))))) set-direct-link!)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "direct-link-defined" (jolt-invoke (var-deref "clojure.core" "atom") (jolt-hash-set))))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "direct-link-fns" (jolt-invoke (var-deref "clojure.core" "atom") (jolt-hash-set))))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "direct-link-reset!" (letrec ((direct-link-reset! (lambda () (let fnrec6283 () (begin (jolt-invoke (var-deref "clojure.core" "reset!") (var-deref "jolt.backend-scheme" "direct-link-defined") (jolt-hash-set)) (jolt-invoke (var-deref "clojure.core" "reset!") (var-deref "jolt.backend-scheme" "direct-link-fns") (jolt-hash-set))))))) direct-link-reset!)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "dl-munge" (letrec ((dl-munge (lambda (s) (let fnrec6284 ((s s)) (jolt-invoke (var-deref "clojure.string" "replace") (jolt-invoke (var-deref "clojure.string" "replace") (jolt-invoke (var-deref "clojure.string" "replace") s "$" "_D_") "#" "_H_") "'" "_Q_"))))) dl-munge)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "dl-name" (letrec ((dl-name (lambda (ns nm) (let fnrec6285 ((ns ns) (nm nm)) (let* ((_a$6286 (var-deref "clojure.core" "str")) (_a$6287 "jv$") (_a$6288 (jolt-invoke (var-deref "jolt.backend-scheme" "dl-munge") ns)) (_a$6289 "$") (_a$6290 (jolt-invoke (var-deref "jolt.backend-scheme" "dl-munge") nm))) (jolt-invoke _a$6286 _a$6287 _a$6288 _a$6289 _a$6290)))))) dl-name)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "dl-fqn" (letrec ((dl-fqn (lambda (ns nm) (let fnrec6291 ((ns ns) (nm nm)) (jolt-invoke (var-deref "clojure.core" "str") ns "/" nm))))) dl-fqn)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "direct-linkable?" (letrec ((direct-linkable? (lambda (ns nm) (let fnrec6292 ((ns ns) (nm nm)) (let* ((and__25__auto (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.backend-scheme" "direct-link?")))) (if (jolt-truthy? and__25__auto) (let* ((_a$6293 (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.backend-scheme" "direct-link-defined"))) (_a$6294 (jolt-invoke (var-deref "jolt.backend-scheme" "dl-fqn") ns nm))) (jolt-contains? _a$6293 _a$6294)) and__25__auto)))))) direct-linkable?)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "direct-link-fn?" (letrec ((direct-link-fn? (lambda (ns nm) (let fnrec6295 ((ns ns) (nm nm)) (let* ((_a$6296 (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.backend-scheme" "direct-link-fns"))) (_a$6297 (jolt-invoke (var-deref "jolt.backend-scheme" "dl-fqn") ns nm))) (jolt-contains? _a$6296 _a$6297)))))) direct-link-fn?)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.backend-scheme" "*recur-target*" jolt-nil (jolt-hash-map (keyword #f "dynamic") #t)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.backend-scheme" "*known-procs*" (jolt-hash-set) (jolt-hash-map (keyword #f "dynamic") #t)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.backend-scheme" "gensym-counter" (jolt-invoke (var-deref "clojure.core" "atom") 0) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "fresh-label" (letrec ((fresh-label (lambda (prefix) (let fnrec6298 ((prefix prefix)) (jolt-invoke (var-deref "clojure.core" "str") prefix (jolt-invoke (var-deref "clojure.core" "swap!") (var-deref "jolt.backend-scheme" "gensym-counter") jolt-inc)))))) fresh-label)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.backend-scheme" "scheme-reserved" (let* ((_o$6299 "if") (_o$6300 "begin") (_o$6301 "lambda") (_o$6302 "let") (_o$6303 "let*") (_o$6304 "letrec") (_o$6305 "letrec*") (_o$6306 "quote") (_o$6307 "quasiquote") (_o$6308 "unquote") (_o$6309 "set!") (_o$6310 "define") (_o$6311 "define-syntax") (_o$6312 "cond") (_o$6313 "case") (_o$6314 "when") (_o$6315 "unless") (_o$6316 "and") (_o$6317 "or") (_o$6318 "do") (_o$6319 "else") (_o$6320 "guard") (_o$6321 "parameterize") (_o$6322 "delay") (_o$6323 "values")) (jolt-hash-set _o$6299 _o$6300 _o$6301 _o$6302 _o$6303 _o$6304 _o$6305 _o$6306 _o$6307 _o$6308 _o$6309 _o$6310 _o$6311 _o$6312 _o$6313 _o$6314 _o$6315 _o$6316 _o$6317 _o$6318 _o$6319 _o$6320 _o$6321 _o$6322 _o$6323)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "munge-name" (letrec ((munge-name (lambda (s) (let fnrec6324 ((s s)) (let* ((s (jolt-invoke (var-deref "clojure.string" "replace") (jolt-invoke (var-deref "clojure.string" "replace") s "#" "_") "'" "_PRIME_"))) (if (jolt-contains? (var-deref "jolt.backend-scheme" "scheme-reserved") s) (jolt-invoke (var-deref "clojure.core" "str") "_" s) s)))))) munge-name)))
(guard (e (#t #f))
  (declare-var! "jolt.backend-scheme" "emit"))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "char-escape" (letrec ((char-escape (lambda (cp) (let fnrec6325 ((cp cp)) (if (jolt= cp 34) "\\\"" (if (jolt= cp 92) "\\\\" (if (jolt= cp 10) "\\n" (if (jolt= cp 9) "\\t" (if (jolt= cp 13) "\\r" (if (jolt-truthy? (let* ((and__25__auto (>= cp 32))) (if (jolt-truthy? and__25__auto) (< cp 127) and__25__auto))) (jolt-invoke (var-deref "clojure.core" "str") (jolt-invoke (var-deref "clojure.core" "char") cp)) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "clojure.core" "str") "\\x" (jolt-invoke (var-deref "clojure.core" "format") "%x" cp) ";") jolt-nil))))))))))) char-escape)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "chez-str-lit" (letrec ((chez-str-lit (lambda (s) (let fnrec6326 ((s s)) (jolt-invoke (var-deref "clojure.core" "str") "\"" (jolt-apply (var-deref "clojure.core" "str") (jolt-map (lambda (c) (let fnrec6327 ((c c)) (jolt-invoke (var-deref "jolt.backend-scheme" "char-escape") (jolt-invoke (var-deref "clojure.core" "int") c)))) s)) "\""))))) chez-str-lit)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-const" (letrec ((emit-const (lambda (v) (let fnrec6328 ((v v)) (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "nil?") v)) "jolt-nil" (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "boolean?") v)) (if (jolt-truthy? v) "#t" "#f") (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "number?") v)) (if (jolt= v +inf.0) "+inf.0" (if (jolt= v -inf.0) "-inf.0" (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "not=") v v)) "+nan.0" (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "float?") v)) (let* ((s (jolt-invoke (var-deref "clojure.core" "str") v))) (if (jolt-truthy? (let* ((or__26__auto (jolt-invoke (var-deref "clojure.string" "includes?") s "."))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-invoke (var-deref "clojure.string" "includes?") s "e")))) s (jolt-invoke (var-deref "clojure.core" "str") s ".0"))) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "clojure.core" "str") v) jolt-nil))))) (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "string?") v)) (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") v) (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "keyword?") v)) (let* ((temp__16__auto (jolt-invoke (var-deref "clojure.core" "namespace") v))) (if (jolt-truthy? temp__16__auto) (let* ((kns temp__16__auto)) (let* ((_a$6329 (var-deref "clojure.core" "str")) (_a$6330 "(keyword ") (_a$6331 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") kns)) (_a$6332 " ") (_a$6333 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-invoke (var-deref "clojure.core" "name") v))) (_a$6334 ")")) (jolt-invoke _a$6329 _a$6330 _a$6331 _a$6332 _a$6333 _a$6334))) (jolt-invoke (var-deref "clojure.core" "str") "(keyword #f " (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-invoke (var-deref "clojure.core" "name") v)) ")"))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-char?") v)) (jolt-invoke (var-deref "clojure.core" "str") "(integer->char " (jolt-invoke (var-deref "jolt.host" "form-char-code") v) ")") (if (jolt-truthy? (keyword #f "else")) (jolt-throw (let* ((_a$6335 (jolt-invoke (var-deref "clojure.core" "str") "emit-const: unsupported literal " (jolt-invoke (var-deref "clojure.core" "pr-str") v))) (_a$6336 (jolt-hash-map))) (jolt-ex-info _a$6335 _a$6336))) jolt-nil))))))))))) emit-const)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-ordered" (letrec ((emit-ordered (lambda (ctor arg-strs) (let fnrec6337 ((ctor ctor) (arg-strs arg-strs)) (if (< (jolt-count arg-strs) 2) (jolt-invoke (var-deref "clojure.core" "str") "(" ctor (if (jolt-empty? arg-strs) "" (jolt-invoke (var-deref "clojure.core" "str") " " (jolt-invoke (var-deref "clojure.string" "join") " " arg-strs))) ")") (let* ((tmps (jolt-map (lambda (_) (let fnrec6338 ((_ _)) (jolt-invoke (var-deref "jolt.backend-scheme" "fresh-label") "_o$"))) arg-strs)) (binds (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-map (lambda (t a) (let fnrec6339 ((t t) (a a)) (jolt-invoke (var-deref "clojure.core" "str") "(" t " " a ")"))) tmps arg-strs)))) (jolt-invoke (var-deref "clojure.core" "str") "(let* (" binds ") (" ctor " " (jolt-invoke (var-deref "clojure.string" "join") " " tmps) "))"))))))) emit-ordered)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "side-effect-free?" (letrec ((side-effect-free? (lambda (n) (let fnrec6340 ((n n)) (let* ((_a$6346 (let* ((_o$6341 (keyword #f "const")) (_o$6342 (keyword #f "local")) (_o$6343 (keyword #f "var")) (_o$6344 (keyword #f "the-var")) (_o$6345 (keyword #f "quote"))) (jolt-hash-set _o$6341 _o$6342 _o$6343 _o$6344 _o$6345))) (_a$6347 (jolt-get n (keyword #f "op")))) (jolt-contains? _a$6346 _a$6347)))))) side-effect-free?)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "needs-order?" (letrec ((needs-order? (lambda (nodes) (let fnrec6348 ((nodes nodes)) (> (jolt-count (jolt-remove (var-deref "jolt.backend-scheme" "side-effect-free?") nodes)) 1))))) needs-order?)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "ordered-call" (letrec ((ordered-call (lambda (nodes strs build) (let fnrec6349 ((nodes nodes) (strs strs) (build build)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.backend-scheme" "needs-order?") nodes)) (let* ((tmps (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (_) (let fnrec6350 ((_ _)) (jolt-invoke (var-deref "jolt.backend-scheme" "fresh-label") "_a$"))) strs)) (binds (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-map (lambda (t a) (let fnrec6351 ((t t) (a a)) (jolt-invoke (var-deref "clojure.core" "str") "(" t " " a ")"))) tmps strs)))) (jolt-invoke (var-deref "clojure.core" "str") "(let* (" binds ") " (jolt-invoke build tmps) ")")) (jolt-invoke build strs)))))) ordered-call)))
(guard (e (#t #f))
  (declare-var! "jolt.backend-scheme" "emit-quoted"))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-quoted-map" (letrec ((emit-quoted-map (lambda (pairs) (let fnrec6352 ((pairs pairs)) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-hash-map " (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-invoke (var-deref "clojure.core" "mapcat") (lambda (p) (let fnrec6353 ((p p)) (let* ((_o$6354 (jolt-invoke (var-deref "jolt.backend-scheme" "emit-quoted") (jolt-nth p 0))) (_o$6355 (jolt-invoke (var-deref "jolt.backend-scheme" "emit-quoted") (jolt-nth p 1)))) (jolt-vector _o$6354 _o$6355)))) pairs)) ")"))))) emit-quoted-map)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-quoted-map-value" (letrec ((emit-quoted-map-value (lambda (m) (let fnrec6356 ((m m)) (let* ((pairs (jolt-invoke (var-deref "clojure.core" "sort") (let* ((_a$6362 (lambda (k) (let fnrec6357 ((k k)) (let* ((_a$6358 (var-deref "clojure.core" "str")) (_a$6359 (jolt-invoke (var-deref "jolt.backend-scheme" "emit-quoted") k)) (_a$6360 " ") (_a$6361 (jolt-invoke (var-deref "jolt.backend-scheme" "emit-quoted") (jolt-get m k)))) (jolt-invoke _a$6358 _a$6359 _a$6360 _a$6361))))) (_a$6363 (jolt-keys m))) (jolt-map _a$6362 _a$6363))))) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-hash-map " (jolt-invoke (var-deref "clojure.string" "join") " " pairs) ")")))))) emit-quoted-map-value)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-quoted" (letrec ((emit-quoted (lambda (form) (let fnrec6364 ((form form)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-char?") form)) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-const") form) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-literal?") form)) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-const") form) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-sym?") form)) (let* ((m (jolt-invoke (var-deref "jolt.host" "form-sym-meta") form)) (sns (jolt-invoke (var-deref "jolt.host" "form-sym-ns") form)) (nm (jolt-invoke (var-deref "jolt.host" "form-sym-name") form))) (if (jolt-truthy? (let* ((and__25__auto m)) (if (jolt-truthy? and__25__auto) (jolt-pos? (jolt-count m)) and__25__auto))) (let* ((_a$6365 (var-deref "clojure.core" "str")) (_a$6366 "(jolt-symbol/meta ") (_a$6367 (if (jolt-truthy? sns) (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") sns) "#f")) (_a$6368 " ") (_a$6369 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") nm)) (_a$6370 " ") (_a$6371 (jolt-invoke emit-quoted m)) (_a$6372 ")")) (jolt-invoke _a$6365 _a$6366 _a$6367 _a$6368 _a$6369 _a$6370 _a$6371 _a$6372)) (let* ((_a$6373 (var-deref "clojure.core" "str")) (_a$6374 "(jolt-symbol ") (_a$6375 (if (jolt-truthy? sns) (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") sns) "#f")) (_a$6376 " ") (_a$6377 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") nm)) (_a$6378 ")")) (jolt-invoke _a$6373 _a$6374 _a$6375 _a$6376 _a$6377 _a$6378)))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-set?") form)) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-hash-set " (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-invoke (var-deref "clojure.core" "sort") (jolt-map emit-quoted (jolt-invoke (var-deref "jolt.host" "form-set-items") form)))) ")") (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-list?") form)) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-list " (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-map emit-quoted (jolt-invoke (var-deref "jolt.host" "form-elements") form))) ")") (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-vec?") form)) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-vector " (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-map emit-quoted (jolt-invoke (var-deref "jolt.host" "form-vec-items") form))) ")") (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-map?") form)) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-quoted-map") (jolt-invoke (var-deref "jolt.host" "form-map-pairs") form)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "form-regex?") form)) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-regex " (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-invoke (var-deref "jolt.host" "form-regex-source") form)) ")") (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "map?") form)) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-quoted-map-value") form) (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "vector?") form)) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-vector " (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-map emit-quoted form)) ")") (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "set?") form)) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-hash-set " (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-invoke (var-deref "clojure.core" "sort") (jolt-map emit-quoted form))) ")") (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "seq?") form)) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-list " (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-map emit-quoted form)) ")") (if (jolt-truthy? (keyword #f "else")) (jolt-throw (let* ((_a$6379 (jolt-invoke (var-deref "clojure.core" "str") "emit-quoted: unsupported quoted form " (jolt-invoke (var-deref "clojure.core" "pr-str") form))) (_a$6380 (jolt-hash-map))) (jolt-ex-info _a$6379 _a$6380))) jolt-nil))))))))))))))))) emit-quoted)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "jmeta-nonempty?" (letrec ((jmeta-nonempty? (lambda (m) (let fnrec6381 ((m m)) (let* ((and__25__auto (jolt-invoke (var-deref "clojure.core" "map?") m))) (if (jolt-truthy? and__25__auto) (jolt-pos? (jolt-count m)) and__25__auto)))))) jmeta-nonempty?)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-binding" (letrec ((emit-binding (lambda (b) (let fnrec6382 ((b b)) (let* ((_a$6383 (var-deref "clojure.core" "str")) (_a$6384 "(") (_a$6385 (jolt-invoke (var-deref "jolt.backend-scheme" "munge-name") (jolt-nth b 0))) (_a$6386 " ") (_a$6387 (jolt-invoke (var-deref "jolt.backend-scheme" "emit") (jolt-nth b 1))) (_a$6388 ")")) (jolt-invoke _a$6383 _a$6384 _a$6385 _a$6386 _a$6387 _a$6388)))))) emit-binding)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-let" (letrec ((emit-let (lambda (node) (let fnrec6389 ((node node)) (let* ((kw (if (jolt-truthy? (jolt-get node (keyword #f "letrec"))) "letrec*" "let*"))) (let* ((_a$6390 (var-deref "clojure.core" "str")) (_a$6391 "(") (_a$6392 kw) (_a$6393 " (") (_a$6394 (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-map (var-deref "jolt.backend-scheme" "emit-binding") (jolt-get node (keyword #f "bindings"))))) (_a$6395 ") ") (_a$6396 (jolt-invoke (var-deref "jolt.backend-scheme" "emit") (jolt-get node (keyword #f "body")))) (_a$6397 ")")) (jolt-invoke _a$6390 _a$6391 _a$6392 _a$6393 _a$6394 _a$6395 _a$6396 _a$6397))))))) emit-let)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-loop" (letrec ((emit-loop (lambda (node) (let fnrec6398 ((node node)) (let* ((label (jolt-invoke (var-deref "jolt.backend-scheme" "fresh-label") "loop")) (pairs (jolt-get node (keyword #f "bindings"))) (names (jolt-map (lambda (p__83_) (let fnrec6399 ((p__83_ p__83_)) (jolt-invoke (var-deref "jolt.backend-scheme" "munge-name") (jolt-nth p__83_ 0)))) pairs)) (inits (jolt-map (lambda (p__84_) (let fnrec6400 ((p__84_ p__84_)) (jolt-invoke (var-deref "jolt.backend-scheme" "emit") (jolt-nth p__84_ 1)))) pairs)) (seq-bs (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-map (lambda (n i) (let fnrec6401 ((n n) (i i)) (jolt-invoke (var-deref "clojure.core" "str") "(" n " " i ")"))) names inits))) (rebinds (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-map (lambda (n) (let fnrec6402 ((n n)) (jolt-invoke (var-deref "clojure.core" "str") "(" n " " n ")"))) names))) (body (let* ((frame__20__auto (jolt-invoke (var-deref "clojure.core" "array-map") (jolt-var "jolt.backend-scheme" "*recur-target*") label))) (begin (jolt-invoke (var-deref "clojure.core" "push-thread-bindings") frame__20__auto) (dynamic-wind (lambda () #f) (lambda () (jolt-invoke (var-deref "jolt.backend-scheme" "emit") (jolt-get node (keyword #f "body")))) (lambda () (jolt-invoke (var-deref "clojure.core" "pop-thread-bindings")))))))) (jolt-invoke (var-deref "clojure.core" "str") "(let* (" seq-bs ") (let " label " (" rebinds ") " body "))")))))) emit-loop)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.backend-scheme" "ffi-types" (let* ((_o$6403 "int") (_o$6404 "int") (_o$6405 "uint") (_o$6406 "unsigned-int") (_o$6407 "long") (_o$6408 "long") (_o$6409 "ulong") (_o$6410 "unsigned-long") (_o$6411 "int64") (_o$6412 "integer-64") (_o$6413 "uint64") (_o$6414 "unsigned-64") (_o$6415 "size_t") (_o$6416 "size_t") (_o$6417 "ssize_t") (_o$6418 "ssize_t") (_o$6419 "iptr") (_o$6420 "iptr") (_o$6421 "uptr") (_o$6422 "uptr") (_o$6423 "double") (_o$6424 "double") (_o$6425 "float") (_o$6426 "float") (_o$6427 "pointer") (_o$6428 "void*") (_o$6429 "void*") (_o$6430 "void*") (_o$6431 "string") (_o$6432 "string") (_o$6433 "void") (_o$6434 "void") (_o$6435 "uint8") (_o$6436 "unsigned-8") (_o$6437 "u8") (_o$6438 "unsigned-8") (_o$6439 "byte") (_o$6440 "unsigned-8") (_o$6441 "char") (_o$6442 "char")) (jolt-hash-map _o$6403 _o$6404 _o$6405 _o$6406 _o$6407 _o$6408 _o$6409 _o$6410 _o$6411 _o$6412 _o$6413 _o$6414 _o$6415 _o$6416 _o$6417 _o$6418 _o$6419 _o$6420 _o$6421 _o$6422 _o$6423 _o$6424 _o$6425 _o$6426 _o$6427 _o$6428 _o$6429 _o$6430 _o$6431 _o$6432 _o$6433 _o$6434 _o$6435 _o$6436 _o$6437 _o$6438 _o$6439 _o$6440 _o$6441 _o$6442)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "ffi-type->chez" (letrec ((ffi-type->chez (lambda (t) (let fnrec6443 ((t t)) (let* ((or__26__auto (jolt-invoke (var-deref "jolt.backend-scheme" "ffi-types") t))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-throw (let* ((_a$6444 (jolt-invoke (var-deref "clojure.core" "str") "jolt.ffi: unknown foreign type :" t)) (_a$6445 (jolt-hash-map))) (jolt-ex-info _a$6444 _a$6445))))))))) ffi-type->chez)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-ffi-fn" (letrec ((emit-ffi-fn (lambda (node) (let fnrec6446 ((node node)) (let* ((_a$6447 (var-deref "clojure.core" "str")) (_a$6448 "(foreign-procedure ") (_a$6449 (if (jolt-truthy? (jolt-get node (keyword #f "blocking"))) "__collect_safe " jolt-nil)) (_a$6450 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "csym")))) (_a$6451 " (") (_a$6452 (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-map (var-deref "jolt.backend-scheme" "ffi-type->chez") (jolt-get node (keyword #f "argtypes"))))) (_a$6453 ") ") (_a$6454 (jolt-invoke (var-deref "jolt.backend-scheme" "ffi-type->chez") (jolt-get node (keyword #f "rettype")))) (_a$6455 ")")) (jolt-invoke _a$6447 _a$6448 _a$6449 _a$6450 _a$6451 _a$6452 _a$6453 _a$6454 _a$6455)))))) emit-ffi-fn)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-ffi-callable" (letrec ((emit-ffi-callable (lambda (node) (let fnrec6456 ((node node)) (let* ((_a$6457 (var-deref "clojure.core" "str")) (_a$6458 "(jolt-ffi-register-callable! (foreign-callable ") (_a$6459 (if (jolt-truthy? (jolt-get node (keyword #f "collect-safe"))) "__collect_safe " jolt-nil)) (_a$6460 (jolt-invoke (var-deref "jolt.backend-scheme" "emit") (jolt-get node (keyword #f "fn")))) (_a$6461 " (") (_a$6462 (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-map (var-deref "jolt.backend-scheme" "ffi-type->chez") (jolt-get node (keyword #f "argtypes"))))) (_a$6463 ") ") (_a$6464 (jolt-invoke (var-deref "jolt.backend-scheme" "ffi-type->chez") (jolt-get node (keyword #f "rettype")))) (_a$6465 "))")) (jolt-invoke _a$6457 _a$6458 _a$6459 _a$6460 _a$6461 _a$6462 _a$6463 _a$6464 _a$6465)))))) emit-ffi-callable)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-recur" (letrec ((emit-recur (lambda (node) (let fnrec6466 ((node node)) (begin (if (jolt-not (var-deref "jolt.backend-scheme" "*recur-target*")) (jolt-throw (jolt-ex-info "emit: recur outside a loop/fn target" (jolt-hash-map))) jolt-nil) (let* ((arg-nodes (jolt-get node (keyword #f "args")))) (let* ((_a$6468 (var-deref "jolt.backend-scheme" "ordered-call")) (_a$6469 arg-nodes) (_a$6470 (jolt-invoke (var-deref "clojure.core" "mapv") (var-deref "jolt.backend-scheme" "emit") arg-nodes)) (_a$6471 (lambda (as) (let fnrec6467 ((as as)) (jolt-invoke (var-deref "clojure.core" "str") "(" (var-deref "jolt.backend-scheme" "*recur-target*") " " (jolt-invoke (var-deref "clojure.string" "join") " " as) ")"))))) (jolt-invoke _a$6468 _a$6469 _a$6470 _a$6471)))))))) emit-recur)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "nhint-init" (letrec ((nhint-init (lambda (nh orig munged) (let fnrec6472 ((nh nh) (orig orig) (munged munged)) (let* ((k (jolt-get nh orig))) (if (jolt= k (keyword #f "double")) (jolt-invoke (var-deref "clojure.core" "str") "(exact->inexact " munged ")") (if (jolt= k (keyword #f "long")) (jolt-invoke (var-deref "clojure.core" "str") "(jolt->fx " munged ")") (if (jolt-truthy? (keyword #f "else")) munged jolt-nil)))))))) nhint-init)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-arity-clause" (letrec ((emit-arity-clause (lambda (a) (let fnrec6473 ((a a)) (let* ((orig (jolt-get a (keyword #f "params"))) (nh (let* ((_a$6474 (jolt-hash-map)) (_a$6475 (jolt-get a (keyword #f "nhints")))) (jolt-into _a$6474 _a$6475))) (params (jolt-map (var-deref "jolt.backend-scheme" "munge-name") orig)) (restp (let* ((temp__27__auto (jolt-get a (keyword #f "rest")))) (if (jolt-truthy? temp__27__auto) (let* ((r temp__27__auto)) (jolt-invoke (var-deref "jolt.backend-scheme" "munge-name") r)) jolt-nil))) (label (jolt-invoke (var-deref "jolt.backend-scheme" "fresh-label") "fnrec")) (body (let* ((frame__20__auto (jolt-invoke (var-deref "clojure.core" "array-map") (jolt-var "jolt.backend-scheme" "*recur-target*") label))) (begin (jolt-invoke (var-deref "clojure.core" "push-thread-bindings") frame__20__auto) (dynamic-wind (lambda () #f) (lambda () (jolt-invoke (var-deref "jolt.backend-scheme" "emit") (jolt-get a (keyword #f "body")))) (lambda () (jolt-invoke (var-deref "clojure.core" "pop-thread-bindings"))))))) (paramlist (if (jolt-truthy? (let* ((and__25__auto restp)) (if (jolt-truthy? and__25__auto) (jolt-empty? params) and__25__auto))) restp (if (jolt-truthy? restp) (jolt-invoke (var-deref "clojure.core" "str") "(" (jolt-invoke (var-deref "clojure.string" "join") " " params) " . " restp ")") (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "clojure.core" "str") "(" (jolt-invoke (var-deref "clojure.string" "join") " " params) ")") jolt-nil)))) (pbind (jolt-map (lambda (o p) (let fnrec6476 ((o o) (p p)) (jolt-invoke (var-deref "clojure.core" "str") "(" p " " (jolt-invoke (var-deref "jolt.backend-scheme" "nhint-init") nh o p) ")"))) orig params)) (binds (if (jolt-truthy? restp) (jolt-concat pbind (jolt-vector (jolt-invoke (var-deref "clojure.core" "str") "(" restp " (list->cseq " restp "))"))) pbind)) (lett (jolt-invoke (var-deref "clojure.core" "str") "(let " label " (" (jolt-invoke (var-deref "clojure.string" "join") " " binds) ") " body ")")) (ret (jolt-get a (keyword #f "ret-nhint")))) (let* ((_o$6477 paramlist) (_o$6478 (if (jolt= ret (keyword #f "double")) (jolt-invoke (var-deref "clojure.core" "str") "(exact->inexact " lett ")") (if (jolt= ret (keyword #f "long")) (jolt-invoke (var-deref "clojure.core" "str") "(jolt->fx " lett ")") (if (jolt-truthy? (keyword #f "else")) lett jolt-nil))))) (jolt-vector _o$6477 _o$6478))))))) emit-arity-clause)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-fn" (letrec ((emit-fn (lambda (node) (let fnrec6479 ((node node)) (let* ((arities (jolt-get node (keyword #f "arities"))) (self (let* ((temp__27__auto (jolt-get node (keyword #f "name")))) (if (jolt-truthy? temp__27__auto) (let* ((nm temp__27__auto)) (jolt-invoke (var-deref "jolt.backend-scheme" "munge-name") nm)) jolt-nil))) (clauses (let* ((frame__20__auto (jolt-invoke (var-deref "clojure.core" "array-map") (jolt-var "jolt.backend-scheme" "*known-procs*") (if (jolt-truthy? self) (jolt-conj (var-deref "jolt.backend-scheme" "*known-procs*") self) (var-deref "jolt.backend-scheme" "*known-procs*"))))) (begin (jolt-invoke (var-deref "clojure.core" "push-thread-bindings") frame__20__auto) (dynamic-wind (lambda () #f) (lambda () (jolt-invoke (var-deref "clojure.core" "mapv") (var-deref "jolt.backend-scheme" "emit-arity-clause") arities)) (lambda () (jolt-invoke (var-deref "clojure.core" "pop-thread-bindings"))))))) (_lambda (if (jolt= 1 (jolt-count clauses)) (let* ((c (jolt-first clauses))) (let* ((_a$6480 (var-deref "clojure.core" "str")) (_a$6481 "(lambda ") (_a$6482 (jolt-nth c 0)) (_a$6483 " ") (_a$6484 (jolt-nth c 1)) (_a$6485 ")")) (jolt-invoke _a$6480 _a$6481 _a$6482 _a$6483 _a$6484 _a$6485))) (jolt-invoke (var-deref "clojure.core" "str") "(case-lambda " (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-map (lambda (c) (let fnrec6486 ((c c)) (let* ((_a$6487 (var-deref "clojure.core" "str")) (_a$6488 "(") (_a$6489 (jolt-nth c 0)) (_a$6490 " ") (_a$6491 (jolt-nth c 1)) (_a$6492 ")")) (jolt-invoke _a$6487 _a$6488 _a$6489 _a$6490 _a$6491 _a$6492)))) clauses)) ")")))) (let* ((temp__16__auto (jolt-get node (keyword #f "name")))) (if (jolt-truthy? temp__16__auto) (let* ((nm temp__16__auto)) (let* ((m (jolt-invoke (var-deref "jolt.backend-scheme" "munge-name") nm))) (jolt-invoke (var-deref "clojure.core" "str") "(letrec ((" m " " _lambda ")) " m ")"))) _lambda))))))) emit-fn)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "native-op" (letrec ((native-op (lambda (fnode nargs) (let fnrec6493 ((fnode fnode) (nargs nargs)) (let* ((nm (let* ((G__123 (jolt-get fnode (keyword #f "op")))) (if (jolt= G__123 (keyword #f "var")) (if (jolt= "clojure.core" (jolt-get fnode (keyword #f "ns"))) (jolt-get fnode (keyword #f "name")) jolt-nil) (if (jolt= G__123 (keyword #f "host")) (jolt-get fnode (keyword #f "name")) jolt-nil)))) (op (if (jolt-truthy? nm) (jolt-invoke (var-deref "jolt.backend-scheme" "native-ops") nm) jolt-nil)) (arity-ok (if (jolt-truthy? nm) (jolt-invoke (var-deref "jolt.backend-scheme" "op-arity") nm) jolt-nil))) (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "nil?") op)) jolt-nil (if (jolt-truthy? (let* ((and__25__auto arity-ok)) (if (jolt-truthy? and__25__auto) (jolt-not (jolt-invoke arity-ok nargs)) and__25__auto))) jolt-nil (if (jolt-truthy? (keyword #f "else")) op jolt-nil)))))))) native-op)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "ifn-kind" (letrec ((ifn-kind (lambda (fnode) (let fnrec6494 ((fnode fnode)) (let* ((G__124 (jolt-get fnode (keyword #f "op")))) (if (jolt= G__124 (keyword #f "const")) (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "keyword?") (jolt-get fnode (keyword #f "val")))) (keyword #f "keyword") jolt-nil) (if (jolt-truthy? (let* ((or__26__auto (jolt= G__124 (keyword #f "map")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= G__124 (keyword #f "set")))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= G__124 (keyword #f "vector"))))))) (keyword #f "coll") jolt-nil))))))) ifn-kind)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "stdlib-var?" (letrec ((stdlib-var? (lambda (n) (let fnrec6495 ((n n)) (let* ((and__25__auto (jolt= (keyword #f "var") (jolt-get n (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.string" "starts-with?") (let* ((or__26__auto (jolt-get n (keyword #f "ns")))) (if (jolt-truthy? or__26__auto) or__26__auto "")) "clojure.") and__25__auto)))))) stdlib-var?)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-numeric" (letrec ((emit-numeric (lambda (kind nm args order-args) (let fnrec6496 ((kind kind) (nm nm) (args args) (order-args order-args)) (if (jolt-truthy? (let* ((and__25__auto (jolt= kind (keyword #f "double")))) (if (jolt-truthy? and__25__auto) (jolt= nm "inc") and__25__auto))) (jolt-invoke (var-deref "clojure.core" "str") "(fl+ " (jolt-first args) " 1.0)") (if (jolt-truthy? (let* ((and__25__auto (jolt= kind (keyword #f "double")))) (if (jolt-truthy? and__25__auto) (jolt= nm "dec") and__25__auto))) (jolt-invoke (var-deref "clojure.core" "str") "(fl- " (jolt-first args) " 1.0)") (if (jolt-truthy? (let* ((and__25__auto (jolt= kind (keyword #f "long")))) (if (jolt-truthy? and__25__auto) (let* ((or__26__auto (jolt= nm "inc"))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= nm "unchecked-inc"))) and__25__auto))) (jolt-invoke (var-deref "clojure.core" "str") "(fx1+ " (jolt-first args) ")") (if (jolt-truthy? (let* ((and__25__auto (jolt= kind (keyword #f "long")))) (if (jolt-truthy? and__25__auto) (let* ((or__26__auto (jolt= nm "dec"))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= nm "unchecked-dec"))) and__25__auto))) (jolt-invoke (var-deref "clojure.core" "str") "(fx1- " (jolt-first args) ")") (if (jolt-truthy? (keyword #f "else")) (let* ((op (if (jolt= kind (keyword #f "double")) (jolt-invoke (var-deref "jolt.backend-scheme" "dbl-ops") nm) (jolt-invoke (var-deref "jolt.backend-scheme" "lng-ops") nm)))) (jolt-invoke order-args (lambda (as) (let fnrec6497 ((as as)) (jolt-invoke (var-deref "clojure.core" "str") "(" op " " (jolt-invoke (var-deref "clojure.string" "join") " " as) ")"))))) jolt-nil))))))))) emit-numeric)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-invoke" (letrec ((emit-invoke (lambda (node) (let fnrec6498 ((node node)) (let* ((fnode (jolt-get node (keyword #f "fn"))) (arg-nodes (jolt-get node (keyword #f "args"))) (args (jolt-invoke (var-deref "clojure.core" "mapv") (var-deref "jolt.backend-scheme" "emit") arg-nodes)) (nop (jolt-invoke (var-deref "jolt.backend-scheme" "native-op") fnode (jolt-count args))) (kind (jolt-invoke (var-deref "jolt.backend-scheme" "ifn-kind") fnode)) (order-args (lambda (build) (let fnrec6499 ((build build)) (jolt-invoke (var-deref "jolt.backend-scheme" "ordered-call") arg-nodes args build)))) (defstr (lambda (as) (let fnrec6500 ((as as)) (if (> (jolt-count as) 1) (jolt-invoke (var-deref "clojure.core" "str") " " (jolt-nth as 1)) "")))) (invoke (lambda () (let fnrec6501 () (let* ((_a$6503 (var-deref "jolt.backend-scheme" "ordered-call")) (_a$6504 (jolt-cons fnode arg-nodes)) (_a$6505 (jolt-cons (jolt-invoke (var-deref "jolt.backend-scheme" "emit") fnode) args)) (_a$6506 (lambda (G__125) (let fnrec6502 ((G__125 G__125)) (let* ((G__126 G__125) (f (jolt-nth G__126 0 jolt-nil)) (as (jolt-invoke (var-deref "clojure.core" "nthnext") G__126 1))) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-invoke " f (if (jolt-truthy? (jolt-seq as)) (jolt-invoke (var-deref "clojure.core" "str") " " (jolt-invoke (var-deref "clojure.string" "join") " " as)) "") ")")))))) (jolt-invoke _a$6503 _a$6504 _a$6505 _a$6506)))))) (if (jolt-truthy? (jolt-get node (keyword #f "num-kind"))) (let* ((_a$6507 (var-deref "jolt.backend-scheme" "emit-numeric")) (_a$6508 (jolt-get node (keyword #f "num-kind"))) (_a$6509 (jolt-get fnode (keyword #f "name"))) (_a$6510 args) (_a$6511 order-args)) (jolt-invoke _a$6507 _a$6508 _a$6509 _a$6510 _a$6511)) (if (jolt-truthy? (let* ((and__25__auto nop)) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-empty? args))) (if (jolt-truthy? and__25__auto) (jolt= nop "+") and__25__auto)) and__25__auto))) "0" (if (jolt-truthy? (let* ((and__25__auto nop)) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-empty? args))) (if (jolt-truthy? and__25__auto) (jolt= nop "*") and__25__auto)) and__25__auto))) "1" (if (jolt-truthy? (let* ((and__25__auto nop)) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= 1 (jolt-count args)))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.backend-scheme" "cmp1-ops") nop) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "clojure.core" "str") "(begin " (jolt-first args) " #t)") (if (jolt-truthy? nop) (jolt-invoke order-args (lambda (as) (let fnrec6512 ((as as)) (jolt-invoke (var-deref "clojure.core" "str") "(" nop " " (jolt-invoke (var-deref "clojure.string" "join") " " as) ")")))) (if (jolt= kind (keyword #f "keyword")) (jolt-invoke order-args (lambda (as) (let fnrec6513 ((as as)) (let* ((_a$6514 (var-deref "clojure.core" "str")) (_a$6515 "(jolt-get ") (_a$6516 (jolt-first as)) (_a$6517 " ") (_a$6518 (jolt-invoke (var-deref "jolt.backend-scheme" "emit") fnode)) (_a$6519 (jolt-invoke defstr as)) (_a$6520 ")")) (jolt-invoke _a$6514 _a$6515 _a$6516 _a$6517 _a$6518 _a$6519 _a$6520))))) (if (jolt= kind (keyword #f "coll")) (let* ((_a$6522 (var-deref "jolt.backend-scheme" "ordered-call")) (_a$6523 (jolt-cons fnode arg-nodes)) (_a$6524 (jolt-cons (jolt-invoke (var-deref "jolt.backend-scheme" "emit") fnode) args)) (_a$6525 (lambda (G__127) (let fnrec6521 ((G__127 G__127)) (let* ((G__128 G__127) (c (jolt-nth G__128 0 jolt-nil)) (as (jolt-invoke (var-deref "clojure.core" "nthnext") G__128 1))) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-get " c " " (jolt-invoke (var-deref "clojure.string" "join") " " as) ")")))))) (jolt-invoke _a$6522 _a$6523 _a$6524 _a$6525)) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.backend-scheme" "stdlib-var?") fnode))) (if (jolt-truthy? and__25__auto) (jolt-not (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.backend-scheme" "prelude-mode?"))) and__25__auto))) (jolt-throw (let* ((_a$6532 (let* ((_a$6526 (var-deref "clojure.core" "str")) (_a$6527 "emit: unsupported stdlib fn `") (_a$6528 (jolt-get fnode (keyword #f "ns"))) (_a$6529 "/") (_a$6530 (jolt-get fnode (keyword #f "name"))) (_a$6531 "` (no core on Chez yet)")) (jolt-invoke _a$6526 _a$6527 _a$6528 _a$6529 _a$6530 _a$6531))) (_a$6533 (jolt-hash-map))) (jolt-ex-info _a$6532 _a$6533))) (if (jolt= (keyword #f "host-static") (jolt-get fnode (keyword #f "op"))) (jolt-invoke order-args (lambda (as) (let fnrec6534 ((as as)) (let* ((_a$6535 (var-deref "clojure.core" "str")) (_a$6536 "(host-static-call ") (_a$6537 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get fnode (keyword #f "class")))) (_a$6538 " ") (_a$6539 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get fnode (keyword #f "member")))) (_a$6540 (if (jolt-empty? as) "" (jolt-invoke (var-deref "clojure.core" "str") " " (jolt-invoke (var-deref "clojure.string" "join") " " as)))) (_a$6541 ")")) (jolt-invoke _a$6535 _a$6536 _a$6537 _a$6538 _a$6539 _a$6540 _a$6541))))) (if (jolt= (keyword #f "host") (jolt-get fnode (keyword #f "op"))) (jolt-throw (let* ((_a$6542 (jolt-invoke (var-deref "clojure.core" "str") "emit: unsupported host call `" (jolt-get fnode (keyword #f "name")) "`")) (_a$6543 (jolt-hash-map))) (jolt-ex-info _a$6542 _a$6543))) (if (jolt-truthy? (let* ((and__25__auto (jolt= (keyword #f "local") (jolt-get fnode (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (jolt-not (jolt-invoke (var-deref "jolt.backend-scheme" "*known-procs*") (jolt-invoke (var-deref "jolt.backend-scheme" "munge-name") (jolt-get fnode (keyword #f "name"))))) and__25__auto))) (jolt-invoke invoke) (if (jolt-truthy? (let* ((and__25__auto (jolt= (keyword #f "var") (jolt-get fnode (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (let* ((_a$6544 (var-deref "jolt.backend-scheme" "direct-linkable?")) (_a$6545 (jolt-get fnode (keyword #f "ns"))) (_a$6546 (jolt-get fnode (keyword #f "name")))) (jolt-invoke _a$6544 _a$6545 _a$6546)))) (if (jolt-truthy? and__25__auto) (let* ((_a$6547 (var-deref "jolt.backend-scheme" "direct-link-fn?")) (_a$6548 (jolt-get fnode (keyword #f "ns"))) (_a$6549 (jolt-get fnode (keyword #f "name")))) (jolt-invoke _a$6547 _a$6548 _a$6549)) and__25__auto)) and__25__auto))) (jolt-invoke order-args (lambda (as) (let fnrec6550 ((as as)) (let* ((_a$6554 (var-deref "clojure.core" "str")) (_a$6555 "(") (_a$6556 (let* ((_a$6551 (var-deref "jolt.backend-scheme" "dl-name")) (_a$6552 (jolt-get fnode (keyword #f "ns"))) (_a$6553 (jolt-get fnode (keyword #f "name")))) (jolt-invoke _a$6551 _a$6552 _a$6553))) (_a$6557 (if (jolt-truthy? (jolt-seq as)) (jolt-invoke (var-deref "clojure.core" "str") " " (jolt-invoke (var-deref "clojure.string" "join") " " as)) "")) (_a$6558 ")")) (jolt-invoke _a$6554 _a$6555 _a$6556 _a$6557 _a$6558))))) (if (jolt= (keyword #f "var") (jolt-get fnode (keyword #f "op"))) (jolt-invoke invoke) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke invoke) jolt-nil))))))))))))))))))) emit-invoke)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-try" (letrec ((emit-try (lambda (node) (let fnrec6559 ((node node)) (let* ((core (let* ((temp__16__auto (jolt-get node (keyword #f "catch-sym")))) (if (jolt-truthy? temp__16__auto) (let* ((cs temp__16__auto)) (let* ((_a$6560 (var-deref "clojure.core" "str")) (_a$6561 "(guard (") (_a$6562 (jolt-invoke (var-deref "jolt.backend-scheme" "munge-name") cs)) (_a$6563 " (else ") (_a$6564 (jolt-invoke (var-deref "jolt.backend-scheme" "emit") (jolt-get node (keyword #f "catch-body")))) (_a$6565 ")) ") (_a$6566 (jolt-invoke (var-deref "jolt.backend-scheme" "emit") (jolt-get node (keyword #f "body")))) (_a$6567 ")")) (jolt-invoke _a$6560 _a$6561 _a$6562 _a$6563 _a$6564 _a$6565 _a$6566 _a$6567))) (jolt-invoke (var-deref "jolt.backend-scheme" "emit") (jolt-get node (keyword #f "body"))))))) (let* ((temp__16__auto (jolt-get node (keyword #f "finally")))) (if (jolt-truthy? temp__16__auto) (let* ((fin temp__16__auto)) (jolt-invoke (var-deref "clojure.core" "str") "(dynamic-wind (lambda () #f) (lambda () " core ") (lambda () " (jolt-invoke (var-deref "jolt.backend-scheme" "emit") fin) "))")) core))))))) emit-try)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "returns-scheme-bool?" (letrec ((returns-scheme-bool? (lambda (node) (let fnrec6568 ((node node)) (if (jolt-truthy? (let* ((and__25__auto (jolt= (keyword #f "const") (jolt-get node (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "boolean?") (jolt-get node (keyword #f "val"))) and__25__auto))) #t (if (jolt= (keyword #f "invoke") (jolt-get node (keyword #f "op"))) (let* ((nop (let* ((_a$6569 (var-deref "jolt.backend-scheme" "native-op")) (_a$6570 (jolt-get node (keyword #f "fn"))) (_a$6571 (jolt-count (jolt-get node (keyword #f "args"))))) (jolt-invoke _a$6569 _a$6570 _a$6571)))) (if (jolt-truthy? (let* ((and__25__auto nop)) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.backend-scheme" "bool-returning-ops") nop) and__25__auto))) #t #f)) (if (jolt-truthy? (keyword #f "else")) #f jolt-nil))))))) returns-scheme-bool?)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit" (letrec ((emit (lambda (node) (let fnrec6572 ((node node)) (let* ((G__129 (jolt-get node (keyword #f "op")))) (if (jolt= G__129 (keyword #f "const")) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-const") (jolt-get node (keyword #f "val"))) (if (jolt= G__129 (keyword #f "local")) (jolt-invoke (var-deref "jolt.backend-scheme" "munge-name") (jolt-get node (keyword #f "name"))) (if (jolt= G__129 (keyword #f "var")) (let* ((core-proc (let* ((and__25__auto (jolt= "clojure.core" (jolt-get node (keyword #f "ns"))))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.backend-scheme" "core-value-procs") (jolt-get node (keyword #f "name"))) and__25__auto)))) (if (jolt-truthy? core-proc) core-proc (if (jolt-truthy? (let* ((_a$6573 (var-deref "jolt.backend-scheme" "direct-linkable?")) (_a$6574 (jolt-get node (keyword #f "ns"))) (_a$6575 (jolt-get node (keyword #f "name")))) (jolt-invoke _a$6573 _a$6574 _a$6575))) (let* ((_a$6576 (var-deref "jolt.backend-scheme" "dl-name")) (_a$6577 (jolt-get node (keyword #f "ns"))) (_a$6578 (jolt-get node (keyword #f "name")))) (jolt-invoke _a$6576 _a$6577 _a$6578)) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.backend-scheme" "stdlib-var?") node))) (if (jolt-truthy? and__25__auto) (jolt-not (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.backend-scheme" "prelude-mode?"))) and__25__auto))) (jolt-throw (let* ((_a$6585 (let* ((_a$6579 (var-deref "clojure.core" "str")) (_a$6580 "emit: unsupported stdlib ref `") (_a$6581 (jolt-get node (keyword #f "ns"))) (_a$6582 "/") (_a$6583 (jolt-get node (keyword #f "name"))) (_a$6584 "` (no core on Chez yet)")) (jolt-invoke _a$6579 _a$6580 _a$6581 _a$6582 _a$6583 _a$6584))) (_a$6586 (jolt-hash-map))) (jolt-ex-info _a$6585 _a$6586))) (if (jolt-truthy? (keyword #f "else")) (let* ((_a$6587 (var-deref "clojure.core" "str")) (_a$6588 "(var-deref ") (_a$6589 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "ns")))) (_a$6590 " ") (_a$6591 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "name")))) (_a$6592 ")")) (jolt-invoke _a$6587 _a$6588 _a$6589 _a$6590 _a$6591 _a$6592)) jolt-nil))))) (if (jolt= G__129 (keyword #f "the-var")) (let* ((_a$6593 (var-deref "clojure.core" "str")) (_a$6594 "(jolt-var ") (_a$6595 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "ns")))) (_a$6596 " ") (_a$6597 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "name")))) (_a$6598 ")")) (jolt-invoke _a$6593 _a$6594 _a$6595 _a$6596 _a$6597 _a$6598)) (if (jolt= G__129 (keyword #f "set-var")) (let* ((_a$6599 (var-deref "clojure.core" "str")) (_a$6600 "(jolt-var-set ") (_a$6601 (jolt-invoke emit (jolt-get node (keyword #f "the-var")))) (_a$6602 " ") (_a$6603 (jolt-invoke emit (jolt-get node (keyword #f "val")))) (_a$6604 ")")) (jolt-invoke _a$6599 _a$6600 _a$6601 _a$6602 _a$6603 _a$6604)) (if (jolt= G__129 (keyword #f "set-field")) (let* ((_a$6605 (var-deref "clojure.core" "str")) (_a$6606 "(jolt-set-field! ") (_a$6607 (jolt-invoke emit (jolt-get node (keyword #f "obj")))) (_a$6608 " (keyword #f ") (_a$6609 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "field")))) (_a$6610 ") ") (_a$6611 (jolt-invoke emit (jolt-get node (keyword #f "val")))) (_a$6612 ")")) (jolt-invoke _a$6605 _a$6606 _a$6607 _a$6608 _a$6609 _a$6610 _a$6611 _a$6612)) (if (jolt= G__129 (keyword #f "defmacro")) (let* ((_a$6613 (var-deref "clojure.core" "str")) (_a$6614 "(begin (def-var! ") (_a$6615 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "ns")))) (_a$6616 " ") (_a$6617 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "name")))) (_a$6618 " ") (_a$6619 (jolt-invoke emit (jolt-get node (keyword #f "fn")))) (_a$6620 ") (mark-macro! ") (_a$6621 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "ns")))) (_a$6622 " ") (_a$6623 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "name")))) (_a$6624 ") jolt-nil)")) (jolt-invoke _a$6613 _a$6614 _a$6615 _a$6616 _a$6617 _a$6618 _a$6619 _a$6620 _a$6621 _a$6622 _a$6623 _a$6624)) (if (jolt= G__129 (keyword #f "host")) (jolt-throw (let* ((_a$6625 (jolt-invoke (var-deref "clojure.core" "str") "emit: unsupported host ref `" (jolt-get node (keyword #f "name")) "`")) (_a$6626 (jolt-hash-map))) (jolt-ex-info _a$6625 _a$6626))) (if (jolt= G__129 (keyword #f "host-static")) (let* ((_a$6627 (var-deref "clojure.core" "str")) (_a$6628 "(host-static-ref ") (_a$6629 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "class")))) (_a$6630 " ") (_a$6631 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "member")))) (_a$6632 ")")) (jolt-invoke _a$6627 _a$6628 _a$6629 _a$6630 _a$6631 _a$6632)) (if (jolt= G__129 (keyword #f "host-new")) (let* ((_a$6633 (var-deref "clojure.core" "str")) (_a$6634 "(host-new ") (_a$6635 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "class")))) (_a$6636 (let* ((args (jolt-map emit (jolt-get node (keyword #f "args"))))) (if (jolt-empty? args) "" (jolt-invoke (var-deref "clojure.core" "str") " " (jolt-invoke (var-deref "clojure.string" "join") " " args))))) (_a$6637 ")")) (jolt-invoke _a$6633 _a$6634 _a$6635 _a$6636 _a$6637)) (if (jolt= G__129 (keyword #f "if")) (let* ((test (jolt-get node (keyword #f "test"))) (t (if (jolt-truthy? (jolt-invoke (var-deref "jolt.backend-scheme" "returns-scheme-bool?") test)) (jolt-invoke emit test) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-truthy? " (jolt-invoke emit test) ")")))) (let* ((_a$6638 (var-deref "clojure.core" "str")) (_a$6639 "(if ") (_a$6640 t) (_a$6641 " ") (_a$6642 (jolt-invoke emit (jolt-get node (keyword #f "then")))) (_a$6643 " ") (_a$6644 (jolt-invoke emit (jolt-get node (keyword #f "else")))) (_a$6645 ")")) (jolt-invoke _a$6638 _a$6639 _a$6640 _a$6641 _a$6642 _a$6643 _a$6644 _a$6645))) (if (jolt= G__129 (keyword #f "do")) (let* ((_a$6646 (var-deref "clojure.core" "str")) (_a$6647 "(begin ") (_a$6648 (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-map emit (jolt-get node (keyword #f "statements"))))) (_a$6649 (if (jolt-empty? (jolt-get node (keyword #f "statements"))) "" " ")) (_a$6650 (jolt-invoke emit (jolt-get node (keyword #f "ret")))) (_a$6651 ")")) (jolt-invoke _a$6646 _a$6647 _a$6648 _a$6649 _a$6650 _a$6651)) (if (jolt= G__129 (keyword #f "invoke")) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-invoke") node) (if (jolt= G__129 (keyword #f "vector")) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-ordered") "jolt-vector" (jolt-map emit (jolt-get node (keyword #f "items")))) (if (jolt= G__129 (keyword #f "set")) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-ordered") "jolt-hash-set" (jolt-map emit (jolt-get node (keyword #f "items")))) (if (jolt= G__129 (keyword #f "map")) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-ordered") "jolt-hash-map" (let* ((_a$6655 (var-deref "clojure.core" "mapcat")) (_a$6656 (lambda (p) (let fnrec6652 ((p p)) (let* ((_o$6653 (jolt-invoke emit (jolt-nth p 0))) (_o$6654 (jolt-invoke emit (jolt-nth p 1)))) (jolt-vector _o$6653 _o$6654))))) (_a$6657 (jolt-get node (keyword #f "pairs")))) (jolt-invoke _a$6655 _a$6656 _a$6657))) (if (jolt= G__129 (keyword #f "quote")) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-quoted") (jolt-get node (keyword #f "form"))) (if (jolt= G__129 (keyword #f "throw")) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-throw " (jolt-invoke emit (jolt-get node (keyword #f "expr"))) ")") (if (jolt= G__129 (keyword #f "coerce")) (let* ((e (jolt-invoke emit (jolt-get node (keyword #f "expr"))))) (if (jolt= (keyword #f "double") (jolt-get node (keyword #f "kind"))) (jolt-invoke (var-deref "clojure.core" "str") "(exact->inexact " e ")") (if (jolt= (keyword #f "long") (jolt-get node (keyword #f "kind"))) (jolt-invoke (var-deref "clojure.core" "str") "(jolt->fx " e ")") (if (jolt-truthy? (keyword #f "else")) e jolt-nil)))) (if (jolt= G__129 (keyword #f "try")) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-try") node) (if (jolt= G__129 (keyword #f "regex")) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-regex " (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "source"))) ")") (if (jolt= G__129 (keyword #f "inst")) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-inst-from-string " (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "source"))) ")") (if (jolt= G__129 (keyword #f "uuid")) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-uuid-from-string " (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "source"))) ")") (if (jolt= G__129 (keyword #f "bigdec")) (jolt-invoke (var-deref "clojure.core" "str") "(jolt-bigdec-from-string " (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "source"))) ")") (if (jolt= G__129 (keyword #f "the-ns")) (jolt-invoke (var-deref "clojure.core" "str") "(intern-ns! " (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "name"))) ")") (if (jolt= G__129 (keyword #f "host-call")) (let* ((m (jolt-get node (keyword #f "method"))) (target (jolt-invoke emit (jolt-get node (keyword #f "target")))) (args (jolt-map emit (jolt-get node (keyword #f "args"))))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.backend-scheme" "supported-host-methods") m)) (let* ((_a$6658 (var-deref "clojure.core" "str")) (_a$6659 "(jolt-host-call ") (_a$6660 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") m)) (_a$6661 " ") (_a$6662 target) (_a$6663 (if (jolt-empty? args) "" (jolt-invoke (var-deref "clojure.core" "str") " " (jolt-invoke (var-deref "clojure.string" "join") " " args)))) (_a$6664 ")")) (jolt-invoke _a$6658 _a$6659 _a$6660 _a$6661 _a$6662 _a$6663 _a$6664)) (let* ((_a$6665 (var-deref "clojure.core" "str")) (_a$6666 "(record-method-dispatch ") (_a$6667 target) (_a$6668 " ") (_a$6669 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") m)) (_a$6670 " (jolt-vector") (_a$6671 (if (jolt-empty? args) "" (jolt-invoke (var-deref "clojure.core" "str") " " (jolt-invoke (var-deref "clojure.string" "join") " " args)))) (_a$6672 "))")) (jolt-invoke _a$6665 _a$6666 _a$6667 _a$6668 _a$6669 _a$6670 _a$6671 _a$6672)))) (if (jolt= G__129 (keyword #f "let")) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-let") node) (if (jolt= G__129 (keyword #f "loop")) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-loop") node) (if (jolt= G__129 (keyword #f "recur")) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-recur") node) (if (jolt= G__129 (keyword #f "ffi-fn")) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-ffi-fn") node) (if (jolt= G__129 (keyword #f "ffi-callable")) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-ffi-callable") node) (if (jolt= G__129 (keyword #f "fn")) (jolt-invoke (var-deref "jolt.backend-scheme" "emit-fn") node) (if (jolt= G__129 (keyword #f "def")) (if (jolt-truthy? (jolt-get node (keyword #f "no-init"))) (let* ((_a$6673 (var-deref "clojure.core" "str")) (_a$6674 "(declare-var! ") (_a$6675 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "ns")))) (_a$6676 " ") (_a$6677 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "name")))) (_a$6678 ")")) (jolt-invoke _a$6673 _a$6674 _a$6675 _a$6676 _a$6677 _a$6678)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.backend-scheme" "jmeta-nonempty?") (jolt-get node (keyword #f "meta")))) (let* ((_a$6679 (var-deref "clojure.core" "str")) (_a$6680 "(def-var-with-meta! ") (_a$6681 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "ns")))) (_a$6682 " ") (_a$6683 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "name")))) (_a$6684 " ") (_a$6685 (jolt-invoke emit (jolt-get node (keyword #f "init")))) (_a$6686 " ") (_a$6687 (jolt-invoke (var-deref "jolt.backend-scheme" "emit-quoted") (jolt-get node (keyword #f "meta")))) (_a$6688 ")")) (jolt-invoke _a$6679 _a$6680 _a$6681 _a$6682 _a$6683 _a$6684 _a$6685 _a$6686 _a$6687 _a$6688)) (if (jolt-truthy? (keyword #f "else")) (let* ((_a$6689 (var-deref "clojure.core" "str")) (_a$6690 "(def-var! ") (_a$6691 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "ns")))) (_a$6692 " ") (_a$6693 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") (jolt-get node (keyword #f "name")))) (_a$6694 " ") (_a$6695 (jolt-invoke emit (jolt-get node (keyword #f "init")))) (_a$6696 ")")) (jolt-invoke _a$6689 _a$6690 _a$6691 _a$6692 _a$6693 _a$6694 _a$6695 _a$6696)) jolt-nil))) (jolt-throw (let* ((_a$6697 (jolt-invoke (var-deref "clojure.core" "str") "emit: op not yet ported / unhandled: " (jolt-invoke (var-deref "clojure.core" "pr-str") (jolt-get node (keyword #f "op"))))) (_a$6698 (jolt-hash-map))) (jolt-ex-info _a$6697 _a$6698))))))))))))))))))))))))))))))))))))))))) emit)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "dl-opt-out?" (letrec ((dl-opt-out? (lambda (m) (let fnrec6699 ((m m)) (let* ((or__26__auto (jolt-get m (keyword #f "dynamic")))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-get m (keyword #f "redef")))))))) dl-opt-out?)))
(guard (e (#t #f))
  (def-var! "jolt.backend-scheme" "emit-top-form" (letrec ((emit-top-form (lambda (node) (let fnrec6700 ((node node)) (if (jolt-not (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.backend-scheme" "direct-link?"))) (jolt-invoke (var-deref "jolt.backend-scheme" "emit") node) (if (jolt= (keyword #f "do") (jolt-get node (keyword #f "op"))) (let* ((_a$6701 (var-deref "clojure.core" "str")) (_a$6702 "(begin ") (_a$6703 (jolt-invoke (var-deref "clojure.string" "join") " " (jolt-map emit-top-form (jolt-get node (keyword #f "statements"))))) (_a$6704 (if (jolt-empty? (jolt-get node (keyword #f "statements"))) "" " ")) (_a$6705 (jolt-invoke emit-top-form (jolt-get node (keyword #f "ret")))) (_a$6706 ")")) (jolt-invoke _a$6701 _a$6702 _a$6703 _a$6704 _a$6705 _a$6706)) (if (jolt-truthy? (let* ((and__25__auto (jolt= (keyword #f "def") (jolt-get node (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-not (jolt-get node (keyword #f "no-init"))))) (if (jolt-truthy? and__25__auto) (jolt-not (jolt-invoke (var-deref "jolt.backend-scheme" "dl-opt-out?") (jolt-get node (keyword #f "meta")))) and__25__auto)) and__25__auto))) (let* ((ns (jolt-get node (keyword #f "ns"))) (nm (jolt-get node (keyword #f "name"))) (b (jolt-invoke (var-deref "jolt.backend-scheme" "dl-name") ns nm))) (begin (jolt-invoke (var-deref "clojure.core" "swap!") (var-deref "jolt.backend-scheme" "direct-link-defined") jolt-conj (jolt-invoke (var-deref "jolt.backend-scheme" "dl-fqn") ns nm)) (if (jolt= (keyword #f "fn") (jolt-get (jolt-get node (keyword #f "init")) (keyword #f "op"))) (jolt-invoke (var-deref "clojure.core" "swap!") (var-deref "jolt.backend-scheme" "direct-link-fns") jolt-conj (jolt-invoke (var-deref "jolt.backend-scheme" "dl-fqn") ns nm)) jolt-nil) (let* ((init (jolt-invoke (var-deref "jolt.backend-scheme" "emit") (jolt-get node (keyword #f "init"))))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.backend-scheme" "jmeta-nonempty?") (jolt-get node (keyword #f "meta")))) (let* ((_a$6707 (var-deref "clojure.core" "str")) (_a$6708 "(begin (define ") (_a$6709 b) (_a$6710 " ") (_a$6711 init) (_a$6712 ") (def-var-with-meta! ") (_a$6713 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") ns)) (_a$6714 " ") (_a$6715 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") nm)) (_a$6716 " ") (_a$6717 b) (_a$6718 " ") (_a$6719 (jolt-invoke (var-deref "jolt.backend-scheme" "emit-quoted") (jolt-get node (keyword #f "meta")))) (_a$6720 "))")) (jolt-invoke _a$6707 _a$6708 _a$6709 _a$6710 _a$6711 _a$6712 _a$6713 _a$6714 _a$6715 _a$6716 _a$6717 _a$6718 _a$6719 _a$6720)) (let* ((_a$6721 (var-deref "clojure.core" "str")) (_a$6722 "(begin (define ") (_a$6723 b) (_a$6724 " ") (_a$6725 init) (_a$6726 ") (def-var! ") (_a$6727 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") ns)) (_a$6728 " ") (_a$6729 (jolt-invoke (var-deref "jolt.backend-scheme" "chez-str-lit") nm)) (_a$6730 " ") (_a$6731 b) (_a$6732 "))")) (jolt-invoke _a$6721 _a$6722 _a$6723 _a$6724 _a$6725 _a$6726 _a$6727 _a$6728 _a$6729 _a$6730 _a$6731 _a$6732)))))) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "jolt.backend-scheme" "emit") node) jolt-nil)))))))) emit-top-form)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.fold" "foldable" (let* ((_o$6733 "+") (_o$6734 jolt-add) (_o$6735 "-") (_o$6736 jolt-sub) (_o$6737 "*") (_o$6738 jolt-mul) (_o$6739 "/") (_o$6740 jolt-div) (_o$6741 "<") (_o$6742 <) (_o$6743 ">") (_o$6744 >) (_o$6745 "<=") (_o$6746 <=) (_o$6747 ">=") (_o$6748 >=) (_o$6749 "=") (_o$6750 jolt=) (_o$6751 "inc") (_o$6752 jolt-inc) (_o$6753 "dec") (_o$6754 jolt-dec) (_o$6755 "mod") (_o$6756 modulo) (_o$6757 "rem") (_o$6758 remainder) (_o$6759 "quot") (_o$6760 quotient) (_o$6761 "bit-and") (_o$6762 (var-deref "clojure.core" "__bit-and")) (_o$6763 "bit-or") (_o$6764 (var-deref "clojure.core" "__bit-or")) (_o$6765 "bit-xor") (_o$6766 (var-deref "clojure.core" "__bit-xor"))) (jolt-hash-map _o$6733 _o$6734 _o$6735 _o$6736 _o$6737 _o$6738 _o$6739 _o$6740 _o$6741 _o$6742 _o$6743 _o$6744 _o$6745 _o$6746 _o$6747 _o$6748 _o$6749 _o$6750 _o$6751 _o$6752 _o$6753 _o$6754 _o$6755 _o$6756 _o$6757 _o$6758 _o$6759 _o$6760 _o$6761 _o$6762 _o$6763 _o$6764 _o$6765 _o$6766)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.passes.fold" "const?" (letrec ((const? (lambda (n) (let fnrec6767 ((n n)) (jolt= (keyword #f "const") (jolt-get n (keyword #f "op"))))))) const?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.fold" "const-num?" (letrec ((const-num? (lambda (n) (let fnrec6768 ((n n)) (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.fold" "const?") n))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "number?") (jolt-get n (keyword #f "val"))) and__25__auto)))))) const-num?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.fold" "fold-fn" (letrec ((fold-fn (lambda (fnode) (let fnrec6769 ((fnode fnode)) (let* ((op (jolt-get fnode (keyword #f "op")))) (if (jolt-truthy? (let* ((or__26__auto (let* ((and__25__auto (jolt= op (keyword #f "var")))) (if (jolt-truthy? and__25__auto) (jolt= "clojure.core" (jolt-get fnode (keyword #f "ns"))) and__25__auto)))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= op (keyword #f "host"))))) (jolt-get (var-deref "jolt.passes.fold" "foldable") (jolt-get fnode (keyword #f "name"))) jolt-nil)))))) fold-fn)))
(guard (e (#t #f))
  (def-var! "jolt.passes.fold" "const-fold" (letrec ((const-fold (lambda (node) (let fnrec6770 ((node node)) (let* ((op (jolt-get node (keyword #f "op")))) (if (jolt= op (keyword #f "invoke")) (let* ((n (jolt-invoke (var-deref "jolt.ir" "map-ir-children") const-fold node)) (ff (jolt-invoke (var-deref "jolt.passes.fold" "fold-fn") (jolt-get n (keyword #f "fn")))) (args (jolt-get n (keyword #f "args"))) (folded (if (jolt-truthy? (let* ((and__25__auto ff)) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-pos? (jolt-count args)))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "every?") (var-deref "jolt.passes.fold" "const-num?") args) and__25__auto)) and__25__auto))) (guard (e (else jolt-nil)) (let* ((_o$6772 (keyword #f "op")) (_o$6773 (keyword #f "const")) (_o$6774 (keyword #f "val")) (_o$6775 (jolt-apply ff (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (a) (let fnrec6771 ((a a)) (jolt-get a (keyword #f "val")))) args)))) (jolt-hash-map _o$6772 _o$6773 _o$6774 _o$6775))) jolt-nil))) (let* ((or__26__auto folded)) (if (jolt-truthy? or__26__auto) or__26__auto n))) (if (jolt= op (keyword #f "if")) (let* ((t (jolt-invoke const-fold (jolt-get node (keyword #f "test"))))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.fold" "const?") t)) (if (jolt-truthy? (let* ((or__26__auto (jolt-invoke (var-deref "clojure.core" "nil?") (jolt-get t (keyword #f "val"))))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= #f (jolt-get t (keyword #f "val")))))) (jolt-invoke const-fold (jolt-get node (keyword #f "else"))) (jolt-invoke const-fold (jolt-get node (keyword #f "then")))) (let* ((_a$6776 node) (_a$6777 (keyword #f "test")) (_a$6778 t) (_a$6779 (keyword #f "then")) (_a$6780 (jolt-invoke const-fold (jolt-get node (keyword #f "then")))) (_a$6781 (keyword #f "else")) (_a$6782 (jolt-invoke const-fold (jolt-get node (keyword #f "else"))))) (jolt-assoc _a$6776 _a$6777 _a$6778 _a$6779 _a$6780 _a$6781 _a$6782)))) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "jolt.ir" "map-ir-children") const-fold node) jolt-nil)))))))) const-fold)))
(guard (e (#t #f))
  (def-var! "jolt.passes.fold" "scalar-const?" (letrec ((scalar-const? (lambda (n) (let fnrec6783 ((n n)) (let* ((and__25__auto (jolt= (keyword #f "const") (jolt-get n (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (let* ((v (jolt-get n (keyword #f "val")))) (let* ((or__26__auto (jolt-invoke (var-deref "clojure.core" "keyword?") v))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt-invoke (var-deref "clojure.core" "string?") v))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt-invoke (var-deref "clojure.core" "number?") v))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-invoke (var-deref "clojure.core" "boolean?") v)))))))) and__25__auto)))))) scalar-const?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.fold" "kw-callee?" (letrec ((kw-callee? (lambda (fnode) (let fnrec6784 ((fnode fnode)) (let* ((and__25__auto (jolt= (keyword #f "const") (jolt-get fnode (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "keyword?") (jolt-get fnode (keyword #f "val"))) and__25__auto)))))) kw-callee?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.fold" "get-callee?" (letrec ((get-callee? (lambda (fnode) (let fnrec6785 ((fnode fnode)) (let* ((or__26__auto (let* ((and__25__auto (jolt= (keyword #f "var") (jolt-get fnode (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= "clojure.core" (jolt-get fnode (keyword #f "ns"))))) (if (jolt-truthy? and__25__auto) (jolt= "get" (jolt-get fnode (keyword #f "name"))) and__25__auto)) and__25__auto)))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((and__25__auto (jolt= (keyword #f "host") (jolt-get fnode (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (jolt= "get" (jolt-get fnode (keyword #f "name"))) and__25__auto)))))))) get-callee?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.numeric" "int-lit?" (letrec ((int-lit? (lambda (n) (let fnrec5552 ((n n)) (let* ((and__25__auto (jolt= (keyword #f "const") (jolt-get n (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (let* ((v (jolt-get n (keyword #f "val")))) (let* ((and__25__auto (jolt-invoke (var-deref "clojure.core" "number?") v))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "integer?") v) and__25__auto))) and__25__auto)))))) int-lit?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.numeric" "float-lit?" (letrec ((float-lit? (lambda (n) (let fnrec5553 ((n n)) (let* ((and__25__auto (jolt= (keyword #f "const") (jolt-get n (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (let* ((v (jolt-get n (keyword #f "val")))) (let* ((and__25__auto (jolt-invoke (var-deref "clojure.core" "number?") v))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "float?") v) and__25__auto))) and__25__auto)))))) float-lit?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.numeric" "dbl-spec" (letrec ((dbl-spec (lambda (nm n) (let fnrec5554 ((nm nm) (n n)) (if (jolt-truthy? (let* ((and__25__auto (>= n 1))) (if (jolt-truthy? and__25__auto) (jolt-contains? (let* ((_o$5555 "+") (_o$5556 "-") (_o$5557 "*") (_o$5558 "/") (_o$5559 "min") (_o$5560 "max")) (jolt-hash-set _o$5555 _o$5556 _o$5557 _o$5558 _o$5559 _o$5560)) nm) and__25__auto))) (keyword #f "double") (if (jolt-truthy? (let* ((and__25__auto (jolt= n 1))) (if (jolt-truthy? and__25__auto) (jolt-contains? (let* ((_o$5561 "inc") (_o$5562 "dec")) (jolt-hash-set _o$5561 _o$5562)) nm) and__25__auto))) (keyword #f "double") (if (jolt-truthy? (let* ((and__25__auto (>= n 2))) (if (jolt-truthy? and__25__auto) (jolt-contains? (let* ((_o$5563 "<") (_o$5564 ">") (_o$5565 "<=") (_o$5566 ">=") (_o$5567 "=") (_o$5568 "==")) (jolt-hash-set _o$5563 _o$5564 _o$5565 _o$5566 _o$5567 _o$5568)) nm) and__25__auto))) (keyword #f "bool") (if (jolt-truthy? (keyword #f "else")) jolt-nil jolt-nil)))))))) dbl-spec)))
(guard (e (#t #f))
  (def-var! "jolt.passes.numeric" "lng-spec" (letrec ((lng-spec (lambda (nm n) (let fnrec5569 ((nm nm) (n n)) (if (jolt-truthy? (let* ((and__25__auto (>= n 1))) (if (jolt-truthy? and__25__auto) (jolt-contains? (let* ((_o$5570 "+") (_o$5571 "-") (_o$5572 "*") (_o$5573 "min") (_o$5574 "max") (_o$5575 "unchecked-add") (_o$5576 "unchecked-subtract") (_o$5577 "unchecked-multiply")) (jolt-hash-set _o$5570 _o$5571 _o$5572 _o$5573 _o$5574 _o$5575 _o$5576 _o$5577)) nm) and__25__auto))) (keyword #f "long") (if (jolt-truthy? (let* ((and__25__auto (jolt= n 1))) (if (jolt-truthy? and__25__auto) (jolt-contains? (let* ((_o$5578 "inc") (_o$5579 "dec") (_o$5580 "unchecked-inc") (_o$5581 "unchecked-dec")) (jolt-hash-set _o$5578 _o$5579 _o$5580 _o$5581)) nm) and__25__auto))) (keyword #f "long") (if (jolt-truthy? (let* ((and__25__auto (jolt= n 2))) (if (jolt-truthy? and__25__auto) (jolt-contains? (let* ((_o$5582 "quot") (_o$5583 "rem") (_o$5584 "mod")) (jolt-hash-set _o$5582 _o$5583 _o$5584)) nm) and__25__auto))) (keyword #f "long") (if (jolt-truthy? (let* ((and__25__auto (>= n 2))) (if (jolt-truthy? and__25__auto) (jolt-contains? (let* ((_o$5585 "<") (_o$5586 ">") (_o$5587 "<=") (_o$5588 ">=") (_o$5589 "=") (_o$5590 "==")) (jolt-hash-set _o$5585 _o$5586 _o$5587 _o$5588 _o$5589 _o$5590)) nm) and__25__auto))) (keyword #f "bool") (if (jolt-truthy? (keyword #f "else")) jolt-nil jolt-nil))))))))) lng-spec)))
(guard (e (#t #f))
  (def-var! "jolt.passes.numeric" "propagate" (letrec ((propagate (lambda (spec) (let fnrec5591 ((spec spec)) (if (jolt= spec (keyword #f "bool")) jolt-nil spec))))) propagate)))
(guard (e (#t #f))
  (declare-var! "jolt.passes.numeric" "an"))
(guard (e (#t #f))
  (def-var! "jolt.passes.numeric" "recur-kinds" (letrec ((recur-kinds (lambda (node tenv) (let fnrec5592 ((node node) (tenv tenv)) (let* ((op (jolt-get node (keyword #f "op")))) (if (jolt= op (keyword #f "recur")) (jolt-vector (let* ((_a$5594 (var-deref "clojure.core" "mapv")) (_a$5595 (lambda (a) (let fnrec5593 ((a a)) (jolt-nth (jolt-invoke (var-deref "jolt.passes.numeric" "an") a tenv) 0)))) (_a$5596 (jolt-get node (keyword #f "args")))) (jolt-invoke _a$5594 _a$5595 _a$5596))) (if (jolt= op (keyword #f "let")) (let* ((_a$5604 recur-kinds) (_a$5605 (jolt-get node (keyword #f "body"))) (_a$5606 (let* ((_a$5601 (lambda (te b) (let fnrec5597 ((te te) (b b)) (let* ((_a$5598 te) (_a$5599 (jolt-nth b 0)) (_a$5600 (jolt-nth (jolt-invoke (var-deref "jolt.passes.numeric" "an") (jolt-nth b 1) te) 0))) (jolt-assoc _a$5598 _a$5599 _a$5600))))) (_a$5602 tenv) (_a$5603 (jolt-get node (keyword #f "bindings")))) (jolt-reduce _a$5601 _a$5602 _a$5603)))) (jolt-invoke _a$5604 _a$5605 _a$5606)) (if (jolt= op (keyword #f "if")) (let* ((_a$5607 (jolt-invoke recur-kinds (jolt-get node (keyword #f "then")) tenv)) (_a$5608 (jolt-invoke recur-kinds (jolt-get node (keyword #f "else")) tenv))) (jolt-concat _a$5607 _a$5608)) (if (jolt= op (keyword #f "do")) (jolt-invoke recur-kinds (jolt-get node (keyword #f "ret")) tenv) (if (jolt-truthy? (keyword #f "else")) (jolt-vector) jolt-nil)))))))))) recur-kinds)))
(guard (e (#t #f))
  (def-var! "jolt.passes.numeric" "recur-arg-lists" (letrec ((recur-arg-lists (lambda (node) (let fnrec5609 ((node node)) (let* ((op (jolt-get node (keyword #f "op")))) (if (jolt= op (keyword #f "recur")) (jolt-vector (jolt-get node (keyword #f "args"))) (if (jolt= op (keyword #f "let")) (jolt-invoke recur-arg-lists (jolt-get node (keyword #f "body"))) (if (jolt= op (keyword #f "if")) (let* ((_a$5610 (jolt-invoke recur-arg-lists (jolt-get node (keyword #f "then")))) (_a$5611 (jolt-invoke recur-arg-lists (jolt-get node (keyword #f "else"))))) (jolt-concat _a$5610 _a$5611)) (if (jolt= op (keyword #f "do")) (jolt-invoke recur-arg-lists (jolt-get node (keyword #f "ret"))) (if (jolt-truthy? (keyword #f "else")) (jolt-vector) jolt-nil)))))))))) recur-arg-lists)))
(guard (e (#t #f))
  (def-var! "jolt.passes.numeric" "counter-step?" (letrec ((counter-step? (lambda (arg vname) (let fnrec5612 ((arg arg) (vname vname)) (if (jolt-truthy? (let* ((and__25__auto (jolt= (keyword #f "local") (jolt-get arg (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (jolt= vname (jolt-get arg (keyword #f "name"))) and__25__auto))) #t (if (jolt= (keyword #f "invoke") (jolt-get arg (keyword #f "op"))) (let* ((f (jolt-get arg (keyword #f "fn"))) (as (jolt-get arg (keyword #f "args")))) (let* ((and__25__auto (jolt= (keyword #f "var") (jolt-get f (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= "clojure.core" (jolt-get f (keyword #f "ns"))))) (if (jolt-truthy? and__25__auto) (let* ((nm (jolt-get f (keyword #f "name"))) (v? (lambda (n) (let fnrec5613 ((n n)) (let* ((and__25__auto (jolt= (keyword #f "local") (jolt-get n (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (jolt= vname (jolt-get n (keyword #f "name"))) and__25__auto)))))) (if (jolt-truthy? (let* ((and__25__auto (jolt-contains? (let* ((_o$5614 "inc") (_o$5615 "dec") (_o$5616 "unchecked-inc") (_o$5617 "unchecked-dec")) (jolt-hash-set _o$5614 _o$5615 _o$5616 _o$5617)) nm))) (if (jolt-truthy? and__25__auto) (jolt= 1 (jolt-count as)) and__25__auto))) (jolt-invoke v? (jolt-nth as 0)) (if (jolt-truthy? (let* ((and__25__auto (jolt-contains? (let* ((_o$5618 "+") (_o$5619 "unchecked-add")) (jolt-hash-set _o$5618 _o$5619)) nm))) (if (jolt-truthy? and__25__auto) (jolt= 2 (jolt-count as)) and__25__auto))) (let* ((or__26__auto (let* ((and__25__auto (jolt-invoke v? (jolt-nth as 0)))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.numeric" "int-lit?") (jolt-nth as 1)) and__25__auto)))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((and__25__auto (jolt-invoke v? (jolt-nth as 1)))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.numeric" "int-lit?") (jolt-nth as 0)) and__25__auto)))) (if (jolt-truthy? (let* ((and__25__auto (jolt-contains? (let* ((_o$5620 "-") (_o$5621 "unchecked-subtract")) (jolt-hash-set _o$5620 _o$5621)) nm))) (if (jolt-truthy? and__25__auto) (jolt= 2 (jolt-count as)) and__25__auto))) (let* ((and__25__auto (jolt-invoke v? (jolt-nth as 0)))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.numeric" "int-lit?") (jolt-nth as 1)) and__25__auto)) (if (jolt-truthy? (keyword #f "else")) #f jolt-nil))))) and__25__auto)) and__25__auto))) (if (jolt-truthy? (keyword #f "else")) #f jolt-nil))))))) counter-step?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.numeric" "loop-kinds" (letrec ((loop-kinds (lambda (names seed body tenv) (let fnrec5622 ((names names) (seed seed) (body body) (tenv tenv)) (let* ((cur seed) (iter 0)) (let loop5623 ((cur cur) (iter iter)) (if (> iter (jolt-count names)) cur (let* ((te (let* ((_a$5628 (lambda (t i) (let fnrec5624 ((t t) (i i)) (let* ((_a$5625 t) (_a$5626 (jolt-nth names i)) (_a$5627 (jolt-nth cur i))) (jolt-assoc _a$5625 _a$5626 _a$5627))))) (_a$5629 tenv) (_a$5630 (jolt-range (jolt-count names)))) (jolt-reduce _a$5628 _a$5629 _a$5630))) (rks (jolt-invoke (var-deref "jolt.passes.numeric" "recur-kinds") body te)) (nxt (let* ((_a$5633 (var-deref "clojure.core" "mapv")) (_a$5634 (lambda (j) (let fnrec5631 ((j j)) (let* ((k (jolt-nth cur j))) (if (jolt-truthy? (let* ((and__25__auto k)) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "every?") (lambda (rk) (let fnrec5632 ((rk rk)) (jolt= k (jolt-nth rk j)))) rks) and__25__auto))) k jolt-nil))))) (_a$5635 (jolt-range (jolt-count names)))) (jolt-invoke _a$5633 _a$5634 _a$5635)))) (if (jolt= nxt cur) cur (loop5623 nxt (jolt-inc iter))))))))))) loop-kinds)))
(guard (e (#t #f))
  (def-var! "jolt.passes.numeric" "arity-env" (letrec ((arity-env (lambda (tenv a) (let fnrec5636 ((tenv tenv) (a a)) (let* ((nh (let* ((_a$5637 (jolt-hash-map)) (_a$5638 (jolt-get a (keyword #f "nhints")))) (jolt-into _a$5637 _a$5638))) (pe (let* ((_a$5640 (lambda (e p) (let fnrec5639 ((e e) (p p)) (jolt-assoc e p (jolt-get nh p))))) (_a$5641 tenv) (_a$5642 (jolt-get a (keyword #f "params")))) (jolt-reduce _a$5640 _a$5641 _a$5642)))) (if (jolt-truthy? (jolt-get a (keyword #f "rest"))) (jolt-assoc pe (jolt-get a (keyword #f "rest")) jolt-nil) pe)))))) arity-env)))
(guard (e (#t #f))
  (def-var! "jolt.passes.numeric" "an-invoke" (letrec ((an-invoke (lambda (node tenv) (let fnrec5643 ((node node) (tenv tenv)) (let* ((fnode (jolt-get node (keyword #f "fn"))) (nm (if (jolt-truthy? (let* ((and__25__auto (jolt= (keyword #f "var") (jolt-get fnode (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (jolt= "clojure.core" (jolt-get fnode (keyword #f "ns"))) and__25__auto))) (jolt-get fnode (keyword #f "name")) jolt-nil)) (ars (let* ((_a$5645 (var-deref "clojure.core" "mapv")) (_a$5646 (lambda (a) (let fnrec5644 ((a a)) (jolt-invoke (var-deref "jolt.passes.numeric" "an") a tenv)))) (_a$5647 (jolt-get node (keyword #f "args")))) (jolt-invoke _a$5645 _a$5646 _a$5647))) (argnodes (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (r) (let fnrec5648 ((r r)) (jolt-nth r 1))) ars)) (node1 (jolt-assoc node (keyword #f "args") argnodes)) (n (jolt-count ars))) (if (jolt-truthy? (jolt-get fnode (keyword #f "num-ret"))) (let* ((_o$5649 (jolt-get fnode (keyword #f "num-ret"))) (_o$5650 node1)) (jolt-vector _o$5649 _o$5650)) (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "nil?") nm)) (let* ((_o$5651 jolt-nil) (_o$5652 node1)) (jolt-vector _o$5651 _o$5652)) (if (jolt-truthy? (keyword #f "else")) (let* ((cls (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (r) (let fnrec5653 ((r r)) (let* ((k (jolt-nth r 0)) (nd (jolt-nth r 1))) (if (jolt= k (keyword #f "double")) (keyword #f "double") (if (jolt= k (keyword #f "long")) (keyword #f "long") (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.numeric" "int-lit?") nd)) (keyword #f "wild") (if (jolt-truthy? (keyword #f "else")) (keyword #f "no") jolt-nil))))))) ars)) (ok? (lambda (allowed need) (let fnrec5654 ((allowed allowed) (need need)) (let* ((and__25__auto (jolt-pos? n))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-invoke (var-deref "clojure.core" "every?") (lambda (c) (let fnrec5655 ((c c)) (let* ((or__26__auto (jolt= c (keyword #f "wild")))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= c allowed))))) cls))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "some") (lambda (c) (let fnrec5656 ((c c)) (jolt= c need))) cls) and__25__auto)) and__25__auto))))) (ds (jolt-invoke (var-deref "jolt.passes.numeric" "dbl-spec") nm n)) (ls (jolt-invoke (var-deref "jolt.passes.numeric" "lng-spec") nm n))) (if (jolt-truthy? (let* ((and__25__auto ds)) (if (jolt-truthy? and__25__auto) (jolt-invoke ok? (keyword #f "double") (keyword #f "double")) and__25__auto))) (let* ((args_PRIME_ (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (nd) (let fnrec5657 ((nd nd)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.numeric" "int-lit?") nd)) (jolt-assoc nd (keyword #f "val") (jolt-invoke (var-deref "clojure.core" "double") (jolt-get nd (keyword #f "val")))) nd))) argnodes))) (let* ((_o$5658 (jolt-invoke (var-deref "jolt.passes.numeric" "propagate") ds)) (_o$5659 (jolt-assoc node1 (keyword #f "args") args_PRIME_ (keyword #f "num-kind") (keyword #f "double")))) (jolt-vector _o$5658 _o$5659))) (if (jolt-truthy? (let* ((and__25__auto ls)) (if (jolt-truthy? and__25__auto) (jolt-invoke ok? (keyword #f "long") (keyword #f "long")) and__25__auto))) (let* ((_o$5660 (jolt-invoke (var-deref "jolt.passes.numeric" "propagate") ls)) (_o$5661 (jolt-assoc node1 (keyword #f "num-kind") (keyword #f "long")))) (jolt-vector _o$5660 _o$5661)) (if (jolt-truthy? (keyword #f "else")) (let* ((_o$5662 jolt-nil) (_o$5663 node1)) (jolt-vector _o$5662 _o$5663)) jolt-nil)))) jolt-nil)))))))) an-invoke)))
(guard (e (#t #f))
  (def-var! "jolt.passes.numeric" "an" (letrec ((an (lambda (node tenv) (let fnrec5664 ((node node) (tenv tenv)) (let* ((op (jolt-get node (keyword #f "op")))) (if (jolt= op (keyword #f "const")) (let* ((_o$5665 (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.numeric" "float-lit?") node)) (keyword #f "double") jolt-nil)) (_o$5666 node)) (jolt-vector _o$5665 _o$5666)) (if (jolt= op (keyword #f "local")) (let* ((_o$5667 (jolt-get tenv (jolt-get node (keyword #f "name")))) (_o$5668 node)) (jolt-vector _o$5667 _o$5668)) (if (jolt= op (keyword #f "coerce")) (let* ((_o$5669 (jolt-get node (keyword #f "kind"))) (_o$5670 (jolt-assoc node (keyword #f "expr") (jolt-nth (jolt-invoke an (jolt-get node (keyword #f "expr")) tenv) 1)))) (jolt-vector _o$5669 _o$5670)) (if (jolt= op (keyword #f "invoke")) (jolt-invoke (var-deref "jolt.passes.numeric" "an-invoke") node tenv) (if (jolt= op (keyword #f "let")) (let* ((res (let* ((_a$5681 (lambda (acc b) (let fnrec5671 ((acc acc) (b b)) (let* ((te (jolt-nth acc 0)) (binds (jolt-nth acc 1)) (ir (jolt-invoke an (jolt-nth b 1) te))) (let* ((_o$5677 (let* ((_a$5672 te) (_a$5673 (jolt-nth b 0)) (_a$5674 (jolt-nth ir 0))) (jolt-assoc _a$5672 _a$5673 _a$5674))) (_o$5678 (jolt-conj binds (let* ((_o$5675 (jolt-nth b 0)) (_o$5676 (jolt-nth ir 1))) (jolt-vector _o$5675 _o$5676))))) (jolt-vector _o$5677 _o$5678)))))) (_a$5682 (let* ((_o$5679 tenv) (_o$5680 (jolt-vector))) (jolt-vector _o$5679 _o$5680))) (_a$5683 (jolt-get node (keyword #f "bindings")))) (jolt-reduce _a$5681 _a$5682 _a$5683))) (br (let* ((_a$5684 an) (_a$5685 (jolt-get node (keyword #f "body"))) (_a$5686 (jolt-nth res 0))) (jolt-invoke _a$5684 _a$5685 _a$5686)))) (let* ((_o$5692 (jolt-nth br 0)) (_o$5693 (let* ((_a$5687 node) (_a$5688 (keyword #f "bindings")) (_a$5689 (jolt-nth res 1)) (_a$5690 (keyword #f "body")) (_a$5691 (jolt-nth br 1))) (jolt-assoc _a$5687 _a$5688 _a$5689 _a$5690 _a$5691)))) (jolt-vector _o$5692 _o$5693))) (if (jolt= op (keyword #f "loop")) (let* ((binds (jolt-get node (keyword #f "bindings"))) (names (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (b) (let fnrec5694 ((b b)) (jolt-nth b 0))) binds)) (ik (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (b) (let fnrec5695 ((b b)) (jolt-nth (jolt-invoke an (jolt-nth b 1) tenv) 0))) binds)) (rlists (jolt-invoke (var-deref "jolt.passes.numeric" "recur-arg-lists") (jolt-get node (keyword #f "body")))) (seed (let* ((_a$5701 (var-deref "clojure.core" "mapv")) (_a$5702 (lambda (j) (let fnrec5696 ((j j)) (let* ((k (jolt-nth ik j)) (b (jolt-nth binds j))) (if (jolt-truthy? k) k (if (jolt-truthy? (let* ((and__25__auto (jolt-seq rlists))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.numeric" "int-lit?") (jolt-nth b 1)))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "every?") (lambda (args) (let fnrec5697 ((args args)) (let* ((_a$5698 (var-deref "jolt.passes.numeric" "counter-step?")) (_a$5699 (jolt-nth args j)) (_a$5700 (jolt-nth b 0))) (jolt-invoke _a$5698 _a$5699 _a$5700)))) rlists) and__25__auto)) and__25__auto))) (keyword #f "long") (if (jolt-truthy? (keyword #f "else")) jolt-nil jolt-nil))))))) (_a$5703 (jolt-range (jolt-count names)))) (jolt-invoke _a$5701 _a$5702 _a$5703))) (lk (jolt-invoke (var-deref "jolt.passes.numeric" "loop-kinds") names seed (jolt-get node (keyword #f "body")) tenv)) (te (let* ((_a$5708 (lambda (t i) (let fnrec5704 ((t t) (i i)) (let* ((_a$5705 t) (_a$5706 (jolt-nth names i)) (_a$5707 (jolt-nth lk i))) (jolt-assoc _a$5705 _a$5706 _a$5707))))) (_a$5709 tenv) (_a$5710 (jolt-range (jolt-count names)))) (jolt-reduce _a$5708 _a$5709 _a$5710)))) (let* ((_o$5719 jolt-nil) (_o$5720 (let* ((_a$5714 node) (_a$5715 (keyword #f "bindings")) (_a$5716 (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (b) (let fnrec5711 ((b b)) (let* ((_o$5712 (jolt-nth b 0)) (_o$5713 (jolt-nth (jolt-invoke an (jolt-nth b 1) tenv) 1))) (jolt-vector _o$5712 _o$5713)))) binds)) (_a$5717 (keyword #f "body")) (_a$5718 (jolt-nth (jolt-invoke an (jolt-get node (keyword #f "body")) te) 1))) (jolt-assoc _a$5714 _a$5715 _a$5716 _a$5717 _a$5718)))) (jolt-vector _o$5719 _o$5720))) (if (jolt= op (keyword #f "if")) (let* ((tr (jolt-invoke an (jolt-get node (keyword #f "test")) tenv)) (thn (jolt-invoke an (jolt-get node (keyword #f "then")) tenv)) (els (jolt-invoke an (jolt-get node (keyword #f "else")) tenv)) (tk (jolt-nth thn 0)) (ek (jolt-nth els 0))) (let* ((_o$5728 (if (jolt= tk ek) tk jolt-nil)) (_o$5729 (let* ((_a$5721 node) (_a$5722 (keyword #f "test")) (_a$5723 (jolt-nth tr 1)) (_a$5724 (keyword #f "then")) (_a$5725 (jolt-nth thn 1)) (_a$5726 (keyword #f "else")) (_a$5727 (jolt-nth els 1))) (jolt-assoc _a$5721 _a$5722 _a$5723 _a$5724 _a$5725 _a$5726 _a$5727)))) (jolt-vector _o$5728 _o$5729))) (if (jolt= op (keyword #f "do")) (let* ((stmts (let* ((_a$5731 (var-deref "clojure.core" "mapv")) (_a$5732 (lambda (s) (let fnrec5730 ((s s)) (jolt-nth (jolt-invoke an s tenv) 1)))) (_a$5733 (jolt-get node (keyword #f "statements")))) (jolt-invoke _a$5731 _a$5732 _a$5733))) (r (jolt-invoke an (jolt-get node (keyword #f "ret")) tenv))) (let* ((_o$5734 (jolt-nth r 0)) (_o$5735 (jolt-assoc node (keyword #f "statements") stmts (keyword #f "ret") (jolt-nth r 1)))) (jolt-vector _o$5734 _o$5735))) (if (jolt= op (keyword #f "fn")) (let* ((_o$5743 jolt-nil) (_o$5744 (jolt-assoc node (keyword #f "arities") (let* ((_a$5740 (var-deref "clojure.core" "mapv")) (_a$5741 (lambda (a) (let fnrec5736 ((a a)) (jolt-assoc a (keyword #f "body") (jolt-nth (let* ((_a$5737 an) (_a$5738 (jolt-get a (keyword #f "body"))) (_a$5739 (jolt-invoke (var-deref "jolt.passes.numeric" "arity-env") tenv a))) (jolt-invoke _a$5737 _a$5738 _a$5739)) 1))))) (_a$5742 (jolt-get node (keyword #f "arities")))) (jolt-invoke _a$5740 _a$5741 _a$5742))))) (jolt-vector _o$5743 _o$5744)) (if (jolt= op (keyword #f "def")) (let* ((_o$5745 jolt-nil) (_o$5746 (jolt-assoc node (keyword #f "init") (jolt-nth (jolt-invoke an (jolt-get node (keyword #f "init")) tenv) 1)))) (jolt-vector _o$5745 _o$5746)) (if (jolt-truthy? (keyword #f "else")) (let* ((_o$5748 jolt-nil) (_o$5749 (jolt-invoke (var-deref "jolt.ir" "map-ir-children") (lambda (c) (let fnrec5747 ((c c)) (jolt-nth (jolt-invoke an c tenv) 1))) node))) (jolt-vector _o$5748 _o$5749)) jolt-nil)))))))))))))))) an)))
(guard (e (#t #f))
  (def-var! "jolt.passes.numeric" "annotate" (letrec ((annotate (lambda (node) (let fnrec5750 ((node node)) (jolt-nth (jolt-invoke (var-deref "jolt.passes.numeric" "an") node (jolt-hash-map)) 1))))) annotate)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "dirty" (jolt-invoke (var-deref "clojure.core" "atom") #f)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "mark!" (letrec ((mark! (lambda () (let fnrec5751 () (jolt-invoke (var-deref "clojure.core" "reset!") (var-deref "jolt.passes.inline" "dirty") #t))))) mark!)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.inline" "rec-shapes" (jolt-invoke (var-deref "clojure.core" "atom") (jolt-hash-map)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "set-rec-shapes!" (letrec ((set-rec-shapes! (lambda (m) (let fnrec5752 ((m m)) (jolt-invoke (var-deref "clojure.core" "reset!") (var-deref "jolt.passes.inline" "rec-shapes") (let* ((or__26__auto m)) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-hash-map)))))))) set-rec-shapes!)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.inline" "fresh-counter" (jolt-invoke (var-deref "clojure.core" "atom") 0) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "fresh" (letrec ((fresh (lambda (base) (let fnrec5753 ((base base)) (let* ((n (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.passes.inline" "fresh-counter")))) (begin (jolt-invoke (var-deref "clojure.core" "swap!") (var-deref "jolt.passes.inline" "fresh-counter") jolt-inc) (jolt-invoke (var-deref "clojure.core" "str") base "__il" n))))))) fresh)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "safe-op?" (letrec ((safe-op? (lambda (op) (let fnrec5754 ((op op)) (let* ((or__26__auto (jolt= op (keyword #f "const")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= op (keyword #f "local")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= op (keyword #f "var")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= op (keyword #f "host")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= op (keyword #f "the-var")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= op (keyword #f "quote")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= op (keyword #f "if")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= op (keyword #f "do")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= op (keyword #f "let")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= op (keyword #f "invoke")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= op (keyword #f "map")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= op (keyword #f "vector")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= op (keyword #f "set")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= op (keyword #f "throw")))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= op (keyword #f "coerce")))))))))))))))))))))))))))))))))) safe-op?)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.inline" "inline-budget" 120 (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "body-size" (letrec ((body-size (lambda (node) (let fnrec5755 ((node node)) (if (jolt-not (jolt-invoke (var-deref "jolt.passes.inline" "safe-op?") (jolt-get node (keyword #f "op")))) 100000 (jolt-invoke (var-deref "jolt.ir" "reduce-ir-children") (lambda (acc c) (let fnrec5756 ((acc acc) (c c)) (+ acc (jolt-invoke body-size c)))) 1 node)))))) body-size)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "subst" (letrec ((subst (lambda (node env) (let fnrec5757 ((node node) (env env)) (let* ((op (jolt-get node (keyword #f "op")))) (if (jolt= op (keyword #f "local")) (let* ((r (jolt-get env (jolt-get node (keyword #f "name"))))) (if (jolt-truthy? r) (if (jolt-truthy? (let* ((and__25__auto (jolt= (keyword #f "local") (jolt-get r (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-get node (keyword #f "hint")))) (if (jolt-truthy? and__25__auto) (jolt-not (jolt-get r (keyword #f "hint"))) and__25__auto)) and__25__auto))) (jolt-assoc r (keyword #f "hint") (jolt-get node (keyword #f "hint"))) r) node)) (if (jolt= op (keyword #f "let")) (let* ((res (let* ((_a$5769 (lambda (acc b) (let fnrec5758 ((acc acc) (b b)) (let* ((e (jolt-nth acc 0)) (binds (jolt-nth acc 1)) (nm (jolt-nth b 0)) (init (jolt-invoke subst (jolt-nth b 1) e)) (f (jolt-invoke (var-deref "jolt.passes.inline" "fresh") nm))) (let* ((_o$5765 (jolt-assoc e nm (let* ((_o$5759 (keyword #f "op")) (_o$5760 (keyword #f "local")) (_o$5761 (keyword #f "name")) (_o$5762 f)) (jolt-hash-map _o$5759 _o$5760 _o$5761 _o$5762)))) (_o$5766 (jolt-conj binds (let* ((_o$5763 f) (_o$5764 init)) (jolt-vector _o$5763 _o$5764))))) (jolt-vector _o$5765 _o$5766)))))) (_a$5770 (let* ((_o$5767 env) (_o$5768 (jolt-vector))) (jolt-vector _o$5767 _o$5768))) (_a$5771 (jolt-get node (keyword #f "bindings")))) (jolt-reduce _a$5769 _a$5770 _a$5771)))) (let* ((_a$5775 node) (_a$5776 (keyword #f "bindings")) (_a$5777 (jolt-nth res 1)) (_a$5778 (keyword #f "body")) (_a$5779 (let* ((_a$5772 subst) (_a$5773 (jolt-get node (keyword #f "body"))) (_a$5774 (jolt-nth res 0))) (jolt-invoke _a$5772 _a$5773 _a$5774)))) (jolt-assoc _a$5775 _a$5776 _a$5777 _a$5778 _a$5779))) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "jolt.ir" "map-ir-children") (lambda (c) (let fnrec5780 ((c c)) (jolt-invoke subst c env))) node) jolt-nil)))))))) subst)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "trivial-arg?" (letrec ((trivial-arg? (lambda (n) (let fnrec5781 ((n n)) (let* ((op (jolt-get n (keyword #f "op")))) (let* ((or__26__auto (jolt= op (keyword #f "local")))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= op (keyword #f "const"))))))))) trivial-arg?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "body-closed?" (letrec ((body-closed? (lambda (node scope) (let fnrec5782 ((node node) (scope scope)) (let* ((op (jolt-get node (keyword #f "op")))) (if (jolt= op (keyword #f "local")) (jolt-contains? scope (jolt-get node (keyword #f "name"))) (if (jolt= op (keyword #f "let")) (let* ((res (let* ((_a$5788 (lambda (acc b) (let fnrec5783 ((acc acc) (b b)) (let* ((sc (jolt-nth acc 0)) (ok (jolt-nth acc 1))) (if (jolt-not ok) acc (let* ((_o$5784 (jolt-conj sc (jolt-nth b 0))) (_o$5785 (jolt-invoke body-closed? (jolt-nth b 1) sc))) (jolt-vector _o$5784 _o$5785))))))) (_a$5789 (let* ((_o$5786 scope) (_o$5787 #t)) (jolt-vector _o$5786 _o$5787))) (_a$5790 (jolt-get node (keyword #f "bindings")))) (jolt-reduce _a$5788 _a$5789 _a$5790)))) (let* ((and__25__auto (jolt-nth res 1))) (if (jolt-truthy? and__25__auto) (let* ((_a$5791 body-closed?) (_a$5792 (jolt-get node (keyword #f "body"))) (_a$5793 (jolt-nth res 0))) (jolt-invoke _a$5791 _a$5792 _a$5793)) and__25__auto))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.inline" "safe-op?") op)) (jolt-invoke (var-deref "jolt.ir" "reduce-ir-children") (lambda (ok c) (let fnrec5794 ((ok ok) (c c)) (let* ((and__25__auto ok)) (if (jolt-truthy? and__25__auto) (jolt-invoke body-closed? c scope) and__25__auto)))) #t node) (if (jolt-truthy? (keyword #f "else")) #f jolt-nil))))))))) body-closed?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "try-inline" (letrec ((try-inline (lambda (node ctx) (let fnrec5795 ((node node) (ctx ctx)) (let* ((f (jolt-get node (keyword #f "fn")))) (if (jolt= (keyword #f "var") (jolt-get f (keyword #f "op"))) (let* ((stash (let* ((_a$5796 (var-deref "jolt.host" "inline-ir")) (_a$5797 ctx) (_a$5798 (jolt-get f (keyword #f "ns"))) (_a$5799 (jolt-get f (keyword #f "name")))) (jolt-invoke _a$5796 _a$5797 _a$5798 _a$5799)))) (if (jolt-truthy? stash) (let* ((params (jolt-get stash (keyword #f "params"))) (body (jolt-get stash (keyword #f "body"))) (nh (let* ((_a$5804 (lambda (m pr) (let fnrec5800 ((m m) (pr pr)) (let* ((_a$5801 m) (_a$5802 (jolt-nth pr 0)) (_a$5803 (jolt-nth pr 1))) (jolt-assoc _a$5801 _a$5802 _a$5803))))) (_a$5805 (jolt-hash-map)) (_a$5806 (jolt-get stash (keyword #f "nhints")))) (jolt-reduce _a$5804 _a$5805 _a$5806))) (ret (jolt-get stash (keyword #f "ret"))) (args (jolt-get node (keyword #f "args")))) (if (jolt-truthy? (let* ((and__25__auto (let* ((_a$5807 (jolt-count params)) (_a$5808 (jolt-count args))) (jolt= _a$5807 _a$5808)))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (<= (jolt-invoke (var-deref "jolt.passes.inline" "body-size") body) (var-deref "jolt.passes.inline" "inline-budget")))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.inline" "body-closed?") body (jolt-reduce jolt-conj (jolt-hash-set) params)) and__25__auto)) and__25__auto))) (let* ((n (jolt-count params)) (res (let* ((i 0) (env (jolt-hash-map)) (binds (jolt-vector))) (let loop5809 ((i i) (env env) (binds binds)) (if (< i n) (let* ((p (jolt-nth params i)) (a (jolt-nth args i)) (k (jolt-get nh p))) (if (jolt-truthy? k) (let* ((f (jolt-invoke (var-deref "jolt.passes.inline" "fresh") p))) (let* ((_a$5816 (jolt-inc i)) (_a$5817 (jolt-assoc env p (let* ((_o$5810 (keyword #f "op")) (_o$5811 (keyword #f "local")) (_o$5812 (keyword #f "name")) (_o$5813 f)) (jolt-hash-map _o$5810 _o$5811 _o$5812 _o$5813)))) (_a$5818 (jolt-conj binds (let* ((_o$5814 f) (_o$5815 (jolt-invoke (var-deref "jolt.ir" "coerce-node") k a))) (jolt-vector _o$5814 _o$5815))))) (loop5809 _a$5816 _a$5817 _a$5818))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.inline" "trivial-arg?") a)) (let* ((_a$5819 (jolt-inc i)) (_a$5820 (jolt-assoc env p a)) (_a$5821 binds)) (loop5809 _a$5819 _a$5820 _a$5821)) (if (jolt-truthy? (keyword #f "else")) (let* ((f (jolt-invoke (var-deref "jolt.passes.inline" "fresh") p))) (let* ((_a$5828 (jolt-inc i)) (_a$5829 (jolt-assoc env p (let* ((_o$5822 (keyword #f "op")) (_o$5823 (keyword #f "local")) (_o$5824 (keyword #f "name")) (_o$5825 f)) (jolt-hash-map _o$5822 _o$5823 _o$5824 _o$5825)))) (_a$5830 (jolt-conj binds (let* ((_o$5826 f) (_o$5827 a)) (jolt-vector _o$5826 _o$5827))))) (loop5809 _a$5828 _a$5829 _a$5830))) jolt-nil)))) (let* ((_o$5831 env) (_o$5832 binds)) (jolt-vector _o$5831 _o$5832)))))) (env (jolt-nth res 0)) (binds (jolt-nth res 1)) (rbody0 (jolt-invoke (var-deref "jolt.passes.inline" "subst") body env)) (rbody (if (jolt-truthy? ret) (jolt-invoke (var-deref "jolt.ir" "coerce-node") ret rbody0) rbody0))) (begin (jolt-invoke (var-deref "jolt.passes.inline" "mark!")) (if (jolt= 0 (jolt-count binds)) rbody (let* ((_o$5833 (keyword #f "op")) (_o$5834 (keyword #f "let")) (_o$5835 (keyword #f "bindings")) (_o$5836 binds) (_o$5837 (keyword #f "body")) (_o$5838 rbody)) (jolt-hash-map _o$5833 _o$5834 _o$5835 _o$5836 _o$5837 _o$5838))))) node)) node)) node)))))) try-inline)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "inline-node" (letrec ((inline-node (lambda (node ctx) (let fnrec5839 ((node node) (ctx ctx)) (if (jolt= (keyword #f "invoke") (jolt-get node (keyword #f "op"))) (jolt-invoke (var-deref "jolt.passes.inline" "try-inline") (jolt-invoke (var-deref "jolt.ir" "map-ir-children") (lambda (c) (let fnrec5840 ((c c)) (jolt-invoke inline-node c ctx))) node) ctx) (jolt-invoke (var-deref "jolt.ir" "map-ir-children") (lambda (c) (let fnrec5841 ((c c)) (jolt-invoke inline-node c ctx))) node)))))) inline-node)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "flatten-let-bindings" (letrec ((flatten-let-bindings (lambda (binds) (let fnrec5842 ((binds binds)) (let* ((_a$5848 (lambda (out b) (let fnrec5843 ((out out) (b b)) (let* ((nm (jolt-nth b 0)) (init (jolt-nth b 1))) (if (jolt= (keyword #f "let") (jolt-get init (keyword #f "op"))) (begin (jolt-invoke (var-deref "jolt.passes.inline" "mark!")) (let* ((_a$5846 (jolt-reduce jolt-conj out (jolt-get init (keyword #f "bindings")))) (_a$5847 (let* ((_o$5844 nm) (_o$5845 (jolt-get init (keyword #f "body")))) (jolt-vector _o$5844 _o$5845)))) (jolt-conj _a$5846 _a$5847))) (jolt-conj out b)))))) (_a$5849 (jolt-vector)) (_a$5850 binds)) (jolt-reduce _a$5848 _a$5849 _a$5850)))))) flatten-let-bindings)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "flatten-lets" (letrec ((flatten-lets (lambda (node) (let fnrec5851 ((node node)) (if (jolt= (keyword #f "let") (jolt-get node (keyword #f "op"))) (let* ((n (jolt-invoke (var-deref "jolt.ir" "map-ir-children") flatten-lets node))) (jolt-assoc n (keyword #f "bindings") (jolt-invoke (var-deref "jolt.passes.inline" "flatten-let-bindings") (jolt-get n (keyword #f "bindings"))))) (jolt-invoke (var-deref "jolt.ir" "map-ir-children") flatten-lets node)))))) flatten-lets)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.inline" "pure-fns" (let* ((_o$5852 "+") (_o$5853 "-") (_o$5854 "*") (_o$5855 "/") (_o$5856 "<") (_o$5857 ">") (_o$5858 "<=") (_o$5859 ">=") (_o$5860 "=") (_o$5861 "not=") (_o$5862 "inc") (_o$5863 "dec") (_o$5864 "mod") (_o$5865 "rem") (_o$5866 "quot") (_o$5867 "min") (_o$5868 "max") (_o$5869 "abs") (_o$5870 "nil?") (_o$5871 "some?") (_o$5872 "not") (_o$5873 "get") (_o$5874 "zero?") (_o$5875 "pos?") (_o$5876 "neg?") (_o$5877 "even?") (_o$5878 "odd?") (_o$5879 "bit-and") (_o$5880 "bit-or") (_o$5881 "bit-xor")) (jolt-hash-set _o$5852 _o$5853 _o$5854 _o$5855 _o$5856 _o$5857 _o$5858 _o$5859 _o$5860 _o$5861 _o$5862 _o$5863 _o$5864 _o$5865 _o$5866 _o$5867 _o$5868 _o$5869 _o$5870 _o$5871 _o$5872 _o$5873 _o$5874 _o$5875 _o$5876 _o$5877 _o$5878 _o$5879 _o$5880 _o$5881)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "pure-fn?" (letrec ((pure-fn? (lambda (f) (let fnrec5882 ((f f)) (let* ((op (jolt-get f (keyword #f "op")))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.fold" "kw-callee?") f)) #t (if (jolt= op (keyword #f "var")) (let* ((and__25__auto (jolt= "clojure.core" (jolt-get f (keyword #f "ns"))))) (if (jolt-truthy? and__25__auto) (jolt-contains? (var-deref "jolt.passes.inline" "pure-fns") (jolt-get f (keyword #f "name"))) and__25__auto)) (if (jolt= op (keyword #f "host")) (jolt-contains? (var-deref "jolt.passes.inline" "pure-fns") (jolt-get f (keyword #f "name"))) (if (jolt-truthy? (keyword #f "else")) #f jolt-nil))))))))) pure-fn?)))
(guard (e (#t #f))
  (declare-var! "jolt.passes.inline" "ctor-shape"))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "pure?" (letrec ((pure? (lambda (node) (let fnrec5883 ((node node)) (let* ((op (jolt-get node (keyword #f "op")))) (if (jolt= op (keyword #f "invoke")) (let* ((and__25__auto (let* ((or__26__auto (jolt-invoke (var-deref "jolt.passes.inline" "pure-fn?") (jolt-get node (keyword #f "fn"))))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-invoke (var-deref "jolt.passes.inline" "ctor-shape") node))))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "every?") pure? (jolt-get node (keyword #f "args"))) and__25__auto)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.inline" "safe-op?") op)) (jolt-invoke (var-deref "jolt.ir" "reduce-ir-children") (lambda (ok c) (let fnrec5884 ((ok ok) (c c)) (let* ((and__25__auto ok)) (if (jolt-truthy? and__25__auto) (jolt-invoke pure? c) and__25__auto)))) #t node) (if (jolt-truthy? (keyword #f "else")) #f jolt-nil)))))))) pure?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "const-key-map?" (letrec ((const-key-map? (lambda (node) (let fnrec5885 ((node node)) (let* ((prs (jolt-get node (keyword #f "pairs")))) (let* ((and__25__auto (> (jolt-count prs) 0))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "every?") (lambda (pr) (let fnrec5886 ((pr pr)) (jolt-invoke (var-deref "jolt.passes.fold" "scalar-const?") (jolt-nth pr 0)))) prs) and__25__auto))))))) const-key-map?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "all-vals-pure?" (letrec ((all-vals-pure? (lambda (node) (let fnrec5887 ((node node)) (let* ((_a$5889 (var-deref "clojure.core" "every?")) (_a$5890 (lambda (pr) (let fnrec5888 ((pr pr)) (jolt-invoke (var-deref "jolt.passes.inline" "pure?") (jolt-nth pr 1))))) (_a$5891 (jolt-get node (keyword #f "pairs")))) (jolt-invoke _a$5889 _a$5890 _a$5891)))))) all-vals-pure?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "map-val" (letrec ((map-val (lambda (mapnode k) (let fnrec5892 ((mapnode mapnode) (k k)) (let* ((prs (jolt-get mapnode (keyword #f "pairs"))) (n (jolt-count prs))) (let* ((i 0)) (let loop5893 ((i i)) (if (< i n) (let* ((pr (jolt-nth prs i))) (if (jolt= (jolt-get (jolt-nth pr 0) (keyword #f "val")) k) (jolt-nth pr 1) (loop5893 (jolt-inc i)))) (let* ((_o$5894 (keyword #f "op")) (_o$5895 (keyword #f "const")) (_o$5896 (keyword #f "val")) (_o$5897 jolt-nil)) (jolt-hash-map _o$5894 _o$5895 _o$5896 _o$5897)))))))))) map-val)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "lookup-key" (letrec ((lookup-key (lambda (node nm) (let fnrec5898 ((node node) (nm nm)) (if (jolt= (keyword #f "invoke") (jolt-get node (keyword #f "op"))) (let* ((f (jolt-get node (keyword #f "fn"))) (args (jolt-get node (keyword #f "args")))) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.fold" "kw-callee?") f))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= 1 (jolt-count args)))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= (keyword #f "local") (jolt-get (jolt-nth args 0) (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (jolt= nm (jolt-get (jolt-nth args 0) (keyword #f "name"))) and__25__auto)) and__25__auto)) and__25__auto))) (jolt-get f (keyword #f "val")) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.fold" "get-callee?") f))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= 2 (jolt-count args)))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= (keyword #f "local") (jolt-get (jolt-nth args 0) (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= nm (jolt-get (jolt-nth args 0) (keyword #f "name"))))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.fold" "scalar-const?") (jolt-nth args 1)) and__25__auto)) and__25__auto)) and__25__auto)) and__25__auto))) (jolt-get (jolt-nth args 1) (keyword #f "val")) (if (jolt-truthy? (keyword #f "else")) jolt-nil jolt-nil)))) jolt-nil))))) lookup-key)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "any-binding-named?" (letrec ((any-binding-named? (lambda (binds nm) (let fnrec5899 ((binds binds) (nm nm)) (let* ((i 0)) (let loop5900 ((i i)) (if (< i (jolt-count binds)) (if (jolt= nm (jolt-nth (jolt-nth binds i) 0)) #t (loop5900 (jolt-inc i))) #f))))))) any-binding-named?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "any-name?" (letrec ((any-name? (lambda (names nm) (let fnrec5901 ((names names) (nm nm)) (let* ((i 0)) (let loop5902 ((i i)) (if (< i (jolt-count names)) (if (jolt= nm (jolt-nth names i)) #t (loop5902 (jolt-inc i))) #f))))))) any-name?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "local-escapes?" (letrec ((local-escapes? (lambda (node nm) (let fnrec5903 ((node node) (nm nm)) (let* ((op (jolt-get node (keyword #f "op"))) (k (jolt-invoke (var-deref "jolt.passes.inline" "lookup-key") node nm))) (if (jolt-truthy? k) (let* ((args (jolt-get node (keyword #f "args")))) (if (> (jolt-count args) 1) (let* ((i 1)) (let loop5904 ((i i)) (if (< i (jolt-count args)) (if (jolt-truthy? (jolt-invoke local-escapes? (jolt-nth args i) nm)) #t (loop5904 (jolt-inc i))) #f))) #f)) (if (jolt= op (keyword #f "local")) (jolt= nm (jolt-get node (keyword #f "name"))) (if (jolt= op (keyword #f "const")) #f (if (jolt= op (keyword #f "var")) #f (if (jolt= op (keyword #f "host")) #f (if (jolt= op (keyword #f "the-var")) #f (if (jolt= op (keyword #f "quote")) #f (if (jolt= op (keyword #f "if")) (let* ((or__26__auto (jolt-invoke local-escapes? (jolt-get node (keyword #f "test")) nm))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt-invoke local-escapes? (jolt-get node (keyword #f "then")) nm))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-invoke local-escapes? (jolt-get node (keyword #f "else")) nm))))) (if (jolt= op (keyword #f "do")) (let* ((or__26__auto (let* ((i 0) (ss (jolt-get node (keyword #f "statements")))) (let loop5905 ((i i) (ss ss)) (if (< i (jolt-count ss)) (if (jolt-truthy? (jolt-invoke local-escapes? (jolt-nth ss i) nm)) #t (loop5905 (jolt-inc i) ss)) #f))))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-invoke local-escapes? (jolt-get node (keyword #f "ret")) nm))) (if (jolt= op (keyword #f "throw")) (jolt-invoke local-escapes? (jolt-get node (keyword #f "expr")) nm) (if (jolt= op (keyword #f "invoke")) (let* ((or__26__auto (jolt-invoke local-escapes? (jolt-get node (keyword #f "fn")) nm))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((i 0) (as (jolt-get node (keyword #f "args")))) (let loop5906 ((i i) (as as)) (if (< i (jolt-count as)) (if (jolt-truthy? (jolt-invoke local-escapes? (jolt-nth as i) nm)) #t (loop5906 (jolt-inc i) as)) #f))))) (if (jolt= op (keyword #f "vector")) (let* ((i 0) (xs (jolt-get node (keyword #f "items")))) (let loop5907 ((i i) (xs xs)) (if (< i (jolt-count xs)) (if (jolt-truthy? (jolt-invoke local-escapes? (jolt-nth xs i) nm)) #t (loop5907 (jolt-inc i) xs)) #f))) (if (jolt= op (keyword #f "set")) (let* ((i 0) (xs (jolt-get node (keyword #f "items")))) (let loop5908 ((i i) (xs xs)) (if (< i (jolt-count xs)) (if (jolt-truthy? (jolt-invoke local-escapes? (jolt-nth xs i) nm)) #t (loop5908 (jolt-inc i) xs)) #f))) (if (jolt= op (keyword #f "map")) (let* ((i 0) (ps (jolt-get node (keyword #f "pairs")))) (let loop5909 ((i i) (ps ps)) (if (< i (jolt-count ps)) (if (jolt-truthy? (let* ((or__26__auto (jolt-invoke local-escapes? (jolt-nth (jolt-nth ps i) 0) nm))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-invoke local-escapes? (jolt-nth (jolt-nth ps i) 1) nm)))) #t (loop5909 (jolt-inc i) ps)) #f))) (if (jolt= op (keyword #f "let")) (let* ((binds (jolt-get node (keyword #f "bindings")))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.inline" "any-binding-named?") binds nm)) #t (let* ((or__26__auto (let* ((i 0)) (let loop5910 ((i i)) (if (< i (jolt-count binds)) (if (jolt-truthy? (jolt-invoke local-escapes? (jolt-nth (jolt-nth binds i) 1) nm)) #t (loop5910 (jolt-inc i))) #f))))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-invoke local-escapes? (jolt-get node (keyword #f "body")) nm))))) (if (jolt= op (keyword #f "recur")) (let* ((i 0) (as (jolt-get node (keyword #f "args")))) (let loop5911 ((i i) (as as)) (if (< i (jolt-count as)) (if (jolt-truthy? (jolt-invoke local-escapes? (jolt-nth as i) nm)) #t (loop5911 (jolt-inc i) as)) #f))) (if (jolt= op (keyword #f "loop")) (let* ((binds (jolt-get node (keyword #f "bindings")))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.inline" "any-binding-named?") binds nm)) #t (let* ((or__26__auto (let* ((i 0)) (let loop5912 ((i i)) (if (< i (jolt-count binds)) (if (jolt-truthy? (jolt-invoke local-escapes? (jolt-nth (jolt-nth binds i) 1) nm)) #t (loop5912 (jolt-inc i))) #f))))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-invoke local-escapes? (jolt-get node (keyword #f "body")) nm))))) (if (jolt= op (keyword #f "fn")) (let* ((i 0) (ars (jolt-get node (keyword #f "arities")))) (let loop5913 ((i i) (ars ars)) (if (< i (jolt-count ars)) (let* ((ar (jolt-nth ars i)) (ps (jolt-get ar (keyword #f "params")))) (if (jolt-truthy? (let* ((or__26__auto (jolt-invoke (var-deref "jolt.passes.inline" "any-name?") ps nm))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= nm (jolt-get ar (keyword #f "rest")))))) #t (if (jolt-truthy? (jolt-invoke local-escapes? (jolt-get ar (keyword #f "body")) nm)) #t (loop5913 (jolt-inc i) ars)))) #f))) (if (jolt= op (keyword #f "try")) (let* ((or__26__auto (jolt-invoke local-escapes? (jolt-get node (keyword #f "body")) nm))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (let* ((cb (jolt-get node (keyword #f "catch-body")))) (let* ((and__25__auto cb)) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-not (jolt= nm (jolt-get node (keyword #f "catch-sym")))))) (if (jolt-truthy? and__25__auto) (jolt-invoke local-escapes? cb nm) and__25__auto)) and__25__auto))))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((f (jolt-get node (keyword #f "finally")))) (let* ((and__25__auto f)) (if (jolt-truthy? and__25__auto) (jolt-invoke local-escapes? f nm) and__25__auto))))))) (if (jolt= op (keyword #f "def")) (jolt-invoke local-escapes? (jolt-get node (keyword #f "init")) nm) (if (jolt-truthy? (keyword #f "else")) #t jolt-nil)))))))))))))))))))))))))) local-escapes?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "ctor-shape" (letrec ((ctor-shape (lambda (node) (let fnrec5914 ((node node)) (if (jolt= (keyword #f "invoke") (jolt-get node (keyword #f "op"))) (let* ((f (jolt-get node (keyword #f "fn")))) (if (jolt= (keyword #f "var") (jolt-get f (keyword #f "op"))) (let* ((rs (let* ((_a$5919 (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.passes.inline" "rec-shapes"))) (_a$5920 (let* ((_a$5915 (var-deref "clojure.core" "str")) (_a$5916 (jolt-get f (keyword #f "ns"))) (_a$5917 "/") (_a$5918 (jolt-get f (keyword #f "name")))) (jolt-invoke _a$5915 _a$5916 _a$5917 _a$5918)))) (jolt-get _a$5919 _a$5920)))) (if (jolt-truthy? (let* ((and__25__auto rs)) (if (jolt-truthy? and__25__auto) (let* ((_a$5921 (jolt-count (jolt-get rs (keyword #f "fields")))) (_a$5922 (jolt-count (jolt-get node (keyword #f "args"))))) (jolt= _a$5921 _a$5922)) and__25__auto))) rs jolt-nil)) jolt-nil)) jolt-nil))))) ctor-shape)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "ctor-all-args-pure?" (letrec ((ctor-all-args-pure? (lambda (node) (let fnrec5923 ((node node)) (jolt-invoke (var-deref "clojure.core" "every?") (var-deref "jolt.passes.inline" "pure?") (jolt-get node (keyword #f "args"))))))) ctor-all-args-pure?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "field-index" (letrec ((field-index (lambda (fields k) (let fnrec5924 ((fields fields) (k k)) (let* ((n (jolt-count fields))) (let* ((i 0)) (let loop5925 ((i i)) (if (< i n) (if (jolt= (jolt-nth fields i) k) i (loop5925 (jolt-inc i))) jolt-nil)))))))) field-index)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "ctor-val" (letrec ((ctor-val (lambda (ctor rs k) (let fnrec5926 ((ctor ctor) (rs rs) (k k)) (let* ((_a$5927 (jolt-get ctor (keyword #f "args"))) (_a$5928 (jolt-invoke (var-deref "jolt.passes.inline" "field-index") (jolt-get rs (keyword #f "fields")) k))) (jolt-nth _a$5927 _a$5928)))))) ctor-val)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "collect-keys!" (letrec ((collect-keys! (lambda (node nm acc) (let fnrec5929 ((node node) (nm nm) (acc acc)) (let* ((k (jolt-invoke (var-deref "jolt.passes.inline" "lookup-key") node nm))) (if (jolt-truthy? k) (jolt-invoke (var-deref "clojure.core" "swap!") acc jolt-conj k) (jolt-invoke (var-deref "jolt.ir" "map-ir-children") (lambda (c) (let fnrec5930 ((c c)) (begin (jolt-invoke collect-keys! c nm acc) c))) node))))))) collect-keys!)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "lookups-all-fields?" (letrec ((lookups-all-fields? (lambda (nodes nm fields) (let fnrec5931 ((nodes nodes) (nm nm) (fields fields)) (jolt-invoke (var-deref "clojure.core" "every?") (lambda (node) (let fnrec5932 ((node node)) (let* ((acc (jolt-invoke (var-deref "clojure.core" "atom") (jolt-hash-set)))) (begin (jolt-invoke (var-deref "jolt.passes.inline" "collect-keys!") node nm acc) (let* ((_a$5934 (var-deref "clojure.core" "every?")) (_a$5935 (lambda (k) (let fnrec5933 ((k k)) (jolt-invoke (var-deref "jolt.passes.inline" "field-index") fields k)))) (_a$5936 (jolt-invoke (var-deref "clojure.core" "deref") acc))) (jolt-invoke _a$5934 _a$5935 _a$5936)))))) nodes))))) lookups-all-fields?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "src-val" (letrec ((src-val (lambda (src k) (let fnrec5937 ((src src) (k k)) (if (jolt= (keyword #f "map") (jolt-get src (keyword #f "op"))) (jolt-invoke (var-deref "jolt.passes.inline" "map-val") src k) (jolt-invoke (var-deref "jolt.passes.inline" "ctor-val") src (jolt-invoke (var-deref "jolt.passes.inline" "ctor-shape") src) k)))))) src-val)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "subst-lookup" (letrec ((subst-lookup (lambda (node nm src) (let fnrec5938 ((node node) (nm nm) (src src)) (let* ((k (jolt-invoke (var-deref "jolt.passes.inline" "lookup-key") node nm))) (if (jolt-truthy? k) (jolt-invoke (var-deref "jolt.passes.inline" "src-val") src k) (jolt-invoke (var-deref "jolt.ir" "map-ir-children") (lambda (c) (let fnrec5939 ((c c)) (jolt-invoke subst-lookup c nm src))) node))))))) subst-lookup)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "fold-kw-literal" (letrec ((fold-kw-literal (lambda (node) (let fnrec5940 ((node node)) (let* ((f (jolt-get node (keyword #f "fn"))) (args (jolt-get node (keyword #f "args")))) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.fold" "kw-callee?") f))) (if (jolt-truthy? and__25__auto) (jolt= 1 (jolt-count args)) and__25__auto))) (let* ((m (jolt-nth args 0)) (k (jolt-get f (keyword #f "val")))) (if (jolt-truthy? (let* ((and__25__auto (jolt= (keyword #f "map") (jolt-get m (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.inline" "const-key-map?") m))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.inline" "all-vals-pure?") m) and__25__auto)) and__25__auto))) (begin (jolt-invoke (var-deref "jolt.passes.inline" "mark!")) (jolt-invoke (var-deref "jolt.passes.inline" "map-val") m k)) (let* ((rs (jolt-invoke (var-deref "jolt.passes.inline" "ctor-shape") m))) (if (jolt-truthy? (let* ((and__25__auto rs)) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.inline" "ctor-all-args-pure?") m))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.inline" "field-index") (jolt-get rs (keyword #f "fields")) k) and__25__auto)) and__25__auto))) (begin (jolt-invoke (var-deref "jolt.passes.inline" "mark!")) (jolt-invoke (var-deref "jolt.passes.inline" "ctor-val") m rs k)) node)))) node)))))) fold-kw-literal)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "elim-let-structs" (letrec ((elim-let-structs (lambda (node) (let fnrec5941 ((node node)) (let* ((binds (jolt-get node (keyword #f "bindings"))) (n (jolt-count binds)) (body (jolt-get node (keyword #f "body")))) (let* ((i 0)) (let loop5942 ((i i)) (if (< i n) (let* ((b (jolt-nth binds i)) (nm (jolt-nth b 0)) (init (jolt-nth b 1)) (ismap (let* ((and__25__auto (jolt= (keyword #f "map") (jolt-get init (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.inline" "const-key-map?") init))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.inline" "all-vals-pure?") init) and__25__auto)) and__25__auto))) (rs (if (jolt-not ismap) (jolt-invoke (var-deref "jolt.passes.inline" "ctor-shape") init) jolt-nil)) (isrec (let* ((and__25__auto rs)) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.inline" "ctor-all-args-pure?") init) and__25__auto)))) (if (jolt-truthy? (let* ((and__25__auto (let* ((or__26__auto ismap)) (if (jolt-truthy? or__26__auto) or__26__auto isrec)))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-not (jolt-invoke (var-deref "jolt.passes.inline" "any-binding-named?") (jolt-invoke (var-deref "clojure.core" "subvec") binds (jolt-inc i) n) nm)))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-not (let* ((j (jolt-inc i))) (let loop5943 ((j j)) (if (< j n) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.inline" "local-escapes?") (jolt-nth (jolt-nth binds j) 1) nm)) #t (loop5943 (jolt-inc j))) #f)))))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-not (jolt-invoke (var-deref "jolt.passes.inline" "local-escapes?") body nm)))) (if (jolt-truthy? and__25__auto) (let* ((or__26__auto ismap)) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((_a$5948 (var-deref "jolt.passes.inline" "lookups-all-fields?")) (_a$5949 (jolt-conj (let* ((_a$5945 (var-deref "clojure.core" "mapv")) (_a$5946 (lambda (bb) (let fnrec5944 ((bb bb)) (jolt-nth bb 1)))) (_a$5947 (jolt-invoke (var-deref "clojure.core" "subvec") binds (jolt-inc i) n))) (jolt-invoke _a$5945 _a$5946 _a$5947)) body)) (_a$5950 nm) (_a$5951 (jolt-get rs (keyword #f "fields")))) (jolt-invoke _a$5948 _a$5949 _a$5950 _a$5951)))) and__25__auto)) and__25__auto)) and__25__auto)) and__25__auto))) (let* ((head (jolt-invoke (var-deref "clojure.core" "subvec") binds 0 i)) (tail (let* ((_a$5955 (var-deref "clojure.core" "mapv")) (_a$5956 (lambda (bb) (let fnrec5952 ((bb bb)) (let* ((_o$5953 (jolt-nth bb 0)) (_o$5954 (jolt-invoke (var-deref "jolt.passes.inline" "subst-lookup") (jolt-nth bb 1) nm init))) (jolt-vector _o$5953 _o$5954))))) (_a$5957 (jolt-invoke (var-deref "clojure.core" "subvec") binds (jolt-inc i) n))) (jolt-invoke _a$5955 _a$5956 _a$5957))) (newbinds (jolt-reduce jolt-conj head tail)) (newbody (jolt-invoke (var-deref "jolt.passes.inline" "subst-lookup") body nm init))) (begin (jolt-invoke (var-deref "jolt.passes.inline" "mark!")) (if (jolt= 0 (jolt-count newbinds)) newbody (jolt-assoc node (keyword #f "bindings") newbinds (keyword #f "body") newbody)))) (loop5942 (jolt-inc i)))) node)))))))) elim-let-structs)))
(guard (e (#t #f))
  (def-var! "jolt.passes.inline" "scalar-replace" (letrec ((scalar-replace (lambda (node) (let fnrec5958 ((node node)) (let* ((op (jolt-get node (keyword #f "op")))) (if (jolt= op (keyword #f "invoke")) (jolt-invoke (var-deref "jolt.passes.inline" "fold-kw-literal") (jolt-invoke (var-deref "jolt.ir" "map-ir-children") scalar-replace node)) (if (jolt= op (keyword #f "let")) (jolt-invoke (var-deref "jolt.passes.inline" "elim-let-structs") (jolt-invoke (var-deref "jolt.ir" "map-ir-children") scalar-replace node)) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "jolt.ir" "map-ir-children") scalar-replace node) jolt-nil)))))))) scalar-replace)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "velem" (letrec ((velem (lambda (t) (let fnrec5359 ((t t)) (jolt-get t (keyword #f "vec")))))) velem)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "selem" (letrec ((selem (lambda (t) (let fnrec5360 ((t t)) (jolt-get t (keyword #f "set")))))) selem)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "sfields" (letrec ((sfields (lambda (t) (let fnrec5361 ((t t)) (jolt-get t (keyword #f "struct")))))) sfields)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "vec-type?" (letrec ((vec-type? (lambda (t) (let fnrec5362 ((t t)) (jolt-invoke (var-deref "clojure.core" "some?") (jolt-invoke (var-deref "jolt.passes.types.lattice" "velem") t)))))) vec-type?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "set-type?" (letrec ((set-type? (lambda (t) (let fnrec5363 ((t t)) (jolt-invoke (var-deref "clojure.core" "some?") (jolt-invoke (var-deref "jolt.passes.types.lattice" "selem") t)))))) set-type?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "struct-type?" (letrec ((struct-type? (lambda (t) (let fnrec5364 ((t t)) (jolt-invoke (var-deref "clojure.core" "some?") (jolt-invoke (var-deref "jolt.passes.types.lattice" "sfields") t)))))) struct-type?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "mk-vec" (letrec ((mk-vec (lambda (t) (let fnrec5365 ((t t)) (let* ((_o$5366 (keyword #f "vec")) (_o$5367 (if (jolt-truthy? t) t (keyword #f "any")))) (jolt-hash-map _o$5366 _o$5367)))))) mk-vec)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "mk-set" (letrec ((mk-set (lambda (t) (let fnrec5368 ((t t)) (let* ((_o$5369 (keyword #f "set")) (_o$5370 (if (jolt-truthy? t) t (keyword #f "any")))) (jolt-hash-map _o$5369 _o$5370)))))) mk-set)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "mk-struct" (letrec ((mk-struct (lambda (fs) (let fnrec5371 ((fs fs)) (let* ((_o$5372 (keyword #f "struct")) (_o$5373 fs)) (jolt-hash-map _o$5372 _o$5373)))))) mk-struct)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "union-cap" 4))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "scalar-t?" (letrec ((scalar-t? (lambda (t) (let fnrec5374 ((t t)) (let* ((or__26__auto (jolt= t (keyword #f "num")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= t (keyword #f "str")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= t (keyword #f "kw")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= t (keyword #f "truthy")))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= t (keyword #f "phm")))))))))))))) scalar-t?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "union-type?" (letrec ((union-type? (lambda (t) (let fnrec5375 ((t t)) (jolt-invoke (var-deref "clojure.core" "some?") (jolt-get t (keyword #f "union"))))))) union-type?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "umembers" (letrec ((umembers (lambda (t) (let fnrec5376 ((t t)) (jolt-get t (keyword #f "union")))))) umembers)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "union-of" (letrec ((union-of (lambda (ts) (let fnrec5377 ((ts ts)) (let* ((flat (let* ((_a$5379 (lambda (acc t) (let fnrec5378 ((acc acc) (t t)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "union-type?") t)) (jolt-reduce jolt-conj acc (jolt-invoke (var-deref "jolt.passes.types.lattice" "umembers") t)) (jolt-conj acc t))))) (_a$5380 (jolt-hash-set)) (_a$5381 ts)) (jolt-reduce _a$5379 _a$5380 _a$5381)))) (if (jolt-not (jolt-invoke (var-deref "clojure.core" "every?") (var-deref "jolt.passes.types.lattice" "scalar-t?") flat)) (keyword #f "any") (if (jolt= 0 (jolt-count flat)) (keyword #f "any") (if (jolt= 1 (jolt-count flat)) (jolt-first flat) (if (> (jolt-count flat) (var-deref "jolt.passes.types.lattice" "union-cap")) (keyword #f "any") (if (jolt-truthy? (keyword #f "else")) (let* ((_o$5382 (keyword #f "union")) (_o$5383 flat)) (jolt-hash-map _o$5382 _o$5383)) jolt-nil)))))))))) union-of)))
(guard (e (#t #f))
  (declare-var! "jolt.passes.types.lattice" "join-t"))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "merge-fields" (letrec ((merge-fields (lambda (fa fb) (let fnrec5384 ((fa fa) (fb fb)) (let* ((m1 (let* ((_a$5389 (lambda (m k) (let fnrec5385 ((m m) (k k)) (jolt-assoc m k (let* ((_a$5386 (var-deref "jolt.passes.types.lattice" "join-t")) (_a$5387 (jolt-get fa k (keyword #f "any"))) (_a$5388 (jolt-get fb k (keyword #f "any")))) (jolt-invoke _a$5386 _a$5387 _a$5388)))))) (_a$5390 (jolt-hash-map)) (_a$5391 (jolt-keys fa))) (jolt-reduce _a$5389 _a$5390 _a$5391)))) (let* ((_a$5396 (lambda (m k) (let fnrec5392 ((m m) (k k)) (if (jolt-truthy? (jolt-get m k)) m (jolt-assoc m k (let* ((_a$5393 (var-deref "jolt.passes.types.lattice" "join-t")) (_a$5394 (jolt-get fa k (keyword #f "any"))) (_a$5395 (jolt-get fb k (keyword #f "any")))) (jolt-invoke _a$5393 _a$5394 _a$5395))))))) (_a$5397 m1) (_a$5398 (jolt-keys fb))) (jolt-reduce _a$5396 _a$5397 _a$5398))))))) merge-fields)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "join-t" (letrec ((join-t (lambda (a b) (let fnrec5399 ((a a) (b b)) (if (jolt= a b) a (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "nil?") a)) b (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "nil?") b)) a (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.types.lattice" "struct-type?") a))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.types.lattice" "struct-type?") b) and__25__auto))) (let* ((merged (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-struct") (let* ((_a$5400 (var-deref "jolt.passes.types.lattice" "merge-fields")) (_a$5401 (jolt-invoke (var-deref "jolt.passes.types.lattice" "sfields") a)) (_a$5402 (jolt-invoke (var-deref "jolt.passes.types.lattice" "sfields") b))) (jolt-invoke _a$5400 _a$5401 _a$5402))))) (if (jolt-truthy? (let* ((and__25__auto (jolt-get a (keyword #f "shape")))) (if (jolt-truthy? and__25__auto) (let* ((_a$5403 (jolt-get a (keyword #f "shape"))) (_a$5404 (jolt-get b (keyword #f "shape")))) (jolt= _a$5403 _a$5404)) and__25__auto))) (jolt-assoc merged (keyword #f "shape") (jolt-get a (keyword #f "shape"))) merged)) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.types.lattice" "vec-type?") a))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.types.lattice" "vec-type?") b) and__25__auto))) (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-vec") (let* ((_a$5405 join-t) (_a$5406 (jolt-invoke (var-deref "jolt.passes.types.lattice" "velem") a)) (_a$5407 (jolt-invoke (var-deref "jolt.passes.types.lattice" "velem") b))) (jolt-invoke _a$5405 _a$5406 _a$5407))) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.types.lattice" "set-type?") a))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.types.lattice" "set-type?") b) and__25__auto))) (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-set") (let* ((_a$5408 join-t) (_a$5409 (jolt-invoke (var-deref "jolt.passes.types.lattice" "selem") a)) (_a$5410 (jolt-invoke (var-deref "jolt.passes.types.lattice" "selem") b))) (jolt-invoke _a$5408 _a$5409 _a$5410))) (if (jolt-truthy? (keyword #f "else")) (let* ((ma (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "union-type?") a)) (jolt-invoke (var-deref "jolt.passes.types.lattice" "umembers") a) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "scalar-t?") a)) (jolt-hash-set a) (if (jolt-truthy? (keyword #f "else")) jolt-nil jolt-nil)))) (mb (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "union-type?") b)) (jolt-invoke (var-deref "jolt.passes.types.lattice" "umembers") b) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "scalar-t?") b)) (jolt-hash-set b) (if (jolt-truthy? (keyword #f "else")) jolt-nil jolt-nil))))) (if (jolt-truthy? (let* ((and__25__auto ma)) (if (jolt-truthy? and__25__auto) mb and__25__auto))) (jolt-invoke (var-deref "jolt.passes.types.lattice" "union-of") (jolt-reduce jolt-conj ma mb)) (keyword #f "any"))) jolt-nil))))))))))) join-t)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "join" (letrec ((join (lambda (a b) (let fnrec5411 ((a a) (b b)) (jolt-invoke (var-deref "jolt.passes.types.lattice" "join-t") a b))))) join)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "type-depth" 4))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "cap" (letrec ((cap (lambda (t d) (let fnrec5412 ((t t) (d d)) (if (<= d 0) (if (jolt-truthy? (let* ((or__26__auto (jolt-invoke (var-deref "jolt.passes.types.lattice" "struct-type?") t))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt-invoke (var-deref "jolt.passes.types.lattice" "vec-type?") t))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-invoke (var-deref "jolt.passes.types.lattice" "set-type?") t)))))) (keyword #f "any") t) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "struct-type?") t)) (let* ((capped (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-struct") (let* ((_a$5417 (lambda (m k) (let fnrec5413 ((m m) (k k)) (jolt-assoc m k (let* ((_a$5414 cap) (_a$5415 (jolt-get (jolt-invoke (var-deref "jolt.passes.types.lattice" "sfields") t) k)) (_a$5416 (jolt-dec d))) (jolt-invoke _a$5414 _a$5415 _a$5416)))))) (_a$5418 (jolt-hash-map)) (_a$5419 (jolt-keys (jolt-invoke (var-deref "jolt.passes.types.lattice" "sfields") t)))) (jolt-reduce _a$5417 _a$5418 _a$5419)))) (capped (if (jolt-truthy? (jolt-get t (keyword #f "shape"))) (jolt-assoc capped (keyword #f "shape") (jolt-get t (keyword #f "shape"))) capped)) (capped (if (jolt-truthy? (jolt-get t (keyword #f "type"))) (jolt-assoc capped (keyword #f "type") (jolt-get t (keyword #f "type"))) capped))) capped) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "vec-type?") t)) (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-vec") (let* ((_a$5420 cap) (_a$5421 (jolt-invoke (var-deref "jolt.passes.types.lattice" "velem") t)) (_a$5422 (jolt-dec d))) (jolt-invoke _a$5420 _a$5421 _a$5422))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "set-type?") t)) (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-set") (let* ((_a$5423 cap) (_a$5424 (jolt-invoke (var-deref "jolt.passes.types.lattice" "selem") t)) (_a$5425 (jolt-dec d))) (jolt-invoke _a$5423 _a$5424 _a$5425))) (if (jolt-truthy? (keyword #f "else")) t jolt-nil))))))))) cap)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "struct-safe?" (letrec ((struct-safe? (lambda (t) (let fnrec5426 ((t t)) (jolt-invoke (var-deref "jolt.passes.types.lattice" "struct-type?") t))))) struct-safe?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "field-type" (letrec ((field-type (lambda (t k) (let fnrec5427 ((t t) (k k)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "struct-type?") t)) (jolt-get (jolt-invoke (var-deref "jolt.passes.types.lattice" "sfields") t) k (keyword #f "any")) (keyword #f "any")))))) field-type)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "shape-order" (letrec ((shape-order (lambda (ks) (let fnrec5428 ((ks ks)) (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "clojure.core" "sort") (lambda (a b) (let fnrec5429 ((a a) (b b)) (let* ((_a$5430 (var-deref "clojure.core" "compare")) (_a$5431 (jolt-invoke (var-deref "clojure.core" "str") a)) (_a$5432 (jolt-invoke (var-deref "clojure.core" "str") b))) (jolt-invoke _a$5430 _a$5431 _a$5432)))) ks)))))) shape-order)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "type-shape" (letrec ((type-shape (lambda (t) (let fnrec5433 ((t t)) (jolt-get t (keyword #f "shape")))))) type-shape)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "mark-struct" (letrec ((mark-struct (lambda (node t) (let fnrec5434 ((node node) (t t)) (let* ((n (jolt-assoc node (keyword #f "hint") (keyword #f "struct")))) (if (jolt-truthy? (jolt-get t (keyword #f "shape"))) (jolt-assoc n (keyword #f "shape") (jolt-get t (keyword #f "shape"))) n)))))) mark-struct)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "truthy-type?" (letrec ((truthy-type? (lambda (t) (let fnrec5435 ((t t)) (let* ((or__26__auto (jolt= t (keyword #f "num")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= t (keyword #f "str")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= t (keyword #f "kw")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= t (keyword #f "truthy")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= t (keyword #f "phm")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt-invoke (var-deref "jolt.passes.types.lattice" "struct-type?") t))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt-invoke (var-deref "jolt.passes.types.lattice" "vec-type?") t))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-invoke (var-deref "jolt.passes.types.lattice" "set-type?") t))))))))))))))))))) truthy-type?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "num-ret-fns" (let* ((_o$5436 "+") (_o$5437 "-") (_o$5438 "*") (_o$5439 "/") (_o$5440 "inc") (_o$5441 "dec") (_o$5442 "mod") (_o$5443 "rem") (_o$5444 "quot") (_o$5445 "min") (_o$5446 "max") (_o$5447 "abs") (_o$5448 "bit-and") (_o$5449 "bit-or") (_o$5450 "bit-xor") (_o$5451 "count")) (jolt-hash-set _o$5436 _o$5437 _o$5438 _o$5439 _o$5440 _o$5441 _o$5442 _o$5443 _o$5444 _o$5445 _o$5446 _o$5447 _o$5448 _o$5449 _o$5450 _o$5451))))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.lattice" "vector-ret-fns" (let* ((_o$5452 "vec") (_o$5453 "vector") (_o$5454 "mapv") (_o$5455 "filterv") (_o$5456 "subvec")) (jolt-hash-set _o$5452 _o$5453 _o$5454 _o$5455 _o$5456))))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.check" "not-number?" (letrec ((not-number? (lambda (t) (let fnrec5457 ((t t)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "union-type?") t)) (jolt-invoke (var-deref "clojure.core" "every?") not-number? (jolt-invoke (var-deref "jolt.passes.types.lattice" "umembers") t)) (let* ((or__26__auto (jolt= t (keyword #f "str")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= t (keyword #f "kw")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt= t (keyword #f "phm")))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt-invoke (var-deref "jolt.passes.types.lattice" "struct-type?") t))) (if (jolt-truthy? or__26__auto) or__26__auto (let* ((or__26__auto (jolt-invoke (var-deref "jolt.passes.types.lattice" "vec-type?") t))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-invoke (var-deref "jolt.passes.types.lattice" "set-type?") t)))))))))))))))) not-number?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.check" "not-seqable?" (letrec ((not-seqable? (lambda (t) (let fnrec5458 ((t t)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "union-type?") t)) (jolt-invoke (var-deref "clojure.core" "every?") not-seqable? (jolt-invoke (var-deref "jolt.passes.types.lattice" "umembers") t)) (let* ((or__26__auto (jolt= t (keyword #f "num")))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= t (keyword #f "kw"))))))))) not-seqable?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.check" "not-callable?" (letrec ((not-callable? (lambda (t) (let fnrec5459 ((t t)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "union-type?") t)) (jolt-invoke (var-deref "clojure.core" "every?") not-callable? (jolt-invoke (var-deref "jolt.passes.types.lattice" "umembers") t)) (let* ((or__26__auto (jolt= t (keyword #f "num")))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= t (keyword #f "str"))))))))) not-callable?)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.types.check" "num-ops" (let* ((_o$5460 "+") (_o$5461 "-") (_o$5462 "*") (_o$5463 "/") (_o$5464 "inc") (_o$5465 "dec") (_o$5466 "mod") (_o$5467 "rem") (_o$5468 "quot") (_o$5469 "min") (_o$5470 "max") (_o$5471 "abs") (_o$5472 "bit-and") (_o$5473 "bit-or") (_o$5474 "bit-xor") (_o$5475 "bit-not") (_o$5476 "bit-shift-left") (_o$5477 "bit-shift-right")) (jolt-hash-set _o$5460 _o$5461 _o$5462 _o$5463 _o$5464 _o$5465 _o$5466 _o$5467 _o$5468 _o$5469 _o$5470 _o$5471 _o$5472 _o$5473 _o$5474 _o$5475 _o$5476 _o$5477)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.types.check" "seq-ops" (let* ((_o$5478 "count") (_o$5479 "first") (_o$5480 "rest") (_o$5481 "next") (_o$5482 "seq") (_o$5483 "nth")) (jolt-hash-set _o$5478 _o$5479 _o$5480 _o$5481 _o$5482 _o$5483)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.check" "type-name" (letrec ((type-name (lambda (t) (let fnrec5484 ((t t)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "union-type?") t)) (let* ((_a$5486 (lambda (s m) (let fnrec5485 ((s s) (m m)) (if (jolt= s "") (jolt-invoke type-name m) (jolt-invoke (var-deref "clojure.core" "str") s " or " (jolt-invoke type-name m)))))) (_a$5487 "") (_a$5488 (jolt-invoke (var-deref "jolt.passes.types.lattice" "umembers") t))) (jolt-reduce _a$5486 _a$5487 _a$5488)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "struct-type?") t)) "a map" (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "vec-type?") t)) "a vector" (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "set-type?") t)) "a set" (if (jolt= t (keyword #f "str")) "a string" (if (jolt= t (keyword #f "kw")) "a keyword" (if (jolt= t (keyword #f "num")) "a number" (if (jolt= t (keyword #f "phm")) "a map" (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "clojure.core" "str") t) jolt-nil))))))))))))) type-name)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.check" "check-invoke" (letrec ((check-invoke (lambda (cn args arg-types pos env) (let fnrec5489 ((cn cn) (args args) (arg-types arg-types) (pos pos) (env env)) (if (jolt-contains? (var-deref "jolt.passes.types.check" "num-ops") cn) (let* ((_a$5512 (lambda (_ i) (let fnrec5490 ((_ _) (i i)) (begin (let* ((t (jolt-nth arg-types i))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.check" "not-number?") t)) (let* ((_a$5508 (var-deref "clojure.core" "swap!")) (_a$5509 (jolt-get env (keyword #f "diags"))) (_a$5510 jolt-conj) (_a$5511 (let* ((_o$5498 (keyword #f "op")) (_o$5499 cn) (_o$5500 (keyword #f "argpos")) (_o$5501 i) (_o$5502 (keyword #f "type")) (_o$5503 (jolt-invoke (var-deref "jolt.passes.types.check" "type-name") t)) (_o$5504 (keyword #f "pos")) (_o$5505 pos) (_o$5506 (keyword #f "msg")) (_o$5507 (let* ((_a$5491 (var-deref "clojure.core" "str")) (_a$5492 "`") (_a$5493 cn) (_a$5494 "` requires a number, but argument ") (_a$5495 (jolt-inc i)) (_a$5496 " is ") (_a$5497 (jolt-invoke (var-deref "jolt.passes.types.check" "type-name") t))) (jolt-invoke _a$5491 _a$5492 _a$5493 _a$5494 _a$5495 _a$5496 _a$5497)))) (jolt-hash-map _o$5498 _o$5499 _o$5500 _o$5501 _o$5502 _o$5503 _o$5504 _o$5505 _o$5506 _o$5507)))) (jolt-invoke _a$5508 _a$5509 _a$5510 _a$5511)) jolt-nil)) jolt-nil)))) (_a$5513 jolt-nil) (_a$5514 (jolt-range (jolt-count args)))) (jolt-reduce _a$5512 _a$5513 _a$5514)) (if (jolt-truthy? (let* ((and__25__auto (jolt-contains? (var-deref "jolt.passes.types.check" "seq-ops") cn))) (if (jolt-truthy? and__25__auto) (> (jolt-count args) 0) and__25__auto))) (let* ((t (jolt-nth arg-types 0))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.check" "not-seqable?") t)) (let* ((_a$5532 (var-deref "clojure.core" "swap!")) (_a$5533 (jolt-get env (keyword #f "diags"))) (_a$5534 jolt-conj) (_a$5535 (let* ((_o$5522 (keyword #f "op")) (_o$5523 cn) (_o$5524 (keyword #f "argpos")) (_o$5525 0) (_o$5526 (keyword #f "type")) (_o$5527 (jolt-invoke (var-deref "jolt.passes.types.check" "type-name") t)) (_o$5528 (keyword #f "pos")) (_o$5529 pos) (_o$5530 (keyword #f "msg")) (_o$5531 (let* ((_a$5515 (var-deref "clojure.core" "str")) (_a$5516 "`") (_a$5517 cn) (_a$5518 "` requires ") (_a$5519 (if (jolt= cn "count") "a countable collection" "a seqable")) (_a$5520 ", but argument 1 is ") (_a$5521 (jolt-invoke (var-deref "jolt.passes.types.check" "type-name") t))) (jolt-invoke _a$5515 _a$5516 _a$5517 _a$5518 _a$5519 _a$5520 _a$5521)))) (jolt-hash-map _o$5522 _o$5523 _o$5524 _o$5525 _o$5526 _o$5527 _o$5528 _o$5529 _o$5530 _o$5531)))) (jolt-invoke _a$5532 _a$5533 _a$5534 _a$5535)) jolt-nil)) (if (jolt-truthy? (keyword #f "else")) jolt-nil jolt-nil))))))) check-invoke)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types.check" "register-user-fn!" (letrec ((register-user-fn! (lambda (node env) (let fnrec5536 ((node node) (env env)) (let* ((init (jolt-get node (keyword #f "init"))) (m (jolt-get node (keyword #f "meta"))) (redefable (let* ((and__25__auto m)) (if (jolt-truthy? and__25__auto) (let* ((or__26__auto (jolt-get m (keyword #f "redef")))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-get m (keyword #f "dynamic")))) and__25__auto)))) (if (jolt-truthy? (let* ((and__25__auto (jolt-not redefable))) (if (jolt-truthy? and__25__auto) (jolt= (keyword #f "fn") (jolt-get init (keyword #f "op"))) and__25__auto))) (let* ((arities (jolt-get init (keyword #f "arities")))) (if (jolt= 1 (jolt-count arities)) (let* ((ar (jolt-first arities))) (if (jolt-not (jolt-get ar (keyword #f "rest"))) (let* ((_a$5547 (var-deref "clojure.core" "swap!")) (_a$5548 (jolt-get env (keyword #f "user-sigs"))) (_a$5549 jolt-assoc) (_a$5550 (let* ((_a$5537 (var-deref "clojure.core" "str")) (_a$5538 (jolt-get node (keyword #f "ns"))) (_a$5539 "/") (_a$5540 (jolt-get node (keyword #f "name")))) (jolt-invoke _a$5537 _a$5538 _a$5539 _a$5540))) (_a$5551 (let* ((_o$5541 (keyword #f "name")) (_o$5542 (jolt-get node (keyword #f "name"))) (_o$5543 (keyword #f "params")) (_o$5544 (jolt-get ar (keyword #f "params"))) (_o$5545 (keyword #f "body")) (_o$5546 (jolt-get ar (keyword #f "body")))) (jolt-hash-map _o$5541 _o$5542 _o$5543 _o$5544 _o$5545 _o$5546)))) (jolt-invoke _a$5547 _a$5548 _a$5549 _a$5550 _a$5551)) jolt-nil)) jolt-nil)) jolt-nil)))))) register-user-fn!)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.types" "config-box" (jolt-invoke (var-deref "clojure.core" "atom") (let* ((_o$4863 (keyword #f "rtenv")) (_o$4864 (jolt-hash-map)) (_o$4865 (keyword #f "vtypes")) (_o$4866 (jolt-hash-map)) (_o$4867 (keyword #f "record-shapes")) (_o$4868 (jolt-hash-map)) (_o$4869 (keyword #f "protocol-methods")) (_o$4870 (jolt-hash-map)) (_o$4871 (keyword #f "map-shapes?")) (_o$4872 #f)) (jolt-hash-map _o$4863 _o$4864 _o$4865 _o$4866 _o$4867 _o$4868 _o$4869 _o$4870 _o$4871 _o$4872))) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.types" "escapes-box" (jolt-invoke (var-deref "clojure.core" "atom") (jolt-hash-set)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.types" "user-sig-box" (jolt-invoke (var-deref "clojure.core" "atom") (jolt-hash-map)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.types" "last-diags-box" (jolt-invoke (var-deref "clojure.core" "atom") (jolt-vector)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.types" "check-mode-box" (jolt-invoke (var-deref "clojure.core" "atom") (let* ((_o$4873 (keyword #f "on")) (_o$4874 #f) (_o$4875 (keyword #f "strict")) (_o$4876 #f)) (jolt-hash-map _o$4873 _o$4874 _o$4875 _o$4876))) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "mk-env" (letrec ((mk-env (lambda (checking? strict?) (let fnrec4877 ((checking? checking?) (strict? strict?)) (let* ((c (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.passes.types" "config-box")))) (let* ((_o$4878 (keyword #f "rtenv")) (_o$4879 (jolt-get c (keyword #f "rtenv"))) (_o$4880 (keyword #f "vtypes")) (_o$4881 (jolt-get c (keyword #f "vtypes"))) (_o$4882 (keyword #f "record-shapes")) (_o$4883 (jolt-get c (keyword #f "record-shapes"))) (_o$4884 (keyword #f "protocol-methods")) (_o$4885 (jolt-get c (keyword #f "protocol-methods"))) (_o$4886 (keyword #f "map-shapes?")) (_o$4887 (jolt-get c (keyword #f "map-shapes?"))) (_o$4888 (keyword #f "checking?")) (_o$4889 checking?) (_o$4890 (keyword #f "strict?")) (_o$4891 strict?) (_o$4892 (keyword #f "diags")) (_o$4893 (jolt-invoke (var-deref "clojure.core" "atom") (jolt-vector))) (_o$4894 (keyword #f "calls")) (_o$4895 (jolt-invoke (var-deref "clojure.core" "atom") (jolt-vector))) (_o$4896 (keyword #f "checking-set")) (_o$4897 (jolt-invoke (var-deref "clojure.core" "atom") (jolt-hash-set))) (_o$4898 (keyword #f "diag-memo")) (_o$4899 (jolt-invoke (var-deref "clojure.core" "atom") (jolt-hash-map))) (_o$4900 (keyword #f "escapes")) (_o$4901 (var-deref "jolt.passes.types" "escapes-box")) (_o$4902 (keyword #f "user-sigs")) (_o$4903 (var-deref "jolt.passes.types" "user-sig-box"))) (jolt-hash-map _o$4878 _o$4879 _o$4880 _o$4881 _o$4882 _o$4883 _o$4884 _o$4885 _o$4886 _o$4887 _o$4888 _o$4889 _o$4890 _o$4891 _o$4892 _o$4893 _o$4894 _o$4895 _o$4896 _o$4897 _o$4898 _o$4899 _o$4900 _o$4901 _o$4902 _o$4903))))))) mk-env)))
(guard (e (#t #f))
  (declare-var! "jolt.passes.types" "record-type-from-entry"))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "field-type-from-tag" (letrec ((field-type-from-tag (lambda (tag depth shapes) (let fnrec4904 ((tag tag) (depth depth) (shapes shapes)) (if (jolt-truthy? (let* ((or__26__auto (jolt-invoke (var-deref "clojure.core" "nil?") tag))) (if (jolt-truthy? or__26__auto) or__26__auto (<= depth 0)))) (keyword #f "any") (if (jolt= tag "num") (keyword #f "num") (if (jolt-truthy? (keyword #f "else")) (let* ((e (jolt-get shapes tag))) (if (jolt-truthy? e) (jolt-invoke (var-deref "jolt.passes.types" "record-type-from-entry") e depth shapes) (keyword #f "any"))) jolt-nil))))))) field-type-from-tag)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "record-type-from-entry" (letrec ((record-type-from-entry (lambda (rs depth shapes) (let fnrec4905 ((rs rs) (depth depth) (shapes shapes)) (let* ((fields (jolt-get rs (keyword #f "fields"))) (tags (jolt-get rs (keyword #f "tags"))) (fmap (let* ((_a$4914 (lambda (m i) (let fnrec4906 ((m m) (i i)) (let* ((_a$4911 m) (_a$4912 (jolt-nth fields i)) (_a$4913 (let* ((_a$4907 (var-deref "jolt.passes.types" "field-type-from-tag")) (_a$4908 (if (jolt-truthy? tags) (jolt-nth tags i) jolt-nil)) (_a$4909 (jolt-dec depth)) (_a$4910 shapes)) (jolt-invoke _a$4907 _a$4908 _a$4909 _a$4910)))) (jolt-assoc _a$4911 _a$4912 _a$4913))))) (_a$4915 (jolt-hash-map)) (_a$4916 (jolt-range (jolt-count fields)))) (jolt-reduce _a$4914 _a$4915 _a$4916)))) (let* ((_a$4917 (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-struct") fmap)) (_a$4918 (keyword #f "shape")) (_a$4919 (jolt-invoke (var-deref "clojure.core" "vec") fields)) (_a$4920 (keyword #f "type")) (_a$4921 (jolt-get rs (keyword #f "type")))) (jolt-assoc _a$4917 _a$4918 _a$4919 _a$4920 _a$4921))))))) record-type-from-entry)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.types" "elem-fns" (let* ((_o$4922 "rand-nth") (_o$4923 "first") (_o$4924 "peek") (_o$4925 "last") (_o$4926 "nth") (_o$4927 "fnext") (_o$4928 "second")) (jolt-hash-set _o$4922 _o$4923 _o$4924 _o$4925 _o$4926 _o$4927 _o$4928)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (declare-var! "jolt.passes.types" "check-user-call"))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "var-key" (letrec ((var-key (lambda (fnode) (let fnrec4929 ((fnode fnode)) (let* ((_a$4930 (var-deref "clojure.core" "str")) (_a$4931 (jolt-get fnode (keyword #f "ns"))) (_a$4932 "/") (_a$4933 (jolt-get fnode (keyword #f "name")))) (jolt-invoke _a$4930 _a$4931 _a$4932 _a$4933)))))) var-key)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "call-ret-type" (letrec ((call-ret-type (lambda (fnode env) (let fnrec4934 ((fnode fnode) (env env)) (let* ((op (jolt-get fnode (keyword #f "op"))) (shapes (jolt-get env (keyword #f "record-shapes")))) (if (jolt= op (keyword #f "var")) (let* ((rs (jolt-get shapes (jolt-invoke (var-deref "jolt.passes.types" "var-key") fnode)))) (if (jolt-truthy? rs) (jolt-invoke (var-deref "jolt.passes.types" "record-type-from-entry") rs (var-deref "jolt.passes.types.lattice" "type-depth") shapes) (let* ((r (let* ((_a$4935 (jolt-get env (keyword #f "rtenv"))) (_a$4936 (jolt-invoke (var-deref "jolt.passes.types" "var-key") fnode))) (jolt-get _a$4935 _a$4936)))) (if (jolt-truthy? r) r (let* ((nm (let* ((and__25__auto (jolt= "clojure.core" (jolt-get fnode (keyword #f "ns"))))) (if (jolt-truthy? and__25__auto) (jolt-get fnode (keyword #f "name")) and__25__auto)))) (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "nil?") nm)) (keyword #f "any") (if (jolt-contains? (var-deref "jolt.passes.types.lattice" "num-ret-fns") nm) (keyword #f "num") (if (jolt-contains? (var-deref "jolt.passes.types.lattice" "vector-ret-fns") nm) (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-vec") (keyword #f "any")) (if (jolt-truthy? (keyword #f "else")) (keyword #f "any") jolt-nil))))))))) (if (jolt= op (keyword #f "host")) (let* ((nm (jolt-get fnode (keyword #f "name")))) (if (jolt-contains? (var-deref "jolt.passes.types.lattice" "num-ret-fns") nm) (keyword #f "num") (if (jolt-contains? (var-deref "jolt.passes.types.lattice" "vector-ret-fns") nm) (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-vec") (keyword #f "any")) (if (jolt-truthy? (keyword #f "else")) (keyword #f "any") jolt-nil)))) (if (jolt-truthy? (keyword #f "else")) (keyword #f "any") jolt-nil)))))))) call-ret-type)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.types" "fold-preds" (let* ((_o$4937 "number?") (_o$4938 "string?") (_o$4939 "keyword?") (_o$4940 "record?") (_o$4941 "nil?") (_o$4942 "some?")) (jolt-hash-set _o$4937 _o$4938 _o$4939 _o$4940 _o$4941 _o$4942)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "record-t?" (letrec ((record-t? (lambda (t) (let fnrec4943 ((t t)) (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.types.lattice" "struct-type?") t))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "some?") (jolt-get t (keyword #f "type"))) and__25__auto)))))) record-t?)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "pred-on" (letrec ((pred-on (lambda (pname t) (let fnrec4944 ((pname pname) (t t)) (if (jolt-truthy? (let* ((or__26__auto (jolt= t (keyword #f "any")))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= t (keyword #f "truthy"))))) jolt-nil (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "union-type?") t)) (let* ((vs (let* ((_a$4946 (lambda (m) (let fnrec4945 ((m m)) (jolt-invoke pred-on pname m)))) (_a$4947 (jolt-invoke (var-deref "jolt.passes.types.lattice" "umembers") t))) (jolt-map _a$4946 _a$4947)))) (if (jolt-truthy? (let* ((and__25__auto (jolt-seq vs))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-not (jolt-invoke (var-deref "clojure.core" "nil?") (jolt-first vs))))) (if (jolt-truthy? and__25__auto) (jolt-apply jolt= vs) and__25__auto)) and__25__auto))) (jolt-first vs) jolt-nil)) (if (jolt-truthy? (keyword #f "else")) (let* ((G__122 pname)) (if (jolt= G__122 "number?") (jolt= t (keyword #f "num")) (if (jolt= G__122 "string?") (jolt= t (keyword #f "str")) (if (jolt= G__122 "keyword?") (jolt= t (keyword #f "kw")) (if (jolt= G__122 "record?") (jolt-invoke (var-deref "jolt.passes.types" "record-t?") t) (if (jolt= G__122 "nil?") #f (if (jolt= G__122 "some?") #t jolt-nil))))))) jolt-nil))))))) pred-on)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "pure-node?" (letrec ((pure-node? (lambda (n) (let fnrec4948 ((n n)) (let* ((op (jolt-get n (keyword #f "op")))) (let* ((or__26__auto (jolt= op (keyword #f "const")))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= op (keyword #f "local"))))))))) pure-node?)))
(guard (e (#t #f))
  (declare-var! "jolt.passes.types" "infer"))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "ty" (letrec ((ty (lambda (r) (let fnrec4949 ((r r)) (jolt-nth r 0))))) ty)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "nd" (letrec ((nd (lambda (r) (let fnrec4950 ((r r)) (jolt-nth r 1))))) nd)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes.types" "hof-table" (let* ((_o$4967 "map") (_o$4968 (let* ((_o$4951 (keyword #f "epos")) (_o$4952 0)) (jolt-hash-map _o$4951 _o$4952))) (_o$4969 "mapv") (_o$4970 (let* ((_o$4953 (keyword #f "epos")) (_o$4954 0)) (jolt-hash-map _o$4953 _o$4954))) (_o$4971 "filter") (_o$4972 (let* ((_o$4955 (keyword #f "epos")) (_o$4956 0)) (jolt-hash-map _o$4955 _o$4956))) (_o$4973 "filterv") (_o$4974 (let* ((_o$4957 (keyword #f "epos")) (_o$4958 0)) (jolt-hash-map _o$4957 _o$4958))) (_o$4975 "keep") (_o$4976 (let* ((_o$4959 (keyword #f "epos")) (_o$4960 0)) (jolt-hash-map _o$4959 _o$4960))) (_o$4977 "remove") (_o$4978 (let* ((_o$4961 (keyword #f "epos")) (_o$4962 0)) (jolt-hash-map _o$4961 _o$4962))) (_o$4979 "run!") (_o$4980 (let* ((_o$4963 (keyword #f "epos")) (_o$4964 0)) (jolt-hash-map _o$4963 _o$4964))) (_o$4981 "mapcat") (_o$4982 (let* ((_o$4965 (keyword #f "epos")) (_o$4966 0)) (jolt-hash-map _o$4965 _o$4966)))) (jolt-hash-map _o$4967 _o$4968 _o$4969 _o$4970 _o$4971 _o$4972 _o$4973 _o$4974 _o$4975 _o$4976 _o$4977 _o$4978 _o$4979 _o$4980 _o$4981 _o$4982)) (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "infer-fn-seeded" (letrec ((infer-fn-seeded (lambda (node seeds tenv env) (let fnrec4983 ((node node) (seeds seeds) (tenv tenv) (env env)) (let* ((res (let* ((_a$4994 (var-deref "clojure.core" "mapv")) (_a$4995 (lambda (a) (let fnrec4984 ((a a)) (let* ((params (jolt-get a (keyword #f "params"))) (pe (let* ((_a$4989 (lambda (e i) (let fnrec4985 ((e e) (i i)) (let* ((_a$4986 e) (_a$4987 (jolt-nth params i)) (_a$4988 (let* ((s (jolt-get seeds i))) (if (jolt-truthy? s) s (keyword #f "any"))))) (jolt-assoc _a$4986 _a$4987 _a$4988))))) (_a$4990 tenv) (_a$4991 (jolt-range (jolt-count params)))) (jolt-reduce _a$4989 _a$4990 _a$4991))) (pe (if (jolt-truthy? (jolt-get a (keyword #f "rest"))) (jolt-assoc pe (jolt-get a (keyword #f "rest")) (keyword #f "any")) pe)) (br (jolt-invoke (var-deref "jolt.passes.types" "infer") (jolt-get a (keyword #f "body")) pe env))) (let* ((_o$4992 (jolt-invoke (var-deref "jolt.passes.types" "ty") br)) (_o$4993 (jolt-assoc a (keyword #f "body") (jolt-invoke (var-deref "jolt.passes.types" "nd") br)))) (jolt-vector _o$4992 _o$4993)))))) (_a$4996 (jolt-get node (keyword #f "arities")))) (jolt-invoke _a$4994 _a$4995 _a$4996))) (rets (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (r) (let fnrec4997 ((r r)) (jolt-invoke (var-deref "jolt.passes.types" "ty") r))) res)) (ret (if (jolt-empty? rets) (keyword #f "any") (let* ((_a$4998 (var-deref "jolt.passes.types.lattice" "join")) (_a$4999 (jolt-first rets)) (_a$5000 (jolt-rest rets))) (jolt-reduce _a$4998 _a$4999 _a$5000))))) (let* ((_o$5002 ret) (_o$5003 (jolt-assoc node (keyword #f "arities") (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (r) (let fnrec5001 ((r r)) (jolt-invoke (var-deref "jolt.passes.types" "nd") r))) res)))) (jolt-vector _o$5002 _o$5003))))))) infer-fn-seeded)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "infer-pred-fold" (letrec ((infer-pred-fold (lambda (node fnode cn args tenv env) (let fnrec5004 ((node node) (fnode fnode) (cn cn) (args args) (tenv tenv) (env env)) (let* ((ar (jolt-invoke (var-deref "jolt.passes.types" "infer") (jolt-nth args 0) tenv env)) (v (jolt-invoke (var-deref "jolt.passes.types" "pred-on") cn (jolt-invoke (var-deref "jolt.passes.types" "ty") ar)))) (if (jolt-truthy? (let* ((and__25__auto (jolt-not (jolt-invoke (var-deref "clojure.core" "nil?") v)))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.types" "pure-node?") (jolt-invoke (var-deref "jolt.passes.types" "nd") ar)) and__25__auto))) (let* ((_o$5009 (keyword #f "any")) (_o$5010 (let* ((_o$5005 (keyword #f "op")) (_o$5006 (keyword #f "const")) (_o$5007 (keyword #f "val")) (_o$5008 v)) (jolt-hash-map _o$5005 _o$5006 _o$5007 _o$5008)))) (jolt-vector _o$5009 _o$5010)) (let* ((_o$5011 (jolt-invoke (var-deref "jolt.passes.types" "call-ret-type") fnode env)) (_o$5012 (jolt-assoc node (keyword #f "args") (jolt-vector (jolt-invoke (var-deref "jolt.passes.types" "nd") ar))))) (jolt-vector _o$5011 _o$5012)))))))) infer-pred-fold)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "infer-kw-lookup" (letrec ((infer-kw-lookup (lambda (node fnode args n tenv env) (let fnrec5013 ((node node) (fnode fnode) (args args) (n n) (tenv tenv) (env env)) (let* ((mr (jolt-invoke (var-deref "jolt.passes.types" "infer") (jolt-nth args 0) tenv env)) (mt (jolt-invoke (var-deref "jolt.passes.types" "ty") mr)) (msub (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "struct-safe?") mt)) (jolt-invoke (var-deref "jolt.passes.types.lattice" "mark-struct") (jolt-invoke (var-deref "jolt.passes.types" "nd") mr) mt) (jolt-invoke (var-deref "jolt.passes.types" "nd") mr))) (ft (jolt-invoke (var-deref "jolt.passes.types.lattice" "field-type") mt (jolt-get fnode (keyword #f "val")))) (dr (if (jolt= n 2) (jolt-invoke (var-deref "jolt.passes.types" "infer") (jolt-nth args 1) tenv env) jolt-nil))) (let* ((_o$5016 (if (jolt-truthy? dr) (jolt-invoke (var-deref "jolt.passes.types.lattice" "join") ft (jolt-invoke (var-deref "jolt.passes.types" "ty") dr)) ft)) (_o$5017 (jolt-assoc node (keyword #f "args") (if (jolt-truthy? dr) (let* ((_o$5014 msub) (_o$5015 (jolt-invoke (var-deref "jolt.passes.types" "nd") dr))) (jolt-vector _o$5014 _o$5015)) (jolt-vector msub))))) (jolt-vector _o$5016 _o$5017))))))) infer-kw-lookup)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "infer-get-lookup" (letrec ((infer-get-lookup (lambda (node args n tenv env) (let fnrec5018 ((node node) (args args) (n n) (tenv tenv) (env env)) (let* ((mr (jolt-invoke (var-deref "jolt.passes.types" "infer") (jolt-nth args 0) tenv env)) (mt (jolt-invoke (var-deref "jolt.passes.types" "ty") mr)) (msub (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "struct-safe?") mt)) (jolt-invoke (var-deref "jolt.passes.types.lattice" "mark-struct") (jolt-invoke (var-deref "jolt.passes.types" "nd") mr) mt) (jolt-invoke (var-deref "jolt.passes.types" "nd") mr))) (kr (jolt-invoke (var-deref "jolt.passes.types" "infer") (jolt-nth args 1) tenv env)) (ft (jolt-invoke (var-deref "jolt.passes.types.lattice" "field-type") mt (jolt-get (jolt-nth args 1) (keyword #f "val")))) (dr (if (jolt= n 3) (jolt-invoke (var-deref "jolt.passes.types" "infer") (jolt-nth args 2) tenv env) jolt-nil))) (let* ((_o$5024 (if (jolt-truthy? dr) (jolt-invoke (var-deref "jolt.passes.types.lattice" "join") ft (jolt-invoke (var-deref "jolt.passes.types" "ty") dr)) ft)) (_o$5025 (jolt-assoc node (keyword #f "args") (if (jolt-truthy? dr) (let* ((_o$5019 msub) (_o$5020 (jolt-invoke (var-deref "jolt.passes.types" "nd") kr)) (_o$5021 (jolt-invoke (var-deref "jolt.passes.types" "nd") dr))) (jolt-vector _o$5019 _o$5020 _o$5021)) (let* ((_o$5022 msub) (_o$5023 (jolt-invoke (var-deref "jolt.passes.types" "nd") kr))) (jolt-vector _o$5022 _o$5023)))))) (jolt-vector _o$5024 _o$5025))))))) infer-get-lookup)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "infer-reduce-hof" (letrec ((infer-reduce-hof (lambda (node args n tenv env) (let fnrec5026 ((node node) (args args) (n n) (tenv tenv) (env env)) (let* ((three (>= n 3)) (coll-r (jolt-invoke (var-deref "jolt.passes.types" "infer") (jolt-nth args (if (jolt-truthy? three) 2 1)) tenv env)) (init-r (if (jolt-truthy? three) (jolt-invoke (var-deref "jolt.passes.types" "infer") (jolt-nth args 1) tenv env) jolt-nil)) (et (let* ((ct (jolt-invoke (var-deref "jolt.passes.types" "ty") coll-r))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "vec-type?") ct)) (jolt-invoke (var-deref "jolt.passes.types.lattice" "velem") ct) (keyword #f "any")))) (init-t (if (jolt-truthy? init-r) (jolt-invoke (var-deref "jolt.passes.types" "ty") init-r) (keyword #f "any"))) (fn-r (let* ((_a$5031 (var-deref "jolt.passes.types" "infer-fn-seeded")) (_a$5032 (jolt-nth args 0)) (_a$5033 (let* ((_o$5027 0) (_o$5028 init-t) (_o$5029 1) (_o$5030 et)) (jolt-hash-map _o$5027 _o$5028 _o$5029 _o$5030))) (_a$5034 tenv) (_a$5035 env)) (jolt-invoke _a$5031 _a$5032 _a$5033 _a$5034 _a$5035)))) (let* ((_o$5041 (jolt-invoke (var-deref "jolt.passes.types.lattice" "join") init-t (jolt-invoke (var-deref "jolt.passes.types" "ty") fn-r))) (_o$5042 (jolt-assoc node (keyword #f "args") (if (jolt-truthy? three) (let* ((_o$5036 (jolt-invoke (var-deref "jolt.passes.types" "nd") fn-r)) (_o$5037 (jolt-invoke (var-deref "jolt.passes.types" "nd") init-r)) (_o$5038 (jolt-invoke (var-deref "jolt.passes.types" "nd") coll-r))) (jolt-vector _o$5036 _o$5037 _o$5038)) (let* ((_o$5039 (jolt-invoke (var-deref "jolt.passes.types" "nd") fn-r)) (_o$5040 (jolt-invoke (var-deref "jolt.passes.types" "nd") coll-r))) (jolt-vector _o$5039 _o$5040)))))) (jolt-vector _o$5041 _o$5042))))))) infer-reduce-hof)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "infer-seq-hof" (letrec ((infer-seq-hof (lambda (node cn args tenv env) (let fnrec5043 ((node node) (cn cn) (args args) (tenv tenv) (env env)) (let* ((coll-r (jolt-invoke (var-deref "jolt.passes.types" "infer") (jolt-nth args 1) tenv env)) (et (let* ((ct (jolt-invoke (var-deref "jolt.passes.types" "ty") coll-r))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "vec-type?") ct)) (jolt-invoke (var-deref "jolt.passes.types.lattice" "velem") ct) (keyword #f "any")))) (fn-r (let* ((_a$5046 (var-deref "jolt.passes.types" "infer-fn-seeded")) (_a$5047 (jolt-nth args 0)) (_a$5048 (let* ((_o$5044 (jolt-get (jolt-get (var-deref "jolt.passes.types" "hof-table") cn) (keyword #f "epos"))) (_o$5045 et)) (jolt-hash-map _o$5044 _o$5045))) (_a$5049 tenv) (_a$5050 env)) (jolt-invoke _a$5046 _a$5047 _a$5048 _a$5049 _a$5050))) (rt (if (jolt= cn "mapv") (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-vec") (jolt-invoke (var-deref "jolt.passes.types" "ty") fn-r)) (if (jolt= cn "filterv") (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-vec") et) (if (jolt-truthy? (keyword #f "else")) (keyword #f "any") jolt-nil))))) (let* ((_o$5053 rt) (_o$5054 (jolt-assoc node (keyword #f "args") (let* ((_o$5051 (jolt-invoke (var-deref "jolt.passes.types" "nd") fn-r)) (_o$5052 (jolt-invoke (var-deref "jolt.passes.types" "nd") coll-r))) (jolt-vector _o$5051 _o$5052))))) (jolt-vector _o$5053 _o$5054))))))) infer-seq-hof)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "infer-conj-into" (letrec ((infer-conj-into (lambda (node fnode cn args n tenv env) (let fnrec5055 ((node node) (fnode fnode) (cn cn) (args args) (n n) (tenv tenv) (env env)) (let* ((ares (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (a) (let fnrec5056 ((a a)) (jolt-invoke (var-deref "jolt.passes.types" "infer") a tenv env))) args)) (base (jolt-invoke (var-deref "jolt.passes.types" "ty") (jolt-nth ares 0))) (rest-ts (let* ((_a$5058 (var-deref "clojure.core" "mapv")) (_a$5059 (lambda (r) (let fnrec5057 ((r r)) (jolt-invoke (var-deref "jolt.passes.types" "ty") r)))) (_a$5060 (jolt-rest ares))) (jolt-invoke _a$5058 _a$5059 _a$5060))) (rt (if (jolt-truthy? (let* ((and__25__auto (jolt= cn "conj"))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.types.lattice" "vec-type?") base) and__25__auto))) (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-vec") (jolt-reduce (var-deref "jolt.passes.types.lattice" "join") (jolt-invoke (var-deref "jolt.passes.types.lattice" "velem") base) rest-ts)) (if (jolt-truthy? (let* ((and__25__auto (jolt= cn "into"))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.types.lattice" "vec-type?") base))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= 2 n))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.types.lattice" "vec-type?") (jolt-nth rest-ts 0)) and__25__auto)) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-vec") (let* ((_a$5061 (var-deref "jolt.passes.types.lattice" "join")) (_a$5062 (jolt-invoke (var-deref "jolt.passes.types.lattice" "velem") base)) (_a$5063 (jolt-invoke (var-deref "jolt.passes.types.lattice" "velem") (jolt-nth rest-ts 0)))) (jolt-invoke _a$5061 _a$5062 _a$5063))) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "jolt.passes.types" "call-ret-type") fnode env) jolt-nil))))) (let* ((_o$5065 rt) (_o$5066 (jolt-assoc node (keyword #f "args") (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (r) (let fnrec5064 ((r r)) (jolt-invoke (var-deref "jolt.passes.types" "nd") r))) ares)))) (jolt-vector _o$5065 _o$5066))))))) infer-conj-into)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "infer-call" (letrec ((infer-call (lambda (node fnode iscall-var cn args n tenv env) (let fnrec5067 ((node node) (fnode fnode) (iscall-var iscall-var) (cn cn) (args args) (n n) (tenv tenv) (env env)) (let* ((fr (if (jolt-not iscall-var) (jolt-invoke (var-deref "jolt.passes.types" "infer") fnode tenv env) jolt-nil)) (fnode_PRIME_ (if (jolt-truthy? iscall-var) fnode (jolt-invoke (var-deref "jolt.passes.types" "nd") fr))) (callee-t (if (jolt-truthy? iscall-var) (let* ((_a$5068 (jolt-get env (keyword #f "vtypes"))) (_a$5069 (jolt-invoke (var-deref "jolt.passes.types" "var-key") fnode))) (jolt-get _a$5068 _a$5069)) (jolt-invoke (var-deref "jolt.passes.types" "ty") fr))) (ares (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (a) (let fnrec5070 ((a a)) (jolt-invoke (var-deref "jolt.passes.types" "infer") a tenv env))) args))) (begin (if (jolt-truthy? iscall-var) (let* ((_a$5074 (var-deref "clojure.core" "swap!")) (_a$5075 (jolt-get env (keyword #f "calls"))) (_a$5076 jolt-conj) (_a$5077 (let* ((_o$5072 (jolt-invoke (var-deref "jolt.passes.types" "var-key") fnode)) (_o$5073 (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (r) (let fnrec5071 ((r r)) (jolt-invoke (var-deref "jolt.passes.types" "ty") r))) ares))) (jolt-vector _o$5072 _o$5073)))) (jolt-invoke _a$5074 _a$5075 _a$5076 _a$5077)) jolt-nil) (if (jolt-truthy? (jolt-get env (keyword #f "checking?"))) (let* ((ats (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (r) (let fnrec5078 ((r r)) (jolt-invoke (var-deref "jolt.passes.types" "ty") r))) ares)) (pos (jolt-get node (keyword #f "pos")))) (begin (if (jolt-truthy? cn) (jolt-invoke (var-deref "jolt.passes.types.check" "check-invoke") cn args ats pos env) jolt-nil) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.check" "not-callable?") callee-t)) (let* ((_a$5087 (var-deref "clojure.core" "swap!")) (_a$5088 (jolt-get env (keyword #f "diags"))) (_a$5089 jolt-conj) (_a$5090 (let* ((_o$5079 (keyword #f "op")) (_o$5080 (keyword #f "call")) (_o$5081 (keyword #f "type")) (_o$5082 (jolt-invoke (var-deref "jolt.passes.types.check" "type-name") callee-t)) (_o$5083 (keyword #f "pos")) (_o$5084 pos) (_o$5085 (keyword #f "msg")) (_o$5086 (jolt-invoke (var-deref "clojure.core" "str") "cannot call " (jolt-invoke (var-deref "jolt.passes.types.check" "type-name") callee-t) " as a function"))) (jolt-hash-map _o$5079 _o$5080 _o$5081 _o$5082 _o$5083 _o$5084 _o$5085 _o$5086)))) (jolt-invoke _a$5087 _a$5088 _a$5089 _a$5090)) jolt-nil) (if (jolt-truthy? (let* ((and__25__auto (jolt-get env (keyword #f "strict?")))) (if (jolt-truthy? and__25__auto) iscall-var and__25__auto))) (let* ((k (jolt-invoke (var-deref "jolt.passes.types" "var-key") fnode)) (usig (jolt-get (jolt-invoke (var-deref "clojure.core" "deref") (jolt-get env (keyword #f "user-sigs"))) k))) (if (jolt-truthy? usig) (jolt-invoke (var-deref "jolt.passes.types" "check-user-call") k usig ats pos env) jolt-nil)) jolt-nil))) jolt-nil) (let* ((pm (let* ((and__25__auto iscall-var)) (if (jolt-truthy? and__25__auto) (let* ((_a$5091 (jolt-get env (keyword #f "protocol-methods"))) (_a$5092 (jolt-invoke (var-deref "jolt.passes.types" "var-key") fnode))) (jolt-get _a$5091 _a$5092)) and__25__auto))) (rtype (if (jolt-truthy? (let* ((and__25__auto pm)) (if (jolt-truthy? and__25__auto) (jolt-pos? n) and__25__auto))) (jolt-get (jolt-invoke (var-deref "jolt.passes.types" "ty") (jolt-nth ares 0)) (keyword #f "type")) jolt-nil)) (base (jolt-assoc node (keyword #f "fn") fnode_PRIME_ (keyword #f "args") (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (r) (let fnrec5093 ((r r)) (jolt-invoke (var-deref "jolt.passes.types" "nd") r))) ares)))) (let* ((_o$5101 (if (jolt= cn "range") (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-vec") (keyword #f "num")) (if (jolt-truthy? (let* ((and__25__auto cn)) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-contains? (var-deref "jolt.passes.types" "elem-fns") cn))) (if (jolt-truthy? and__25__auto) (> n 0) and__25__auto)) and__25__auto))) (let* ((a0 (jolt-invoke (var-deref "jolt.passes.types" "ty") (jolt-nth ares 0)))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "vec-type?") a0)) (jolt-invoke (var-deref "jolt.passes.types.lattice" "velem") a0) (keyword #f "any"))) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "jolt.passes.types" "call-ret-type") fnode env) jolt-nil)))) (_o$5102 (if (jolt-truthy? rtype) (let* ((_a$5094 base) (_a$5095 (keyword #f "devirt-type")) (_a$5096 rtype) (_a$5097 (keyword #f "devirt-proto")) (_a$5098 (jolt-nth pm 0)) (_a$5099 (keyword #f "devirt-method")) (_a$5100 (jolt-nth pm 1))) (jolt-assoc _a$5094 _a$5095 _a$5096 _a$5097 _a$5098 _a$5099 _a$5100)) base))) (jolt-vector _o$5101 _o$5102))))))))) infer-call)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "infer-invoke" (letrec ((infer-invoke (lambda (node tenv env) (let fnrec5103 ((node node) (tenv tenv) (env env)) (let* ((fnode (jolt-get node (keyword #f "fn"))) (iscall-var (jolt= (keyword #f "var") (jolt-get fnode (keyword #f "op")))) (cn (if (jolt-truthy? (let* ((and__25__auto iscall-var)) (if (jolt-truthy? and__25__auto) (jolt= "clojure.core" (jolt-get fnode (keyword #f "ns"))) and__25__auto))) (jolt-get fnode (keyword #f "name")) jolt-nil)) (args (jolt-get node (keyword #f "args"))) (n (jolt-count args))) (if (jolt-truthy? (let* ((and__25__auto iscall-var)) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-contains? (var-deref "jolt.passes.types" "fold-preds") cn))) (if (jolt-truthy? and__25__auto) (jolt= n 1) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "jolt.passes.types" "infer-pred-fold") node fnode cn args tenv env) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.fold" "kw-callee?") fnode))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (>= n 1))) (if (jolt-truthy? and__25__auto) (<= n 2) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "jolt.passes.types" "infer-kw-lookup") node fnode args n tenv env) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.passes.fold" "get-callee?") fnode))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (>= n 2))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= (keyword #f "const") (jolt-get (jolt-nth args 1) (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "keyword?") (jolt-get (jolt-nth args 1) (keyword #f "val"))) and__25__auto)) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "jolt.passes.types" "infer-get-lookup") node args n tenv env) (if (jolt-truthy? (let* ((and__25__auto (jolt= cn "reduce"))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (>= n 2))) (if (jolt-truthy? and__25__auto) (jolt= (keyword #f "fn") (jolt-get (jolt-nth args 0) (keyword #f "op"))) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "jolt.passes.types" "infer-reduce-hof") node args n tenv env) (if (jolt-truthy? (let* ((and__25__auto cn)) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-get (var-deref "jolt.passes.types" "hof-table") cn))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (>= n 2))) (if (jolt-truthy? and__25__auto) (jolt= (keyword #f "fn") (jolt-get (jolt-nth args 0) (keyword #f "op"))) and__25__auto)) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "jolt.passes.types" "infer-seq-hof") node cn args tenv env) (if (jolt-truthy? (let* ((and__25__auto (let* ((or__26__auto (jolt= cn "conj"))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= cn "into"))))) (if (jolt-truthy? and__25__auto) (>= n 1) and__25__auto))) (jolt-invoke (var-deref "jolt.passes.types" "infer-conj-into") node fnode cn args n tenv env) (if (jolt-truthy? (keyword #f "else")) (jolt-invoke (var-deref "jolt.passes.types" "infer-call") node fnode iscall-var cn args n tenv env) jolt-nil)))))))))))) infer-invoke)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "infer" (letrec ((infer (lambda (node tenv env) (let fnrec5104 ((node node) (tenv tenv) (env env)) (let* ((op (jolt-get node (keyword #f "op")))) (if (jolt= op (keyword #f "const")) (let* ((_o$5105 (let* ((v (jolt-get node (keyword #f "val")))) (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "number?") v)) (keyword #f "num") (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "string?") v)) (keyword #f "str") (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "keyword?") v)) (keyword #f "kw") (if (jolt-truthy? (let* ((or__26__auto (jolt-invoke (var-deref "clojure.core" "nil?") v))) (if (jolt-truthy? or__26__auto) or__26__auto (jolt= #f v)))) (keyword #f "any") (if (jolt-truthy? (keyword #f "else")) (keyword #f "truthy") jolt-nil))))))) (_o$5106 node)) (jolt-vector _o$5105 _o$5106)) (if (jolt= op (keyword #f "local")) (let* ((t (jolt-get tenv (jolt-get node (keyword #f "name"))))) (let* ((_o$5107 (if (jolt-truthy? t) t (keyword #f "any"))) (_o$5108 (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "struct-safe?") t)) (let* ((n (jolt-assoc node (keyword #f "hint") (keyword #f "struct")))) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "type-shape") t)) (jolt-assoc n (keyword #f "shape") (jolt-invoke (var-deref "jolt.passes.types.lattice" "type-shape") t)) n)) (if (jolt-truthy? (jolt-invoke (var-deref "jolt.passes.types.lattice" "vec-type?") t)) (jolt-assoc node (keyword #f "hint") (keyword #f "vector")) (if (jolt-truthy? (keyword #f "else")) node jolt-nil))))) (jolt-vector _o$5107 _o$5108))) (if (jolt= op (keyword #f "map")) (let* ((pairs (jolt-get node (keyword #f "pairs"))) (res (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (pr) (let fnrec5109 ((pr pr)) (let* ((kr (jolt-invoke infer (jolt-nth pr 0) tenv env)) (vr (jolt-invoke infer (jolt-nth pr 1) tenv env))) (let* ((_o$5110 (jolt-nth kr 1)) (_o$5111 (jolt-nth vr 1)) (_o$5112 (jolt-nth vr 0)) (_o$5113 (jolt-get (jolt-nth pr 0) (keyword #f "val")))) (jolt-vector _o$5110 _o$5111 _o$5112 _o$5113))))) pairs)) (struct? (let* ((and__25__auto (> (jolt-count res) 0))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-invoke (var-deref "clojure.core" "every?") (lambda (pr) (let fnrec5114 ((pr pr)) (jolt-invoke (var-deref "jolt.passes.fold" "scalar-const?") (jolt-nth pr 0)))) pairs))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "every?") (lambda (r) (let fnrec5115 ((r r)) (jolt-invoke (var-deref "jolt.passes.types.lattice" "truthy-type?") (jolt-nth r 2)))) res) and__25__auto)) and__25__auto))) (base (if (jolt-truthy? struct?) (jolt-invoke (var-deref "jolt.passes.types.lattice" "cap") (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-struct") (let* ((_a$5120 (lambda (m r) (let fnrec5116 ((m m) (r r)) (let* ((_a$5117 m) (_a$5118 (jolt-nth r 3)) (_a$5119 (jolt-nth r 2))) (jolt-assoc _a$5117 _a$5118 _a$5119))))) (_a$5121 (jolt-hash-map)) (_a$5122 res)) (jolt-reduce _a$5120 _a$5121 _a$5122))) (var-deref "jolt.passes.types.lattice" "type-depth")) jolt-nil)) (shp (if (jolt-truthy? (let* ((and__25__auto (jolt-get env (keyword #f "map-shapes?")))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto base)) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes.types.lattice" "struct-type?") base) and__25__auto)) and__25__auto))) (jolt-invoke (var-deref "jolt.passes.types.lattice" "shape-order") (jolt-keys (jolt-invoke (var-deref "jolt.passes.types.lattice" "sfields") base))) jolt-nil)) (t (if (jolt-truthy? base) (if (jolt-truthy? shp) (jolt-assoc base (keyword #f "shape") shp) base) (keyword #f "any"))) (node_PRIME_ (jolt-assoc node (keyword #f "pairs") (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (r) (let fnrec5123 ((r r)) (let* ((_o$5124 (jolt-nth r 0)) (_o$5125 (jolt-nth r 1))) (jolt-vector _o$5124 _o$5125)))) res)))) (let* ((_o$5126 t) (_o$5127 (if (jolt-truthy? shp) (jolt-assoc node_PRIME_ (keyword #f "shape") shp) node_PRIME_))) (jolt-vector _o$5126 _o$5127))) (if (jolt= op (keyword #f "vector")) (let* ((irs (let* ((_a$5129 (var-deref "clojure.core" "mapv")) (_a$5130 (lambda (x) (let fnrec5128 ((x x)) (jolt-invoke infer x tenv env)))) (_a$5131 (jolt-get node (keyword #f "items")))) (jolt-invoke _a$5129 _a$5130 _a$5131))) (ets (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (r) (let fnrec5132 ((r r)) (jolt-nth r 0))) irs)) (el (if (jolt-empty? ets) (keyword #f "any") (let* ((_a$5133 (var-deref "jolt.passes.types.lattice" "join")) (_a$5134 (jolt-first ets)) (_a$5135 (jolt-rest ets))) (jolt-reduce _a$5133 _a$5134 _a$5135))))) (let* ((_o$5137 (jolt-invoke (var-deref "jolt.passes.types.lattice" "cap") (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-vec") el) (var-deref "jolt.passes.types.lattice" "type-depth"))) (_o$5138 (jolt-assoc node (keyword #f "items") (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (r) (let fnrec5136 ((r r)) (jolt-nth r 1))) irs)))) (jolt-vector _o$5137 _o$5138))) (if (jolt= op (keyword #f "set")) (let* ((irs (let* ((_a$5140 (var-deref "clojure.core" "mapv")) (_a$5141 (lambda (x) (let fnrec5139 ((x x)) (jolt-invoke infer x tenv env)))) (_a$5142 (jolt-get node (keyword #f "items")))) (jolt-invoke _a$5140 _a$5141 _a$5142))) (ets (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (r) (let fnrec5143 ((r r)) (jolt-nth r 0))) irs)) (el (if (jolt-empty? ets) (keyword #f "any") (let* ((_a$5144 (var-deref "jolt.passes.types.lattice" "join")) (_a$5145 (jolt-first ets)) (_a$5146 (jolt-rest ets))) (jolt-reduce _a$5144 _a$5145 _a$5146))))) (let* ((_o$5148 (jolt-invoke (var-deref "jolt.passes.types.lattice" "cap") (jolt-invoke (var-deref "jolt.passes.types.lattice" "mk-set") el) (var-deref "jolt.passes.types.lattice" "type-depth"))) (_o$5149 (jolt-assoc node (keyword #f "items") (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (r) (let fnrec5147 ((r r)) (jolt-nth r 1))) irs)))) (jolt-vector _o$5148 _o$5149))) (if (jolt= op (keyword #f "if")) (let* ((tr (jolt-invoke infer (jolt-get node (keyword #f "test")) tenv env)) (thn (jolt-invoke infer (jolt-get node (keyword #f "then")) tenv env)) (els (jolt-invoke infer (jolt-get node (keyword #f "else")) tenv env))) (let* ((_o$5160 (let* ((_a$5150 (var-deref "jolt.passes.types.lattice" "join")) (_a$5151 (jolt-nth thn 0)) (_a$5152 (jolt-nth els 0))) (jolt-invoke _a$5150 _a$5151 _a$5152))) (_o$5161 (let* ((_a$5153 node) (_a$5154 (keyword #f "test")) (_a$5155 (jolt-nth tr 1)) (_a$5156 (keyword #f "then")) (_a$5157 (jolt-nth thn 1)) (_a$5158 (keyword #f "else")) (_a$5159 (jolt-nth els 1))) (jolt-assoc _a$5153 _a$5154 _a$5155 _a$5156 _a$5157 _a$5158 _a$5159)))) (jolt-vector _o$5160 _o$5161))) (if (jolt= op (keyword #f "do")) (let* ((stmts (let* ((_a$5163 (var-deref "clojure.core" "mapv")) (_a$5164 (lambda (s) (let fnrec5162 ((s s)) (jolt-nth (jolt-invoke infer s tenv env) 1)))) (_a$5165 (jolt-get node (keyword #f "statements")))) (jolt-invoke _a$5163 _a$5164 _a$5165))) (r (jolt-invoke infer (jolt-get node (keyword #f "ret")) tenv env))) (let* ((_o$5166 (jolt-nth r 0)) (_o$5167 (jolt-assoc node (keyword #f "statements") stmts (keyword #f "ret") (jolt-nth r 1)))) (jolt-vector _o$5166 _o$5167))) (if (jolt= op (keyword #f "throw")) (let* ((_o$5168 (keyword #f "any")) (_o$5169 (jolt-assoc node (keyword #f "expr") (jolt-nth (jolt-invoke infer (jolt-get node (keyword #f "expr")) tenv env) 1)))) (jolt-vector _o$5168 _o$5169)) (if (jolt= op (keyword #f "var")) (begin (let* ((_a$5170 (var-deref "clojure.core" "swap!")) (_a$5171 (jolt-get env (keyword #f "escapes"))) (_a$5172 jolt-conj) (_a$5173 (jolt-invoke (var-deref "jolt.passes.types" "var-key") node))) (jolt-invoke _a$5170 _a$5171 _a$5172 _a$5173)) (let* ((_o$5176 (let* ((vt (let* ((_a$5174 (jolt-get env (keyword #f "vtypes"))) (_a$5175 (jolt-invoke (var-deref "jolt.passes.types" "var-key") node))) (jolt-get _a$5174 _a$5175)))) (if (jolt-truthy? vt) vt (keyword #f "any")))) (_o$5177 node)) (jolt-vector _o$5176 _o$5177))) (if (jolt= op (keyword #f "invoke")) (jolt-invoke (var-deref "jolt.passes.types" "infer-invoke") node tenv env) (if (jolt= op (keyword #f "let")) (let* ((res (let* ((_a$5188 (lambda (acc b) (let fnrec5178 ((acc acc) (b b)) (let* ((te (jolt-nth acc 0)) (binds (jolt-nth acc 1)) (ir (jolt-invoke infer (jolt-nth b 1) te env))) (let* ((_o$5184 (let* ((_a$5179 te) (_a$5180 (jolt-nth b 0)) (_a$5181 (jolt-nth ir 0))) (jolt-assoc _a$5179 _a$5180 _a$5181))) (_o$5185 (jolt-conj binds (let* ((_o$5182 (jolt-nth b 0)) (_o$5183 (jolt-nth ir 1))) (jolt-vector _o$5182 _o$5183))))) (jolt-vector _o$5184 _o$5185)))))) (_a$5189 (let* ((_o$5186 tenv) (_o$5187 (jolt-vector))) (jolt-vector _o$5186 _o$5187))) (_a$5190 (jolt-get node (keyword #f "bindings")))) (jolt-reduce _a$5188 _a$5189 _a$5190))) (br (let* ((_a$5191 infer) (_a$5192 (jolt-get node (keyword #f "body"))) (_a$5193 (jolt-nth res 0)) (_a$5194 env)) (jolt-invoke _a$5191 _a$5192 _a$5193 _a$5194)))) (let* ((_o$5200 (jolt-nth br 0)) (_o$5201 (let* ((_a$5195 node) (_a$5196 (keyword #f "bindings")) (_a$5197 (jolt-nth res 1)) (_a$5198 (keyword #f "body")) (_a$5199 (jolt-nth br 1))) (jolt-assoc _a$5195 _a$5196 _a$5197 _a$5198 _a$5199)))) (jolt-vector _o$5200 _o$5201))) (if (jolt= op (keyword #f "loop")) (let* ((_o$5213 (keyword #f "any")) (_o$5214 (let* ((_a$5208 node) (_a$5209 (keyword #f "bindings")) (_a$5210 (let* ((_a$5205 (var-deref "clojure.core" "mapv")) (_a$5206 (lambda (b) (let fnrec5202 ((b b)) (let* ((_o$5203 (jolt-nth b 0)) (_o$5204 (jolt-nth (jolt-invoke infer (jolt-nth b 1) tenv env) 1))) (jolt-vector _o$5203 _o$5204))))) (_a$5207 (jolt-get node (keyword #f "bindings")))) (jolt-invoke _a$5205 _a$5206 _a$5207))) (_a$5211 (keyword #f "body")) (_a$5212 (jolt-nth (jolt-invoke infer (jolt-get node (keyword #f "body")) tenv env) 1))) (jolt-assoc _a$5208 _a$5209 _a$5210 _a$5211 _a$5212)))) (jolt-vector _o$5213 _o$5214)) (if (jolt= op (keyword #f "recur")) (let* ((_o$5219 (keyword #f "any")) (_o$5220 (jolt-assoc node (keyword #f "args") (let* ((_a$5216 (var-deref "clojure.core" "mapv")) (_a$5217 (lambda (a) (let fnrec5215 ((a a)) (jolt-nth (jolt-invoke infer a tenv env) 1)))) (_a$5218 (jolt-get node (keyword #f "args")))) (jolt-invoke _a$5216 _a$5217 _a$5218))))) (jolt-vector _o$5219 _o$5220)) (if (jolt= op (keyword #f "fn")) (let* ((_o$5236 (keyword #f "any")) (_o$5237 (jolt-assoc node (keyword #f "arities") (let* ((_a$5233 (var-deref "clojure.core" "mapv")) (_a$5234 (lambda (a) (let fnrec5221 ((a a)) (let* ((shapes (jolt-get env (keyword #f "record-shapes"))) (phm (let* ((_a$5226 (lambda (m pr) (let fnrec5222 ((m m) (pr pr)) (let* ((_a$5223 m) (_a$5224 (jolt-nth pr 0)) (_a$5225 (jolt-nth pr 1))) (jolt-assoc _a$5223 _a$5224 _a$5225))))) (_a$5227 (jolt-hash-map)) (_a$5228 (jolt-get a (keyword #f "phints")))) (jolt-reduce _a$5226 _a$5227 _a$5228))) (pe (let* ((_a$5230 (lambda (e p) (let fnrec5229 ((e e) (p p)) (jolt-assoc e p (let* ((ent (jolt-get shapes (jolt-get phm p)))) (if (jolt-truthy? ent) (jolt-invoke (var-deref "jolt.passes.types" "record-type-from-entry") ent (var-deref "jolt.passes.types.lattice" "type-depth") shapes) (keyword #f "any"))))))) (_a$5231 tenv) (_a$5232 (jolt-get a (keyword #f "params")))) (jolt-reduce _a$5230 _a$5231 _a$5232))) (pe (if (jolt-truthy? (jolt-get a (keyword #f "rest"))) (jolt-assoc pe (jolt-get a (keyword #f "rest")) (keyword #f "any")) pe))) (jolt-assoc a (keyword #f "body") (jolt-nth (jolt-invoke infer (jolt-get a (keyword #f "body")) pe env) 1)))))) (_a$5235 (jolt-get node (keyword #f "arities")))) (jolt-invoke _a$5233 _a$5234 _a$5235))))) (jolt-vector _o$5236 _o$5237)) (if (jolt= op (keyword #f "def")) (begin (if (jolt-truthy? (jolt-get env (keyword #f "checking?"))) (jolt-invoke (var-deref "jolt.passes.types.check" "register-user-fn!") node env) jolt-nil) (let* ((_o$5238 (keyword #f "any")) (_o$5239 (jolt-assoc node (keyword #f "init") (jolt-nth (jolt-invoke infer (jolt-get node (keyword #f "init")) tenv env) 1)))) (jolt-vector _o$5238 _o$5239))) (if (jolt= op (keyword #f "try")) (let* ((_o$5247 (keyword #f "any")) (_o$5248 (let* ((_a$5240 node) (_a$5241 (keyword #f "body")) (_a$5242 (jolt-nth (jolt-invoke infer (jolt-get node (keyword #f "body")) tenv env) 1)) (_a$5243 (keyword #f "catch-body")) (_a$5244 (if (jolt-truthy? (jolt-get node (keyword #f "catch-body"))) (jolt-nth (jolt-invoke infer (jolt-get node (keyword #f "catch-body")) tenv env) 1) jolt-nil)) (_a$5245 (keyword #f "finally")) (_a$5246 (if (jolt-truthy? (jolt-get node (keyword #f "finally"))) (jolt-nth (jolt-invoke infer (jolt-get node (keyword #f "finally")) tenv env) 1) jolt-nil))) (jolt-assoc _a$5240 _a$5241 _a$5242 _a$5243 _a$5244 _a$5245 _a$5246)))) (jolt-vector _o$5247 _o$5248)) (if (jolt-truthy? (keyword #f "else")) (let* ((_o$5249 (keyword #f "any")) (_o$5250 node)) (jolt-vector _o$5249 _o$5250)) jolt-nil)))))))))))))))))))))) infer)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "infer-top" (letrec ((infer-top (lambda (node env) (let fnrec5251 ((node node) (env env)) (jolt-nth (jolt-invoke (var-deref "jolt.passes.types" "infer") node (jolt-hash-map) env) 1))))) infer-top)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "all-any-env" (letrec ((all-any-env (lambda (params) (let fnrec5252 ((params params)) (let* ((_a$5254 (lambda (e p) (let fnrec5253 ((e e) (p p)) (jolt-assoc e p (keyword #f "any"))))) (_a$5255 (jolt-hash-map)) (_a$5256 params)) (jolt-reduce _a$5254 _a$5255 _a$5256)))))) all-any-env)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "isolated-diag-count" (letrec ((isolated-diag-count (lambda (body tenv env) (let fnrec5257 ((body body) (tenv tenv) (env env)) (let* ((sub (jolt-assoc env (keyword #f "diags") (jolt-invoke (var-deref "clojure.core" "atom") (jolt-vector))))) (begin (jolt-invoke (var-deref "jolt.passes.types" "infer") body tenv sub) (jolt-count (jolt-invoke (var-deref "clojure.core" "deref") (jolt-get sub (keyword #f "diags")))))))))) isolated-diag-count)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "check-user-call" (letrec ((check-user-call (lambda (key sig arg-types pos env) (let fnrec5258 ((key key) (sig sig) (arg-types arg-types) (pos pos) (env env)) (let* ((cset (jolt-get env (keyword #f "checking-set")))) (if (jolt-not (jolt-contains? (jolt-invoke (var-deref "clojure.core" "deref") cset) key)) (let* ((prev (jolt-invoke (var-deref "clojure.core" "deref") cset))) (begin (jolt-invoke (var-deref "clojure.core" "reset!") cset (jolt-conj prev key)) (let* ((params (jolt-get sig (keyword #f "params"))) (body (jolt-get sig (keyword #f "body"))) (npar (jolt-count params)) (nargs (jolt-count arg-types)) (memo (jolt-get env (keyword #f "diag-memo")))) (if (jolt-truthy? (jolt-invoke (var-deref "clojure.core" "not=") npar nargs)) (let* ((_a$5267 (var-deref "clojure.core" "swap!")) (_a$5268 (jolt-get env (keyword #f "diags"))) (_a$5269 jolt-conj) (_a$5270 (let* ((_o$5259 (keyword #f "op")) (_o$5260 (keyword #f "user-call")) (_o$5261 (keyword #f "type")) (_o$5262 (keyword #f "arity")) (_o$5263 (keyword #f "pos")) (_o$5264 pos) (_o$5265 (keyword #f "msg")) (_o$5266 (jolt-invoke (var-deref "clojure.core" "str") "wrong number of args (" nargs ") passed to `" (jolt-get sig (keyword #f "name")) "` (expected " npar ")"))) (jolt-hash-map _o$5259 _o$5260 _o$5261 _o$5262 _o$5263 _o$5264 _o$5265 _o$5266)))) (jolt-invoke _a$5267 _a$5268 _a$5269 _a$5270)) (let* ((base-env (jolt-invoke (var-deref "jolt.passes.types" "all-any-env") params)) (base (let* ((bk (let* ((_o$5271 (keyword #f "base")) (_o$5272 key)) (jolt-vector _o$5271 _o$5272)))) (if (jolt-contains? (jolt-invoke (var-deref "clojure.core" "deref") memo) bk) (jolt-get (jolt-invoke (var-deref "clojure.core" "deref") memo) bk) (let* ((b (jolt-invoke (var-deref "jolt.passes.types" "isolated-diag-count") body base-env env))) (begin (jolt-invoke (var-deref "clojure.core" "swap!") memo jolt-assoc bk b) b)))))) (let* ((_a$5300 (lambda (_ i) (let fnrec5273 ((_ _) (i i)) (begin (let* ((at (jolt-nth arg-types i))) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "clojure.core" "not=") at (keyword #f "any")))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "clojure.core" "not=") at (keyword #f "truthy")) and__25__auto))) (let* ((mk (let* ((_o$5274 (keyword #f "arg")) (_o$5275 key) (_o$5276 i) (_o$5277 at)) (jolt-vector _o$5274 _o$5275 _o$5276 _o$5277))) (rejects (if (jolt-contains? (jolt-invoke (var-deref "clojure.core" "deref") memo) mk) (jolt-get (jolt-invoke (var-deref "clojure.core" "deref") memo) mk) (let* ((r (> (jolt-invoke (var-deref "jolt.passes.types" "isolated-diag-count") body (jolt-assoc base-env (jolt-nth params i) at) env) base))) (begin (jolt-invoke (var-deref "clojure.core" "swap!") memo jolt-assoc mk r) r))))) (if (jolt-truthy? rejects) (let* ((_a$5296 (var-deref "clojure.core" "swap!")) (_a$5297 (jolt-get env (keyword #f "diags"))) (_a$5298 jolt-conj) (_a$5299 (let* ((_o$5286 (keyword #f "op")) (_o$5287 (keyword #f "user-call")) (_o$5288 (keyword #f "argpos")) (_o$5289 i) (_o$5290 (keyword #f "type")) (_o$5291 (jolt-invoke (var-deref "jolt.passes.types.check" "type-name") at)) (_o$5292 (keyword #f "pos")) (_o$5293 pos) (_o$5294 (keyword #f "msg")) (_o$5295 (let* ((_a$5278 (var-deref "clojure.core" "str")) (_a$5279 "argument ") (_a$5280 (jolt-inc i)) (_a$5281 " to `") (_a$5282 (jolt-get sig (keyword #f "name"))) (_a$5283 "` is ") (_a$5284 (jolt-invoke (var-deref "jolt.passes.types.check" "type-name") at)) (_a$5285 ", which its body provably rejects")) (jolt-invoke _a$5278 _a$5279 _a$5280 _a$5281 _a$5282 _a$5283 _a$5284 _a$5285)))) (jolt-hash-map _o$5286 _o$5287 _o$5288 _o$5289 _o$5290 _o$5291 _o$5292 _o$5293 _o$5294 _o$5295)))) (jolt-invoke _a$5296 _a$5297 _a$5298 _a$5299)) jolt-nil)) jolt-nil)) jolt-nil)))) (_a$5301 jolt-nil) (_a$5302 (jolt-range npar))) (jolt-reduce _a$5300 _a$5301 _a$5302))))) (jolt-invoke (var-deref "clojure.core" "reset!") cset prev))) jolt-nil)))))) check-user-call)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "set-rtenv!" (letrec ((set-rtenv! (lambda (m) (let fnrec5303 ((m m)) (jolt-invoke (var-deref "clojure.core" "swap!") (var-deref "jolt.passes.types" "config-box") jolt-assoc (keyword #f "rtenv") (let* ((or__26__auto m)) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-hash-map)))))))) set-rtenv!)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "set-record-shapes!" (letrec ((set-record-shapes! (lambda (m) (let fnrec5304 ((m m)) (jolt-invoke (var-deref "clojure.core" "swap!") (var-deref "jolt.passes.types" "config-box") jolt-assoc (keyword #f "record-shapes") (let* ((or__26__auto m)) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-hash-map)))))))) set-record-shapes!)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "set-protocol-methods!" (letrec ((set-protocol-methods! (lambda (m) (let fnrec5305 ((m m)) (jolt-invoke (var-deref "clojure.core" "swap!") (var-deref "jolt.passes.types" "config-box") jolt-assoc (keyword #f "protocol-methods") (let* ((or__26__auto m)) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-hash-map)))))))) set-protocol-methods!)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "set-map-shapes!" (letrec ((set-map-shapes! (lambda (b) (let fnrec5306 ((b b)) (jolt-invoke (var-deref "clojure.core" "swap!") (var-deref "jolt.passes.types" "config-box") jolt-assoc (keyword #f "map-shapes?") (jolt-invoke (var-deref "clojure.core" "boolean") b)))))) set-map-shapes!)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "set-vtypes!" (letrec ((set-vtypes! (lambda (m) (let fnrec5307 ((m m)) (jolt-invoke (var-deref "clojure.core" "swap!") (var-deref "jolt.passes.types" "config-box") jolt-assoc (keyword #f "vtypes") (let* ((or__26__auto m)) (if (jolt-truthy? or__26__auto) or__26__auto (jolt-hash-map)))))))) set-vtypes!)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "join-types" (letrec ((join-types (lambda (a b) (let fnrec5308 ((a a) (b b)) (jolt-invoke (var-deref "jolt.passes.types.lattice" "join-t") a b))))) join-types)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "reset-escapes!" (letrec ((reset-escapes! (lambda () (let fnrec5309 () (jolt-invoke (var-deref "clojure.core" "reset!") (var-deref "jolt.passes.types" "escapes-box") (jolt-hash-set)))))) reset-escapes!)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "collected-escapes" (letrec ((collected-escapes (lambda () (let fnrec5310 () (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.passes.types" "escapes-box"))))))) collected-escapes)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "check-form" (letrec ((check-form (case-lambda ((node) (let fnrec5311 ((node node)) (jolt-invoke check-form node #f))) ((node strict?) (let fnrec5312 ((node node) (strict? strict?)) (let* ((env (jolt-invoke (var-deref "jolt.passes.types" "mk-env") #t strict?))) (begin (jolt-invoke (var-deref "jolt.passes.types" "infer") node (jolt-hash-map) env) (jolt-invoke (var-deref "clojure.core" "vec") (jolt-invoke (var-deref "clojure.core" "deref") (jolt-get env (keyword #f "diags"))))))))))) check-form)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "infer-body" (letrec ((infer-body (lambda (body tenv) (let fnrec5313 ((body body) (tenv tenv)) (let* ((env (jolt-invoke (var-deref "jolt.passes.types" "mk-env") #f #f)) (r (jolt-invoke (var-deref "jolt.passes.types" "infer") body tenv env))) (let* ((_o$5314 (jolt-nth r 0)) (_o$5315 (jolt-nth r 1)) (_o$5316 (jolt-invoke (var-deref "clojure.core" "deref") (jolt-get env (keyword #f "calls"))))) (jolt-vector _o$5314 _o$5315 _o$5316))))))) infer-body)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "reinfer-def" (letrec ((reinfer-def (lambda (def-node ptmap) (let fnrec5317 ((def-node def-node) (ptmap ptmap)) (let* ((fnode (jolt-get def-node (keyword #f "init"))) (env (jolt-invoke (var-deref "jolt.passes.types" "mk-env") #f #f)) (shapes (jolt-get env (keyword #f "record-shapes")))) (if (jolt= (keyword #f "fn") (jolt-get fnode (keyword #f "op"))) (jolt-assoc def-node (keyword #f "init") (jolt-assoc fnode (keyword #f "arities") (let* ((_a$5323 (var-deref "clojure.core" "mapv")) (_a$5324 (lambda (a) (let fnrec5318 ((a a)) (let* ((pt (let* ((_a$5320 (lambda (m pr) (let fnrec5319 ((m m) (pr pr)) (let* ((nm (jolt-nth pr 0)) (e (jolt-get shapes (jolt-nth pr 1)))) (if (jolt-truthy? (let* ((and__25__auto e)) (if (jolt-truthy? and__25__auto) (jolt-not (jolt-contains? m nm)) and__25__auto))) (jolt-assoc m nm (jolt-invoke (var-deref "jolt.passes.types" "record-type-from-entry") e (var-deref "jolt.passes.types.lattice" "type-depth") shapes)) m))))) (_a$5321 ptmap) (_a$5322 (jolt-get a (keyword #f "phints")))) (jolt-reduce _a$5320 _a$5321 _a$5322)))) (jolt-assoc a (keyword #f "body") (jolt-nth (jolt-invoke (var-deref "jolt.passes.types" "infer") (jolt-get a (keyword #f "body")) pt env) 1)))))) (_a$5325 (jolt-get fnode (keyword #f "arities")))) (jolt-invoke _a$5323 _a$5324 _a$5325)))) def-node)))))) reinfer-def)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "phint-seed" (letrec ((phint-seed (lambda (params phints) (let fnrec5326 ((params params) (phints phints)) (let* ((shapes (jolt-get (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.passes.types" "config-box")) (keyword #f "record-shapes"))) (m (let* ((_a$5331 (lambda (acc pr) (let fnrec5327 ((acc acc) (pr pr)) (let* ((_a$5328 acc) (_a$5329 (jolt-nth pr 0)) (_a$5330 (jolt-nth pr 1))) (jolt-assoc _a$5328 _a$5329 _a$5330))))) (_a$5332 (jolt-hash-map)) (_a$5333 phints)) (jolt-reduce _a$5331 _a$5332 _a$5333)))) (jolt-invoke (var-deref "clojure.core" "mapv") (lambda (nm) (let fnrec5334 ((nm nm)) (let* ((ck (jolt-get m nm)) (e (let* ((and__25__auto ck)) (if (jolt-truthy? and__25__auto) (jolt-get shapes ck) and__25__auto)))) (if (jolt-truthy? e) (jolt-invoke (var-deref "jolt.passes.types" "record-type-from-entry") e (var-deref "jolt.passes.types.lattice" "type-depth") shapes) jolt-nil)))) params)))))) phint-seed)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "set-check-mode!" (letrec ((set-check-mode! (lambda (on strict?) (let fnrec5335 ((on on) (strict? strict?)) (jolt-invoke (var-deref "clojure.core" "reset!") (var-deref "jolt.passes.types" "check-mode-box") (let* ((_o$5336 (keyword #f "on")) (_o$5337 (if (jolt-truthy? on) #t #f)) (_o$5338 (keyword #f "strict")) (_o$5339 (if (jolt-truthy? strict?) #t #f))) (jolt-hash-map _o$5336 _o$5337 _o$5338 _o$5339))))))) set-check-mode!)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "take-diags!" (letrec ((take-diags! (lambda () (let fnrec5340 () (let* ((d (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.passes.types" "last-diags-box")))) (begin (jolt-invoke (var-deref "clojure.core" "reset!") (var-deref "jolt.passes.types" "last-diags-box") (jolt-vector)) d)))))) take-diags!)))
(guard (e (#t #f))
  (def-var! "jolt.passes.types" "run-inference" (letrec ((run-inference (lambda (opt) (let fnrec5341 ((opt opt)) (if (jolt-truthy? (jolt-get (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.passes.types" "check-mode-box")) (keyword #f "on"))) (let* ((env (jolt-invoke (var-deref "jolt.passes.types" "mk-env") #t (jolt-get (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.passes.types" "check-mode-box")) (keyword #f "strict")))) (r (jolt-invoke (var-deref "jolt.passes.types" "infer-top") opt env))) (begin (jolt-invoke (var-deref "clojure.core" "reset!") (var-deref "jolt.passes.types" "last-diags-box") (jolt-invoke (var-deref "clojure.core" "deref") (jolt-get env (keyword #f "diags")))) r)) (jolt-invoke (var-deref "jolt.passes.types" "infer-top") opt (jolt-invoke (var-deref "jolt.passes.types" "mk-env") #f #f))))))) run-inference)))
(guard (e (#t #f))
  (def-var-with-meta! "jolt.passes" "inline-fixpoint-cap" 8 (jolt-hash-map (keyword #f "private") #t)))
(guard (e (#t #f))
  (def-var! "jolt.passes" "inline-eligible?" (letrec ((inline-eligible? (lambda (node) (let fnrec5342 ((node node)) (let* ((and__25__auto (jolt= (keyword #f "def") (jolt-get node (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt-get node (keyword #f "init")))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= (keyword #f "fn") (jolt-get (jolt-get node (keyword #f "init")) (keyword #f "op"))))) (if (jolt-truthy? and__25__auto) (let* ((and__25__auto (jolt= 1 (jolt-count (jolt-get (jolt-get node (keyword #f "init")) (keyword #f "arities")))))) (if (jolt-truthy? and__25__auto) (jolt-not (jolt-get (jolt-first (jolt-get (jolt-get node (keyword #f "init")) (keyword #f "arities"))) (keyword #f "rest"))) and__25__auto)) and__25__auto)) and__25__auto)) and__25__auto)))))) inline-eligible?)))
(guard (e (#t #f))
  (def-var! "jolt.passes" "stash-of" (letrec ((stash-of (lambda (node) (let fnrec5343 ((node node)) (let* ((a (jolt-first (jolt-get (jolt-get node (keyword #f "init")) (keyword #f "arities"))))) (let* ((_o$5344 (keyword #f "params")) (_o$5345 (jolt-get a (keyword #f "params"))) (_o$5346 (keyword #f "body")) (_o$5347 (jolt-get a (keyword #f "body"))) (_o$5348 (keyword #f "nhints")) (_o$5349 (jolt-get a (keyword #f "nhints"))) (_o$5350 (keyword #f "ret")) (_o$5351 (jolt-get a (keyword #f "ret-nhint")))) (jolt-hash-map _o$5344 _o$5345 _o$5346 _o$5347 _o$5348 _o$5349 _o$5350 _o$5351))))))) stash-of)))
(guard (e (#t #f))
  (def-var! "jolt.passes" "run-passes" (letrec ((run-passes (lambda (node ctx) (let fnrec5352 ((node node) (ctx ctx)) (begin (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "jolt.host" "inline-enabled?") ctx))) (if (jolt-truthy? and__25__auto) (jolt-invoke (var-deref "jolt.passes" "inline-eligible?") node) and__25__auto))) (let* ((_a$5353 (var-deref "jolt.host" "stash-inline!")) (_a$5354 ctx) (_a$5355 (jolt-get node (keyword #f "ns"))) (_a$5356 (jolt-get node (keyword #f "name"))) (_a$5357 (jolt-invoke (var-deref "jolt.passes" "stash-of") node))) (jolt-invoke _a$5353 _a$5354 _a$5355 _a$5356 _a$5357)) jolt-nil) (jolt-invoke (var-deref "jolt.passes.numeric" "annotate") (if (jolt-truthy? (jolt-invoke (var-deref "jolt.host" "inline-enabled?") ctx)) (let* ((_ (jolt-invoke (var-deref "jolt.passes.inline" "set-rec-shapes!") (jolt-invoke (var-deref "jolt.host" "record-shapes") ctx))) (_ (jolt-invoke (var-deref "jolt.passes.types" "set-record-shapes!") (jolt-invoke (var-deref "jolt.host" "record-shapes") ctx))) (opt (let* ((i 0) (n (jolt-invoke (var-deref "jolt.passes.fold" "const-fold") node))) (let loop5358 ((i i) (n n)) (begin (jolt-invoke (var-deref "clojure.core" "reset!") (var-deref "jolt.passes.inline" "dirty") #f) (let* ((n2 (jolt-invoke (var-deref "jolt.passes.fold" "const-fold") (jolt-invoke (var-deref "jolt.passes.inline" "scalar-replace") (jolt-invoke (var-deref "jolt.passes.inline" "flatten-lets") (jolt-invoke (var-deref "jolt.passes.inline" "inline-node") n ctx)))))) (if (jolt-truthy? (let* ((and__25__auto (jolt-invoke (var-deref "clojure.core" "deref") (var-deref "jolt.passes.inline" "dirty")))) (if (jolt-truthy? and__25__auto) (< i (var-deref "jolt.passes" "inline-fixpoint-cap")) and__25__auto))) (loop5358 (jolt-inc i) n2) n2))))))) (jolt-invoke (var-deref "jolt.passes.fold" "const-fold") (jolt-invoke (var-deref "jolt.passes.types" "run-inference") opt))) (jolt-invoke (var-deref "jolt.passes.fold" "const-fold") node)))))))) run-passes)))