Full Code of exaloop/codon for AI

develop f1cd7006ad65 cached
612 files
6.3 MB
1.7M tokens
2352 symbols
1 requests
Download .txt
Showing preview only (6,662K chars total). Download the full file or copy to clipboard to get everything.
Repository: exaloop/codon
Branch: develop
Commit: f1cd7006ad65
Files: 612
Total size: 6.3 MB

Directory structure:
gitextract_o7k99b34/

├── .clang-format
├── .clang-tidy
├── .gitattributes
├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       └── ci.yml
├── .gitignore
├── .pre-commit-config.yaml
├── CMakeLists.txt
├── CODEOWNERS
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── bench/
│   ├── README.md
│   ├── codon/
│   │   ├── binary_trees.codon
│   │   ├── binary_trees.cpp
│   │   ├── binary_trees.py
│   │   ├── chaos.codon
│   │   ├── chaos.py
│   │   ├── fannkuch.codon
│   │   ├── fannkuch.py
│   │   ├── float.py
│   │   ├── go.codon
│   │   ├── go.py
│   │   ├── mandelbrot.codon
│   │   ├── mandelbrot.py
│   │   ├── nbody.cpp
│   │   ├── nbody.py
│   │   ├── npbench.codon
│   │   ├── npbench_lib.codon
│   │   ├── primes.codon
│   │   ├── primes.py
│   │   ├── set_partition.cpp
│   │   ├── set_partition.py
│   │   ├── spectral_norm.py
│   │   ├── sum.py
│   │   ├── taq.cpp
│   │   ├── taq.py
│   │   ├── word_count.cpp
│   │   └── word_count.py
│   └── run.sh
├── cmake/
│   ├── CMakeRC.cmake
│   ├── backtrace-config.h.in
│   ├── backtrace-supported.h.in
│   ├── config.h.in
│   ├── config.py.in
│   └── deps.cmake
├── codon/
│   ├── app/
│   │   └── main.cpp
│   ├── cir/
│   │   ├── analyze/
│   │   │   ├── analysis.cpp
│   │   │   ├── analysis.h
│   │   │   ├── dataflow/
│   │   │   │   ├── capture.cpp
│   │   │   │   ├── capture.h
│   │   │   │   ├── cfg.cpp
│   │   │   │   ├── cfg.h
│   │   │   │   ├── dominator.cpp
│   │   │   │   ├── dominator.h
│   │   │   │   ├── reaching.cpp
│   │   │   │   └── reaching.h
│   │   │   └── module/
│   │   │       ├── global_vars.cpp
│   │   │       ├── global_vars.h
│   │   │       ├── side_effect.cpp
│   │   │       └── side_effect.h
│   │   ├── attribute.cpp
│   │   ├── attribute.h
│   │   ├── base.cpp
│   │   ├── base.h
│   │   ├── cir.h
│   │   ├── const.cpp
│   │   ├── const.h
│   │   ├── dsl/
│   │   │   ├── codegen.h
│   │   │   ├── nodes.cpp
│   │   │   └── nodes.h
│   │   ├── flow.cpp
│   │   ├── flow.h
│   │   ├── func.cpp
│   │   ├── func.h
│   │   ├── instr.cpp
│   │   ├── instr.h
│   │   ├── llvm/
│   │   │   ├── gpu.cpp
│   │   │   ├── gpu.h
│   │   │   ├── llvisitor.cpp
│   │   │   ├── llvisitor.h
│   │   │   ├── llvm.h
│   │   │   ├── native/
│   │   │   │   ├── native.cpp
│   │   │   │   ├── native.h
│   │   │   │   └── targets/
│   │   │   │       ├── aarch64.cpp
│   │   │   │       ├── aarch64.h
│   │   │   │       ├── arm.cpp
│   │   │   │       ├── arm.h
│   │   │   │       ├── target.h
│   │   │   │       ├── x86.cpp
│   │   │   │       └── x86.h
│   │   │   ├── optimize.cpp
│   │   │   └── optimize.h
│   │   ├── module.cpp
│   │   ├── module.h
│   │   ├── pyextension.h
│   │   ├── transform/
│   │   │   ├── cleanup/
│   │   │   │   ├── canonical.cpp
│   │   │   │   ├── canonical.h
│   │   │   │   ├── dead_code.cpp
│   │   │   │   ├── dead_code.h
│   │   │   │   ├── global_demote.cpp
│   │   │   │   ├── global_demote.h
│   │   │   │   ├── replacer.cpp
│   │   │   │   └── replacer.h
│   │   │   ├── folding/
│   │   │   │   ├── const_fold.cpp
│   │   │   │   ├── const_fold.h
│   │   │   │   ├── const_prop.cpp
│   │   │   │   ├── const_prop.h
│   │   │   │   ├── folding.cpp
│   │   │   │   ├── folding.h
│   │   │   │   └── rule.h
│   │   │   ├── lowering/
│   │   │   │   ├── async_for.cpp
│   │   │   │   ├── async_for.h
│   │   │   │   ├── await.cpp
│   │   │   │   ├── await.h
│   │   │   │   ├── imperative.cpp
│   │   │   │   ├── imperative.h
│   │   │   │   ├── pipeline.cpp
│   │   │   │   └── pipeline.h
│   │   │   ├── manager.cpp
│   │   │   ├── manager.h
│   │   │   ├── numpy/
│   │   │   │   ├── expr.cpp
│   │   │   │   ├── forward.cpp
│   │   │   │   ├── indexing.cpp
│   │   │   │   ├── indexing.h
│   │   │   │   ├── numpy.cpp
│   │   │   │   └── numpy.h
│   │   │   ├── parallel/
│   │   │   │   ├── openmp.cpp
│   │   │   │   ├── openmp.h
│   │   │   │   ├── schedule.cpp
│   │   │   │   └── schedule.h
│   │   │   ├── pass.cpp
│   │   │   ├── pass.h
│   │   │   ├── pythonic/
│   │   │   │   ├── dict.cpp
│   │   │   │   ├── dict.h
│   │   │   │   ├── generator.cpp
│   │   │   │   ├── generator.h
│   │   │   │   ├── io.cpp
│   │   │   │   ├── io.h
│   │   │   │   ├── list.cpp
│   │   │   │   ├── list.h
│   │   │   │   ├── str.cpp
│   │   │   │   └── str.h
│   │   │   └── rewrite.h
│   │   ├── types/
│   │   │   ├── types.cpp
│   │   │   └── types.h
│   │   ├── util/
│   │   │   ├── cloning.cpp
│   │   │   ├── cloning.h
│   │   │   ├── context.h
│   │   │   ├── format.cpp
│   │   │   ├── format.h
│   │   │   ├── inlining.cpp
│   │   │   ├── inlining.h
│   │   │   ├── irtools.cpp
│   │   │   ├── irtools.h
│   │   │   ├── iterators.h
│   │   │   ├── matching.cpp
│   │   │   ├── matching.h
│   │   │   ├── operator.h
│   │   │   ├── outlining.cpp
│   │   │   ├── outlining.h
│   │   │   ├── packs.h
│   │   │   ├── side_effect.cpp
│   │   │   ├── side_effect.h
│   │   │   ├── visitor.cpp
│   │   │   └── visitor.h
│   │   ├── value.cpp
│   │   ├── value.h
│   │   ├── var.cpp
│   │   └── var.h
│   ├── compiler/
│   │   ├── compiler.cpp
│   │   ├── compiler.h
│   │   ├── debug_listener.cpp
│   │   ├── debug_listener.h
│   │   ├── engine.cpp
│   │   ├── engine.h
│   │   ├── error.cpp
│   │   ├── error.h
│   │   ├── jit.cpp
│   │   ├── jit.h
│   │   ├── jit_extern.h
│   │   ├── memory_manager.cpp
│   │   └── memory_manager.h
│   ├── config/
│   │   └── .gitignore
│   ├── dsl/
│   │   ├── dsl.h
│   │   ├── plugins.cpp
│   │   └── plugins.h
│   ├── parser/
│   │   ├── ast/
│   │   │   ├── attr.cpp
│   │   │   ├── attr.h
│   │   │   ├── error.h
│   │   │   ├── expr.cpp
│   │   │   ├── expr.h
│   │   │   ├── node.h
│   │   │   ├── stmt.cpp
│   │   │   ├── stmt.h
│   │   │   ├── types/
│   │   │   │   ├── class.cpp
│   │   │   │   ├── class.h
│   │   │   │   ├── function.cpp
│   │   │   │   ├── function.h
│   │   │   │   ├── link.cpp
│   │   │   │   ├── link.h
│   │   │   │   ├── static.cpp
│   │   │   │   ├── static.h
│   │   │   │   ├── traits.cpp
│   │   │   │   ├── traits.h
│   │   │   │   ├── type.cpp
│   │   │   │   ├── type.h
│   │   │   │   ├── union.cpp
│   │   │   │   └── union.h
│   │   │   └── types.h
│   │   ├── ast.h
│   │   ├── cache.cpp
│   │   ├── cache.h
│   │   ├── common.cpp
│   │   ├── common.h
│   │   ├── ctx.h
│   │   ├── match.cpp
│   │   ├── match.h
│   │   ├── peg/
│   │   │   ├── grammar.peg
│   │   │   ├── openmp.peg
│   │   │   ├── peg.cpp
│   │   │   ├── peg.h
│   │   │   └── rules.h
│   │   └── visitors/
│   │       ├── doc/
│   │       │   ├── doc.cpp
│   │       │   └── doc.h
│   │       ├── format/
│   │       │   ├── format.cpp
│   │       │   └── format.h
│   │       ├── scoping/
│   │       │   ├── scoping.cpp
│   │       │   └── scoping.h
│   │       ├── translate/
│   │       │   ├── translate.cpp
│   │       │   ├── translate.h
│   │       │   ├── translate_ctx.cpp
│   │       │   └── translate_ctx.h
│   │       ├── typecheck/
│   │       │   ├── access.cpp
│   │       │   ├── assign.cpp
│   │       │   ├── basic.cpp
│   │       │   ├── call.cpp
│   │       │   ├── class.cpp
│   │       │   ├── collections.cpp
│   │       │   ├── cond.cpp
│   │       │   ├── ctx.cpp
│   │       │   ├── ctx.h
│   │       │   ├── error.cpp
│   │       │   ├── function.cpp
│   │       │   ├── import.cpp
│   │       │   ├── infer.cpp
│   │       │   ├── loops.cpp
│   │       │   ├── op.cpp
│   │       │   ├── special.cpp
│   │       │   ├── typecheck.cpp
│   │       │   └── typecheck.h
│   │       ├── visitor.cpp
│   │       └── visitor.h
│   ├── runtime/
│   │   ├── exc.cpp
│   │   ├── floatlib/
│   │   │   ├── extenddftf2.c
│   │   │   ├── extendhfsf2.c
│   │   │   ├── extendhftf2.c
│   │   │   ├── extendsfdf2.c
│   │   │   ├── extendsftf2.c
│   │   │   ├── fp_extend.h
│   │   │   ├── fp_extend_impl.inc
│   │   │   ├── fp_lib.h
│   │   │   ├── fp_trunc.h
│   │   │   ├── fp_trunc_impl.inc
│   │   │   ├── int_endianness.h
│   │   │   ├── int_lib.h
│   │   │   ├── int_math.h
│   │   │   ├── int_types.h
│   │   │   ├── int_util.h
│   │   │   ├── truncdfbf2.c
│   │   │   ├── truncdfhf2.c
│   │   │   ├── truncdfsf2.c
│   │   │   ├── truncsfbf2.c
│   │   │   ├── truncsfhf2.c
│   │   │   ├── trunctfdf2.c
│   │   │   ├── trunctfhf2.c
│   │   │   └── trunctfsf2.c
│   │   ├── lib.cpp
│   │   ├── lib.h
│   │   ├── numpy/
│   │   │   ├── loops.cpp
│   │   │   ├── sort.cpp
│   │   │   └── zmath.cpp
│   │   └── re.cpp
│   └── util/
│       ├── common.cpp
│       ├── common.h
│       ├── jupyter.cpp
│       ├── jupyter.h
│       ├── peg2cpp.cpp
│       ├── serialize.h
│       └── tser.h
├── docs/
│   ├── css/
│   │   └── extra.css
│   ├── developers/
│   │   ├── build.md
│   │   ├── compilation.md
│   │   ├── contribute.md
│   │   ├── extend.md
│   │   ├── ir.md
│   │   └── roadmap.md
│   ├── img/
│   │   └── image.avif
│   ├── index.md
│   ├── integrations/
│   │   ├── cpp/
│   │   │   ├── codon-from-cpp.md
│   │   │   ├── cpp-from-codon.md
│   │   │   └── jit.md
│   │   ├── jupyter.md
│   │   └── python/
│   │       ├── codon-from-python.md
│   │       ├── extensions.md
│   │       └── python-from-codon.md
│   ├── js/
│   │   └── mathjax.js
│   ├── labs/
│   │   ├── catalog/
│   │   │   └── start.md
│   │   └── index.md
│   ├── language/
│   │   ├── classes.md
│   │   ├── generics.md
│   │   ├── llvm.md
│   │   ├── lowlevel.md
│   │   ├── meta.md
│   │   └── overview.md
│   ├── libraries/
│   │   ├── api/
│   │   │   └── .gitignore
│   │   ├── numpy.md
│   │   └── stdlib.md
│   ├── overrides/
│   │   └── main.html
│   ├── parallel/
│   │   ├── gpu.md
│   │   ├── multithreading.md
│   │   └── simd.md
│   └── start/
│       ├── changelog.md
│       ├── faq.md
│       ├── install.md
│       └── usage.md
├── jit/
│   ├── .gitignore
│   ├── MANIFEST.in
│   ├── README.md
│   ├── codon/
│   │   ├── __init__.py
│   │   ├── decorator.py
│   │   ├── jit.pxd
│   │   └── jit.pyx
│   ├── pyproject.toml
│   └── setup.py
├── jupyter/
│   ├── CMakeLists.txt
│   ├── jupyter.cpp
│   ├── jupyter.h
│   ├── share/
│   │   └── jupyter/
│   │       └── kernels/
│   │           └── codon/
│   │               └── kernel.json.in
│   └── xeus.patch
├── mkdocs.yml
├── scripts/
│   ├── Dockerfile.codon-build
│   ├── Dockerfile.codon-jupyter
│   ├── Dockerfile.gpu
│   ├── Dockerfile.llvm-build
│   ├── deps.sh
│   ├── docgen.py
│   ├── fix_loader_paths.sh
│   ├── get_system_libs.sh
│   └── install.sh
├── stdlib/
│   ├── algorithms/
│   │   ├── heapsort.codon
│   │   ├── insertionsort.codon
│   │   ├── pdqsort.codon
│   │   ├── qsort.codon
│   │   ├── strings.codon
│   │   └── timsort.codon
│   ├── asyncio.codon
│   ├── bisect.codon
│   ├── bz2.codon
│   ├── cmath.codon
│   ├── codon/
│   │   └── static.codon
│   ├── collections.codon
│   ├── copy.codon
│   ├── datetime.codon
│   ├── functools.codon
│   ├── getopt.codon
│   ├── gpu.codon
│   ├── gzip.codon
│   ├── heapq.codon
│   ├── internal/
│   │   ├── __init__.codon
│   │   ├── __init_test__.codon
│   │   ├── attributes.codon
│   │   ├── builtin.codon
│   │   ├── c_stubs.codon
│   │   ├── core.codon
│   │   ├── dlopen.codon
│   │   ├── file.codon
│   │   ├── format.codon
│   │   ├── gc.codon
│   │   ├── gpu.codon
│   │   ├── internal.codon
│   │   ├── khash.codon
│   │   ├── pynumerics.codon
│   │   ├── python.codon
│   │   ├── sort.codon
│   │   ├── static.codon
│   │   ├── str.codon
│   │   └── types/
│   │       ├── any.codon
│   │       ├── array.codon
│   │       ├── bool.codon
│   │       ├── byte.codon
│   │       ├── collections/
│   │       │   ├── dict.codon
│   │       │   ├── list.codon
│   │       │   ├── set.codon
│   │       │   └── tuple.codon
│   │       ├── complex.codon
│   │       ├── ellipsis.codon
│   │       ├── error.codon
│   │       ├── float.codon
│   │       ├── function.codon
│   │       ├── generator.codon
│   │       ├── import_.codon
│   │       ├── int.codon
│   │       ├── intn.codon
│   │       ├── optional.codon
│   │       ├── ptr.codon
│   │       ├── range.codon
│   │       ├── rtti.codon
│   │       ├── slice.codon
│   │       ├── str.codon
│   │       ├── strbuf.codon
│   │       ├── tuple.codon
│   │       ├── type.codon
│   │       └── union.codon
│   ├── itertools.codon
│   ├── math.codon
│   ├── numpy/
│   │   ├── __init__.codon
│   │   ├── const.codon
│   │   ├── dragon4.codon
│   │   ├── dtype.codon
│   │   ├── emath.codon
│   │   ├── fft/
│   │   │   ├── __init__.codon
│   │   │   └── pocketfft.codon
│   │   ├── format.codon
│   │   ├── functional.codon
│   │   ├── fusion.codon
│   │   ├── indexing.codon
│   │   ├── interp.codon
│   │   ├── lib/
│   │   │   ├── __init__.codon
│   │   │   ├── arraysetops.codon
│   │   │   └── stride_tricks.codon
│   │   ├── linalg/
│   │   │   ├── __init__.codon
│   │   │   ├── blas.codon
│   │   │   └── linalg.codon
│   │   ├── linalg_sym.codon
│   │   ├── misc.codon
│   │   ├── ndarray.codon
│   │   ├── ndgpu.codon
│   │   ├── ndmath.codon
│   │   ├── npdatetime.codon
│   │   ├── npio.codon
│   │   ├── operators.codon
│   │   ├── pybridge.codon
│   │   ├── random/
│   │   │   ├── __init__.codon
│   │   │   ├── bitgen.codon
│   │   │   ├── logfactorial.codon
│   │   │   ├── mt19937.codon
│   │   │   ├── pcg64.codon
│   │   │   ├── philox.codon
│   │   │   ├── seed.codon
│   │   │   ├── sfc64.codon
│   │   │   ├── splitmix64.codon
│   │   │   └── ziggurat.codon
│   │   ├── reductions.codon
│   │   ├── routines.codon
│   │   ├── sorting.codon
│   │   ├── statistics.codon
│   │   ├── ufunc.codon
│   │   ├── util.codon
│   │   ├── window.codon
│   │   └── zmath.codon
│   ├── openmp.codon
│   ├── operator.codon
│   ├── os/
│   │   ├── __init__.codon
│   │   └── path.codon
│   ├── pickle.codon
│   ├── python.codon
│   ├── random.codon
│   ├── re.codon
│   ├── simd.codon
│   ├── sortedlist.codon
│   ├── statistics.codon
│   ├── string.codon
│   ├── sys.codon
│   ├── threading.codon
│   ├── time.codon
│   ├── typing.codon
│   └── unittest.codon
└── test/
    ├── CMakeLists.txt.in
    ├── app/
    │   ├── argv.codon
    │   ├── build.codon
    │   ├── exit.codon
    │   ├── export.codon
    │   ├── input.codon
    │   ├── input.txt
    │   ├── test.c
    │   └── test.sh
    ├── cir/
    │   ├── analyze/
    │   │   ├── dominator.cpp
    │   │   └── reaching.cpp
    │   ├── base.cpp
    │   ├── constant.cpp
    │   ├── flow.cpp
    │   ├── func.cpp
    │   ├── instr.cpp
    │   ├── module.cpp
    │   ├── test.h
    │   ├── transform/
    │   │   └── manager.cpp
    │   ├── types/
    │   │   └── types.cpp
    │   ├── util/
    │   │   └── matching.cpp
    │   ├── value.cpp
    │   └── var.cpp
    ├── core/
    │   ├── arguments.codon
    │   ├── arithmetic.codon
    │   ├── bltin.codon
    │   ├── containers.codon
    │   ├── empty.codon
    │   ├── exceptions.codon
    │   ├── generators.codon
    │   ├── generics.codon
    │   ├── helloworld.codon
    │   ├── match.codon
    │   ├── numerics.codon
    │   ├── parser.codon
    │   ├── pipeline.codon
    │   ├── range.codon
    │   ├── serialization.codon
    │   ├── sort.codon
    │   ├── trees.codon
    │   └── vec_simd.codon
    ├── main.cpp
    ├── numpy/
    │   ├── data/
    │   │   └── .gitignore
    │   ├── random_tests/
    │   │   ├── test_mt19937.codon
    │   │   ├── test_pcg64.codon
    │   │   ├── test_philox.codon
    │   │   └── test_sfc64.codon
    │   ├── test_dtype.codon
    │   ├── test_elision.codon
    │   ├── test_fft.codon
    │   ├── test_functional.codon
    │   ├── test_fusion.codon
    │   ├── test_indexing.codon
    │   ├── test_io.codon
    │   ├── test_lib.codon
    │   ├── test_linalg.codon
    │   ├── test_loops.codon
    │   ├── test_misc.codon
    │   ├── test_ndmath.codon
    │   ├── test_npdatetime.codon
    │   ├── test_pybridge.codon
    │   ├── test_reductions.codon
    │   ├── test_routines.codon
    │   ├── test_sorting.codon
    │   ├── test_statistics.codon
    │   ├── test_ufunc.codon
    │   └── test_window.codon
    ├── parser/
    │   ├── llvm.codon
    │   ├── simplify_expr.codon
    │   ├── simplify_stmt.codon
    │   ├── typecheck/
    │   │   ├── a/
    │   │   │   ├── __init__.codon
    │   │   │   ├── b/
    │   │   │   │   ├── __init__.codon
    │   │   │   │   ├── rec1.codon
    │   │   │   │   ├── rec1_err.codon
    │   │   │   │   ├── rec2.codon
    │   │   │   │   └── rec2_err.codon
    │   │   │   └── sub/
    │   │   │       └── __init__.codon
    │   │   ├── test_access.codon
    │   │   ├── test_assign.codon
    │   │   ├── test_basic.codon
    │   │   ├── test_call.codon
    │   │   ├── test_class.codon
    │   │   ├── test_collections.codon
    │   │   ├── test_cond.codon
    │   │   ├── test_ctx.codon
    │   │   ├── test_error.codon
    │   │   ├── test_function.codon
    │   │   ├── test_import.codon
    │   │   ├── test_infer.codon
    │   │   ├── test_loops.codon
    │   │   ├── test_op.codon
    │   │   ├── test_parser.codon
    │   │   ├── test_python.codon
    │   │   └── test_typecheck.codon
    │   ├── typecheck_expr.codon
    │   ├── typecheck_stmt.codon
    │   └── types.codon
    ├── python/
    │   ├── __init__.py
    │   ├── cython_jit.py
    │   ├── find-python-library.py
    │   ├── myextension.codon
    │   ├── myextension2.codon
    │   ├── mymodule.py
    │   ├── pybridge.codon
    │   ├── pyext.py
    │   └── setup.py
    ├── stdlib/
    │   ├── asyncio_test.codon
    │   ├── bisect_test.codon
    │   ├── cmath_test.codon
    │   ├── cmath_testcases.txt
    │   ├── datetime_test.codon
    │   ├── heapq_test.codon
    │   ├── itertools_test.codon
    │   ├── llvm_test.codon
    │   ├── math_test.codon
    │   ├── operator_test.codon
    │   ├── random_test.codon
    │   ├── re_test.codon
    │   ├── sort_test.codon
    │   ├── statistics_test.codon
    │   └── str_test.codon
    ├── transform/
    │   ├── canonical.codon
    │   ├── dict_opt.codon
    │   ├── escapes.codon
    │   ├── folding.codon
    │   ├── for_lowering.codon
    │   ├── inlining.codon
    │   ├── io_opt.codon
    │   ├── kernels.codon
    │   ├── list_opt.codon
    │   ├── omp.codon
    │   ├── outlining.codon
    │   └── str_opt.codon
    └── types.cpp

================================================
FILE CONTENTS
================================================

================================================
FILE: .clang-format
================================================
---
BasedOnStyle: LLVM
ColumnLimit: 88


================================================
FILE: .clang-tidy
================================================
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,modernize-*,bugprone-*,concurrency-*,performance-*,portability-*,-modernize-use-nodiscard,-modernize-use-trailing-return-type,-cppcoreguidelines-special-member-functions,-bugprone-easily-swappable-parameters,-bugprone-assignment-in-if-condition,-modernize-use-nodiscard'
WarningsAsErrors: false
HeaderFilterRegex: '(build/.+)|(codon/util/.+)'
AnalyzeTemporaryDtors: false
FormatStyle: llvm
CheckOptions:
  - key:             cppcoreguidelines-macro-usage.CheckCapsOnly
    value:           '1'


================================================
FILE: .gitattributes
================================================
*.codon linguist-language=Python

*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.mov binary
*.mp4 binary
*.mp3 binary
*.flv binary
*.fla binary
*.swf binary
*.gz binary
*.zip binary
*.7z binary
*.ttf binary
*.eot binary
*.woff binary
*.pyc binary
*.pdf binary

*.gz binary

*.bam binary
*.bam.bai binary
*.cram binary
*.cram.crai binary


================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "monthly"


================================================
FILE: .github/workflows/ci.yml
================================================
name: Codon CI

on:
  push:
    branches:
      - master
      - develop
    tags:
      - '*'
  pull_request:
    branches:
      - develop

jobs:
  create_release:
    name: GitHub Release
    runs-on: ubuntu-latest
    outputs:
      upload_url: ${{ steps.create_release.outputs.upload_url }}
    permissions:
      contents: write
    steps:
      - name: Create Release
        if: contains(github.ref, 'tags/v')
        id: create_release
        uses: ncipollo/release-action@v1

  build:
    strategy:
      matrix:
        include:
          - os: ubuntu-latest
            arch: linux-x86_64
          - os: ubuntu-latest
            arch: manylinux2014-x86_64
          - os: ubuntu-24.04-arm
            arch: linux-aarch64
          - os: ubuntu-24.04-arm
            arch: manylinux2014-aarch64
          - os: macos-15-intel
            arch: darwin-x86_64
          - os: macos-14
            arch: darwin-arm64
    runs-on: ${{ matrix.os }}
    name: Build Codon
    needs: create_release
    permissions:
      contents: write
      id-token: write
    steps:
      - uses: actions/checkout@v6

      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: '3.11'

      - name: Build (Ubuntu)
        if: startsWith(matrix.os, 'ubuntu')
        run: |
          (cd .github/build-linux && docker build -t local -f Dockerfile.${{ matrix.arch }} .)
          docker run -v $(pwd):/github/workspace local /github/workspace ${{ matrix.arch }} yes

      - name: Build (macOS)
        if: startsWith(matrix.os, 'macos')
        run: |
          sudo mkdir -p /opt/llvm-codon
          sudo chown -R $(whoami) /opt/llvm-codon
          curl -L https://github.com/exaloop/llvm-project/releases/download/codon-20.1.7/llvm-codon-20.1.7-${{ matrix.arch }}.tar.bz2 | tar jxf - -C /opt
          brew install gcc
          bash .github/build-linux/entrypoint.sh ${{ github.workspace }} ${{ matrix.arch }} yes

      - name: Upload Artifacts
        uses: actions/upload-artifact@v7
        with:
          name: codon-${{ matrix.arch }}.tar.gz
          path: codon-${{ matrix.arch }}.tar.gz

      - name: Upload Release Asset
        if: contains(github.ref, 'tags/v')
        uses: actions/upload-release-asset@v1.0.2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ needs.create_release.outputs.upload_url }}
          asset_path: ./codon-${{ matrix.arch }}.tar.gz
          asset_name: codon-${{ matrix.arch }}.tar.gz
          asset_content_type: application/gzip

      - name: Publish PyPI Package
        if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.arch == 'linux-x86_64'
        uses: pypa/gh-action-pypi-publish@release/v1

  build_documentation:
    name: Build Docs
    runs-on: ubuntu-latest
    needs: build
    permissions:
      contents: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v6

      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: '3.11'

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          python -m pip install mkdocs \
                                mkdocs-autorefs \
                                mkdocs-macros-plugin \
                                mkdocs-material \
                                mkdocs-material-extensions \
                                mkdocs-redirects
          sudo apt-get update
          sudo apt-get install -y pngquant

      - name: Download Artifact
        uses: actions/download-artifact@v8
        with:
          name: codon-linux-x86_64.tar.gz
          path: ./downloaded-artifact

      - name: Build API reference
        run: |
          mv downloaded-artifact/* .
          tar -xvzf codon-linux-x86_64.tar.gz
          codon-deploy-linux-x86_64/bin/codon doc codon-deploy-linux-x86_64/lib/codon/stdlib > docs.json
          python scripts/docgen.py docs.json docs/libraries/api $(pwd)/codon-deploy-linux-x86_64/lib/codon/stdlib

      - name: Build MkDocs site
        run: mkdocs build --strict

      - name: Deploy to GitHub Pages
        if: github.ref == 'refs/heads/master'
        uses: peaceiris/actions-gh-pages@v4
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./site
          force_orphan: true
          cname: docs.exaloop.io


================================================
FILE: .gitignore
================================================
######################
# Generic .gitignore #
######################

# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.a
*.obj
*.so
*.dylib
*.pyc
build*/
install*/
extra/python/src/jit.cpp
extra/jupyter/build/
/site

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built-in compression methods
*.7z
*.dmg
*.iso
*.jar
*.rar
*.tar
*.zip
**/**.egg-info

# Logs and databases #
######################
*.log
*.sql
*.sqlite

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# IDE generated files #
#######################
.idea
.mypy_cache
.vscode
.cache
.ipynb_checkpoints

# CMake generated files #
#########################
jupyter/share/jupyter/kernels/codon/kernel.json
jit/codon/version.py

# Testing files #
#################
temp/
playground/
scratch*.*
/_*


================================================
FILE: .pre-commit-config.yaml
================================================
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.5.0
    hooks:
      - id: trailing-whitespace

  - repo: https://github.com/pre-commit/mirrors-clang-format
    rev: v17.0.2
    hooks:
      - id: clang-format
        types:
          - c++


================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.14)
project(
  Codon
  VERSION "0.19.6"
  HOMEPAGE_URL "https://github.com/exaloop/codon"
  DESCRIPTION "high-performance, extensible Python compiler")
set(CODON_JIT_PYTHON_VERSION "0.4.6")
configure_file("${PROJECT_SOURCE_DIR}/cmake/config.h.in"
               "${PROJECT_SOURCE_DIR}/codon/config/config.h")
configure_file("${PROJECT_SOURCE_DIR}/cmake/config.py.in"
               "${PROJECT_SOURCE_DIR}/jit/codon/version.py")

if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
  cmake_policy(SET CMP0135 NEW)
endif()

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  set(CMAKE_CXX_FLAGS
      "${CMAKE_CXX_FLAGS} -pedantic -fvisibility-inlines-hidden -Wno-return-type-c-linkage -Wno-gnu-zero-variadic-macro-arguments -Wno-deprecated-declarations"
  )
else()
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type")
endif()
set(CMAKE_CXX_FLAGS_DEBUG "-g")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-limit-debug-info")
endif()
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
include_directories(.)

set(APPLE_ARM OFF)
if (APPLE AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
  set(APPLE_ARM ON)
endif()

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
find_package(LLVM REQUIRED)

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
include(${CMAKE_SOURCE_DIR}/cmake/deps.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/CMakeRC.cmake)

set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
if(APPLE)
  set(CMAKE_INSTALL_RPATH "@loader_path;@loader_path/../lib/codon")
else()
  set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/../lib/codon")
endif()

add_executable(peg2cpp codon/util/peg2cpp.cpp)
target_include_directories(peg2cpp PRIVATE ${peglib_SOURCE_DIR})
target_link_libraries(peg2cpp PRIVATE Threads::Threads fmt)
add_custom_command(
  OUTPUT codon_rules.cpp
  COMMAND peg2cpp ${CMAKE_SOURCE_DIR}/codon/parser/peg/grammar.peg
          codon_rules.cpp codon
  DEPENDS peg2cpp codon/parser/peg/grammar.peg)
add_custom_command(
  OUTPUT omp_rules.cpp
  COMMAND peg2cpp ${CMAKE_SOURCE_DIR}/codon/parser/peg/openmp.peg omp_rules.cpp
          omp
  DEPENDS peg2cpp codon/parser/peg/openmp.peg)

# Codon Jupyter library
set(CODON_JUPYTER_FILES codon/util/jupyter.h codon/util/jupyter.cpp)
add_library(codon_jupyter SHARED ${CODON_JUPYTER_FILES})

# Codon runtime library
add_library(codonfloat STATIC
            codon/runtime/floatlib/extenddftf2.c
            codon/runtime/floatlib/fp_trunc.h
            codon/runtime/floatlib/truncdfhf2.c
            codon/runtime/floatlib/extendhfsf2.c
            codon/runtime/floatlib/int_endianness.h
            codon/runtime/floatlib/truncdfsf2.c
            codon/runtime/floatlib/extendhftf2.c
            codon/runtime/floatlib/int_lib.h
#            codon/runtime/floatlib/truncsfbf2.c
            codon/runtime/floatlib/extendsfdf2.c
            codon/runtime/floatlib/int_math.h
            codon/runtime/floatlib/truncsfhf2.c
            codon/runtime/floatlib/extendsftf2.c
            codon/runtime/floatlib/int_types.h
            codon/runtime/floatlib/trunctfdf2.c
            codon/runtime/floatlib/fp_extend.h
            codon/runtime/floatlib/int_util.h
            codon/runtime/floatlib/trunctfhf2.c
            codon/runtime/floatlib/fp_lib.h
#            codon/runtime/floatlib/truncdfbf2.c
            codon/runtime/floatlib/trunctfsf2.c)
target_compile_options(codonfloat PRIVATE -O3)
target_compile_definitions(codonfloat PRIVATE COMPILER_RT_HAS_FLOAT16)

set(CODONRT_FILES codon/runtime/lib.h codon/runtime/lib.cpp
                  codon/runtime/re.cpp codon/runtime/exc.cpp
                  codon/runtime/numpy/sort.cpp
                  codon/runtime/numpy/loops.cpp codon/runtime/numpy/zmath.cpp)
add_library(codonrt SHARED ${CODONRT_FILES})
add_dependencies(codonrt zlibstatic gc backtrace bz2 liblzma
                         re2 hwy hwy_contrib fast_float codonfloat)

if(DEFINED ENV{CODON_SYSTEM_LIBRARIES})
  if(APPLE)
    set(copied_libgfortran "${CMAKE_BINARY_DIR}/libgfortran.5${CMAKE_SHARED_LIBRARY_SUFFIX}")
    set(copied_libquadmath "${CMAKE_BINARY_DIR}/libquadmath.0${CMAKE_SHARED_LIBRARY_SUFFIX}")
    set(copied_libgcc      "${CMAKE_BINARY_DIR}/libgcc_s.1.1${CMAKE_SHARED_LIBRARY_SUFFIX}")
  else()
    set(copied_libgfortran "${CMAKE_BINARY_DIR}/libgfortran${CMAKE_SHARED_LIBRARY_SUFFIX}.5")
    set(copied_libquadmath "${CMAKE_BINARY_DIR}/libquadmath${CMAKE_SHARED_LIBRARY_SUFFIX}.0")
    set(copied_libgcc      "${CMAKE_BINARY_DIR}/libgcc_s${CMAKE_SHARED_LIBRARY_SUFFIX}.1")
  endif()

  add_custom_command(
    OUTPUT ${copied_libgfortran}
    DEPENDS "${CMAKE_SOURCE_DIR}/scripts/get_system_libs.sh"
    COMMAND ${CMAKE_SOURCE_DIR}/scripts/get_system_libs.sh "$ENV{CODON_SYSTEM_LIBRARIES}" ${CMAKE_BINARY_DIR}
    COMMENT "Copying system libraries to build directory")

  add_custom_target(copy_libraries ALL DEPENDS ${copied_libgfortran})
  add_dependencies(codonrt copy_libraries)

  add_library(libgfortran SHARED IMPORTED)
  set_target_properties(libgfortran PROPERTIES IMPORTED_LOCATION ${copied_libgfortran})
  target_link_libraries(codonrt PRIVATE libgfortran)
else()
  message(FATAL_ERROR "Set 'CODON_SYSTEM_LIBRARIES' to the directory containing system libraries.")
endif()

target_include_directories(codonrt PRIVATE ${backtrace_SOURCE_DIR}
                                           ${re2_SOURCE_DIR}
                                           ${highway_SOURCE_DIR}
                                           "${gc_SOURCE_DIR}/include"
                                           "${fast_float_SOURCE_DIR}/include" runtime)
target_link_libraries(codonrt PRIVATE fmt omp backtrace LLVMSupport)
if(APPLE)
  target_link_libraries(
    codonrt
    PRIVATE -Wl,-force_load,$<TARGET_FILE:zlibstatic>
            -Wl,-force_load,$<TARGET_FILE:gc>
            -Wl,-force_load,$<TARGET_FILE:bz2>
            -Wl,-force_load,$<TARGET_FILE:liblzma>
            -Wl,-force_load,$<TARGET_FILE:re2>
            -Wl,-force_load,$<TARGET_FILE:hwy>
            -Wl,-force_load,$<TARGET_FILE:hwy_contrib>
            -Wl,-force_load,$<TARGET_FILE:codonfloat>)
  target_link_libraries(codonrt PUBLIC "-framework Accelerate")
else()
  add_dependencies(codonrt openblas)
  target_link_libraries(
    codonrt
    PRIVATE -Wl,--whole-archive $<TARGET_FILE:zlibstatic> $<TARGET_FILE:gc>
            $<TARGET_FILE:bz2> $<TARGET_FILE:liblzma> $<TARGET_FILE:re2>
            $<TARGET_FILE:openblas> $<TARGET_FILE:hwy> $<TARGET_FILE:hwy_contrib>
            $<TARGET_FILE:codonfloat> -Wl,--no-whole-archive)
endif()
if(ASAN)
  target_compile_options(
    codonrt PRIVATE "-fno-omit-frame-pointer" "-fsanitize=address"
                    "-fsanitize-recover=address")
  target_link_libraries(
    codonrt PRIVATE "-fno-omit-frame-pointer" "-fsanitize=address"
                    "-fsanitize-recover=address")
endif()
add_custom_command(
  TARGET codonrt
  POST_BUILD
  COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:omp>
          ${CMAKE_BINARY_DIR})

# Codon compiler library
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
set(CODON_HPPFILES
  codon/compiler/compiler.h
  codon/compiler/debug_listener.h
  codon/compiler/engine.h
  codon/compiler/error.h
  codon/compiler/jit.h
  codon/compiler/jit_extern.h
  codon/compiler/memory_manager.h
  codon/dsl/dsl.h
  codon/dsl/plugins.h
  codon/parser/ast.h
  codon/parser/match.h
  codon/parser/ast/node.h
  codon/parser/ast/expr.h
  codon/parser/ast/stmt.h
  codon/parser/ast/types.h
  codon/parser/ast/attr.h
  codon/parser/ast/types/type.h
  codon/parser/ast/types/link.h
  codon/parser/ast/types/class.h
  codon/parser/ast/types/function.h
  codon/parser/ast/types/union.h
  codon/parser/ast/types/static.h
  codon/parser/ast/types/traits.h
  codon/parser/cache.h
  codon/parser/common.h
  codon/parser/ctx.h
  codon/parser/peg/peg.h
  codon/parser/peg/rules.h
  codon/parser/visitors/doc/doc.h
  codon/parser/visitors/format/format.h
  codon/parser/visitors/scoping/scoping.h
  codon/parser/visitors/translate/translate.h
  codon/parser/visitors/translate/translate_ctx.h
  codon/parser/visitors/typecheck/typecheck.h
  codon/parser/visitors/typecheck/ctx.h
  codon/parser/visitors/visitor.h
  codon/cir/analyze/analysis.h
  codon/cir/analyze/dataflow/capture.h
  codon/cir/analyze/dataflow/cfg.h
  codon/cir/analyze/dataflow/dominator.h
  codon/cir/analyze/dataflow/reaching.h
  codon/cir/analyze/module/global_vars.h
  codon/cir/analyze/module/side_effect.h
  codon/cir/attribute.h
  codon/cir/base.h
  codon/cir/const.h
  codon/cir/dsl/codegen.h
  codon/cir/dsl/nodes.h
  codon/cir/flow.h
  codon/cir/func.h
  codon/cir/instr.h
  codon/cir/llvm/gpu.h
  codon/cir/llvm/llvisitor.h
  codon/cir/llvm/llvm.h
  codon/cir/llvm/optimize.h
  codon/cir/module.h
  codon/cir/pyextension.h
  codon/cir/cir.h
  codon/cir/transform/cleanup/canonical.h
  codon/cir/transform/cleanup/dead_code.h
  codon/cir/transform/cleanup/global_demote.h
  codon/cir/transform/cleanup/replacer.h
  codon/cir/transform/folding/const_fold.h
  codon/cir/transform/folding/const_prop.h
  codon/cir/transform/folding/folding.h
  codon/cir/transform/folding/rule.h
  codon/cir/transform/lowering/async_for.h
  codon/cir/transform/lowering/await.h
  codon/cir/transform/lowering/imperative.h
  codon/cir/transform/lowering/pipeline.h
  codon/cir/transform/manager.h
  codon/cir/transform/parallel/openmp.h
  codon/cir/transform/parallel/schedule.h
  codon/cir/transform/pass.h
  codon/cir/transform/pythonic/dict.h
  codon/cir/transform/pythonic/generator.h
  codon/cir/transform/pythonic/io.h
  codon/cir/transform/pythonic/list.h
  codon/cir/transform/pythonic/str.h
  codon/cir/transform/rewrite.h
  codon/cir/types/types.h
  codon/cir/util/cloning.h
  codon/cir/util/context.h
  codon/cir/util/format.h
  codon/cir/util/inlining.h
  codon/cir/util/irtools.h
  codon/cir/util/iterators.h
  codon/cir/util/matching.h
  codon/cir/util/operator.h
  codon/cir/util/outlining.h
  codon/cir/util/packs.h
  codon/cir/util/side_effect.h
  codon/cir/util/visitor.h
  codon/cir/value.h
  codon/cir/llvm/native/native.h
  codon/cir/llvm/native/targets/aarch64.h
  codon/cir/llvm/native/targets/arm.h
  codon/cir/llvm/native/targets/target.h
  codon/cir/llvm/native/targets/x86.h
  codon/cir/transform/numpy/numpy.h
  codon/cir/transform/numpy/indexing.h
  codon/cir/var.h
  codon/util/common.h
  codon/util/serialize.h
  codon/util/tser.h)
set(CODON_CPPFILES
  codon/compiler/compiler.cpp
  codon/compiler/debug_listener.cpp
  codon/compiler/engine.cpp
  codon/compiler/error.cpp
  codon/compiler/jit.cpp
  codon/compiler/memory_manager.cpp
  codon/dsl/plugins.cpp
  codon/parser/ast/expr.cpp
  codon/parser/ast/attr.cpp
  codon/parser/ast/stmt.cpp
  codon/parser/ast/types/type.cpp
  codon/parser/ast/types/link.cpp
  codon/parser/ast/types/class.cpp
  codon/parser/ast/types/function.cpp
  codon/parser/ast/types/union.cpp
  codon/parser/ast/types/static.cpp
  codon/parser/ast/types/traits.cpp
  codon/parser/cache.cpp
  codon/parser/match.cpp
  codon/parser/common.cpp
  codon/parser/peg/peg.cpp
  codon/parser/visitors/doc/doc.cpp
  codon/parser/visitors/format/format.cpp
  codon/parser/visitors/scoping/scoping.cpp
  codon/parser/visitors/translate/translate.cpp
  codon/parser/visitors/translate/translate_ctx.cpp
  codon/parser/visitors/typecheck/typecheck.cpp
  codon/parser/visitors/typecheck/infer.cpp
  codon/parser/visitors/typecheck/ctx.cpp
  codon/parser/visitors/typecheck/assign.cpp
  codon/parser/visitors/typecheck/basic.cpp
  codon/parser/visitors/typecheck/call.cpp
  codon/parser/visitors/typecheck/class.cpp
  codon/parser/visitors/typecheck/collections.cpp
  codon/parser/visitors/typecheck/cond.cpp
  codon/parser/visitors/typecheck/function.cpp
  codon/parser/visitors/typecheck/access.cpp
  codon/parser/visitors/typecheck/import.cpp
  codon/parser/visitors/typecheck/loops.cpp
  codon/parser/visitors/typecheck/op.cpp
  codon/parser/visitors/typecheck/error.cpp
  codon/parser/visitors/typecheck/special.cpp
  codon/parser/visitors/visitor.cpp
  codon/cir/attribute.cpp
  codon/cir/analyze/analysis.cpp
  codon/cir/analyze/dataflow/capture.cpp
  codon/cir/analyze/dataflow/cfg.cpp
  codon/cir/analyze/dataflow/dominator.cpp
  codon/cir/analyze/dataflow/reaching.cpp
  codon/cir/analyze/module/global_vars.cpp
  codon/cir/analyze/module/side_effect.cpp
  codon/cir/base.cpp
  codon/cir/const.cpp
  codon/cir/dsl/nodes.cpp
  codon/cir/flow.cpp
  codon/cir/func.cpp
  codon/cir/instr.cpp
  codon/cir/llvm/gpu.cpp
  codon/cir/llvm/llvisitor.cpp
  codon/cir/llvm/optimize.cpp
  codon/cir/module.cpp
  codon/cir/transform/cleanup/canonical.cpp
  codon/cir/transform/cleanup/dead_code.cpp
  codon/cir/transform/cleanup/global_demote.cpp
  codon/cir/transform/cleanup/replacer.cpp
  codon/cir/transform/folding/const_fold.cpp
  codon/cir/transform/folding/const_prop.cpp
  codon/cir/transform/folding/folding.cpp
  codon/cir/transform/lowering/async_for.cpp
  codon/cir/transform/lowering/await.cpp
  codon/cir/transform/lowering/imperative.cpp
  codon/cir/transform/lowering/pipeline.cpp
  codon/cir/transform/manager.cpp
  codon/cir/transform/parallel/openmp.cpp
  codon/cir/transform/parallel/schedule.cpp
  codon/cir/transform/pass.cpp
  codon/cir/transform/pythonic/dict.cpp
  codon/cir/transform/pythonic/generator.cpp
  codon/cir/transform/pythonic/io.cpp
  codon/cir/transform/pythonic/list.cpp
  codon/cir/transform/pythonic/str.cpp
  codon/cir/types/types.cpp
  codon/cir/util/cloning.cpp
  codon/cir/util/format.cpp
  codon/cir/util/inlining.cpp
  codon/cir/util/irtools.cpp
  codon/cir/util/matching.cpp
  codon/cir/util/outlining.cpp
  codon/cir/util/side_effect.cpp
  codon/cir/util/visitor.cpp
  codon/cir/value.cpp
  codon/cir/var.cpp
  codon/cir/llvm/native/native.cpp
  codon/cir/llvm/native/targets/aarch64.cpp
  codon/cir/llvm/native/targets/arm.cpp
  codon/cir/llvm/native/targets/x86.cpp
  codon/cir/transform/numpy/expr.cpp
  codon/cir/transform/numpy/forward.cpp
  codon/cir/transform/numpy/indexing.cpp
  codon/cir/transform/numpy/numpy.cpp
  codon/util/common.cpp)
add_library(codonc SHARED ${CODON_HPPFILES})
target_include_directories(codonc PRIVATE ${peglib_SOURCE_DIR}
                                          ${toml_SOURCE_DIR}/include
                                          ${semver_SOURCE_DIR}/include
                                          ${fast_float_SOURCE_DIR}/include)
target_sources(codonc PRIVATE ${CODON_CPPFILES} codon_rules.cpp omp_rules.cpp)
if(ASAN)
  target_compile_options(
    codonc PRIVATE "-fno-omit-frame-pointer" "-fsanitize=address"
                   "-fsanitize-recover=address")
  target_link_libraries(
    codonc PRIVATE "-fno-omit-frame-pointer" "-fsanitize=address"
                   "-fsanitize-recover=address")
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
  set_source_files_properties(codon_rules.cpp codon/parser/peg/peg.cpp
                              PROPERTIES COMPILE_FLAGS "-O2")
endif()
llvm_map_components_to_libnames(
  LLVM_LIBS
  AllTargetsAsmParsers
  AllTargetsCodeGens
  AllTargetsDescs
  AllTargetsInfos
  AggressiveInstCombine
  Analysis
  AsmParser
  BitWriter
  CodeGen
  Core
  Extensions
  IPO
  IRReader
  InstCombine
  Instrumentation
  MC
  MCJIT
  ObjCARCOpts
  OrcJIT
  Remarks
  ScalarOpts
  Support
  Symbolize
  Target
  TransformUtils
  Vectorize
  Passes)

file(GLOB_RECURSE CODON_STDLIB_RESOURCES
  CONFIGURE_DEPENDS
  "${CMAKE_CURRENT_SOURCE_DIR}/stdlib/*.codon"
)
cmrc_add_resource_library(
  codon-stdlib
  NAMESPACE codon
  ${CODON_STDLIB_RESOURCES}
)
set_property(TARGET codon-stdlib PROPERTY POSITION_INDEPENDENT_CODE ON)

target_link_libraries(codonc PRIVATE ${LLVM_LIBS} fmt dl codonrt codon-stdlib)

# Gather headers
add_custom_target(
  headers ALL
  COMMENT "Collecting headers"
  BYPRODUCTS "${CMAKE_BINARY_DIR}/include"
  VERBATIM
  COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/include/codon"
  COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/codon"
          "${CMAKE_BINARY_DIR}/include/codon"
  COMMAND find "${CMAKE_BINARY_DIR}/include" -type f ! -name "*.h" -exec rm {}
          \\;)
add_dependencies(headers codonrt codonc)

# Prepare lib directory for plugin compilation
add_custom_target(
  libs ALL
  COMMENT "Collecting libraries"
  BYPRODUCTS "${CMAKE_BINARY_DIR}/lib"
  VERBATIM
  COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/lib/codon"
  COMMAND
    ${CMAKE_COMMAND} -E copy
    "${CMAKE_BINARY_DIR}/libcodonc${CMAKE_SHARED_LIBRARY_SUFFIX}"
    "${CMAKE_BINARY_DIR}/lib/codon"
  COMMAND
    ${CMAKE_COMMAND} -E copy
    "${CMAKE_BINARY_DIR}/libcodonrt${CMAKE_SHARED_LIBRARY_SUFFIX}"
    "${CMAKE_BINARY_DIR}/lib/codon"
  COMMAND
    ${CMAKE_COMMAND} -E copy
    "${CMAKE_BINARY_DIR}/libomp${CMAKE_SHARED_LIBRARY_SUFFIX}"
    "${CMAKE_BINARY_DIR}/lib/codon"
  COMMAND
    ${CMAKE_COMMAND} -E copy ${copied_libgfortran} "${CMAKE_BINARY_DIR}/lib/codon"
  COMMAND
    /bin/sh -c "test -f '${copied_libquadmath}' && ${CMAKE_COMMAND} -E copy '${copied_libquadmath}' '${CMAKE_BINARY_DIR}/lib/codon' || true"
  COMMAND
    ${CMAKE_COMMAND} -E copy ${copied_libgcc} "${CMAKE_BINARY_DIR}/lib/codon")
add_dependencies(libs codonrt codonc)

# Codon command-line tool
add_executable(codon codon/app/main.cpp)
target_link_libraries(codon PUBLIC fmt codonc codon_jupyter Threads::Threads)

# Codon test Download and unpack googletest at configure time
include(FetchContent)
FetchContent_Declare(
  googletest
  URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
option(INSTALL_GTEST "Enable installation of googletest." OFF)
FetchContent_MakeAvailable(googletest)
enable_testing()
set(CODON_TEST_CPPFILES
    test/main.cpp
    test/cir/analyze/dominator.cpp
    test/cir/analyze/reaching.cpp
    test/cir/base.cpp
    test/cir/constant.cpp
    test/cir/flow.cpp
    test/cir/func.cpp
    test/cir/instr.cpp
    test/cir/module.cpp
    test/cir/transform/manager.cpp
    test/cir/types/types.cpp
    test/cir/util/matching.cpp
    test/cir/value.cpp
    test/cir/var.cpp
    test/types.cpp)
add_executable(codon_test ${CODON_TEST_CPPFILES})
target_include_directories(codon_test PRIVATE test/cir "${gc_SOURCE_DIR}/include")
target_link_libraries(codon_test fmt codonc codonrt gtest_main)
target_compile_definitions(codon_test
                           PRIVATE TEST_DIR="${CMAKE_CURRENT_SOURCE_DIR}/test")

install(TARGETS codonrt codonc codon_jupyter DESTINATION lib/codon)
install(FILES ${CMAKE_BINARY_DIR}/libomp${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION lib/codon)
install(FILES ${copied_libgfortran} DESTINATION lib/codon)
# only install libquadmath if it exists at build time
install(CODE "
  file(GLOB _quadmath \"${copied_libquadmath}\")
  if(EXISTS \"\${_quadmath}\")
    file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/lib/codon\" TYPE FILE FILES \"\${_quadmath}\")
  endif()
")
install(FILES ${copied_libgcc} DESTINATION lib/codon)
install(TARGETS codon DESTINATION bin)
install(DIRECTORY ${CMAKE_BINARY_DIR}/include/codon DESTINATION include)
install(DIRECTORY ${LLVM_INCLUDE_DIRS}/llvm DESTINATION include)
install(DIRECTORY ${LLVM_INCLUDE_DIRS}/llvm-c DESTINATION include)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/stdlib DESTINATION lib/codon)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/jit/ DESTINATION python)
install(DIRECTORY DESTINATION lib/codon/plugins)

install(CODE [[
  if(APPLE)
    # Compute the real install root (supports DESTDIR)
    set(_root "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}")
    message(STATUS "fix_loader_paths.sh on: ${_root}")
    execute_process(
      COMMAND /bin/bash "${CMAKE_SOURCE_DIR}/scripts/fix_loader_paths.sh" "${_root}"
      RESULT_VARIABLE rc
    )
    if(NOT rc EQUAL 0)
      message(FATAL_ERROR "fix_loader_paths.sh failed with code ${rc}")
    endif()
  endif()
]])


================================================
FILE: CODEOWNERS
================================================
*                    @arshajii @inumanag
/codon/              @arshajii
/codon/parser/       @inumanag


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to Codon

Thank you for considering contributing to Codon! This document contains some helpful information for getting started.
The best place to ask questions or get feedback is [our Discord](https://discord.gg/HeWRhagCmP).

## Development workflow

All development is done on the [`develop`](https://github.com/exaloop/codon/tree/develop) branch. Just before release,
we bump the version number, merge into [`master`](https://github.com/exaloop/codon/tree/master) and tag the build with
a tag of the form `vX.Y.Z` where `X`, `Y` and `Z` are the [SemVer](https://semver.org) major, minor and patch numbers,
respectively. Our CI build process automatically builds and deploys tagged commits as a new GitHub release.

## Coding standards

All C++ code should be formatted with [ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) using the `.clang-format`
file in the root of the repository.

## Writing tests

Tests are written as Codon programs. The [`test/core/`](https://github.com/exaloop/codon/tree/master/test/core) directory
contains some examples. If you add a new test file, be sure to add it to
[`test/main.cpp`](https://github.com/exaloop/codon/blob/master/test/main.cpp) so that it will be executed as part of the test
suite. There are two ways to write tests for Codon:

#### New style

Example:

```python
@test
def my_test():
    assert 2 + 2 == 4
my_test()
```

**Semantics:** `assert` statements in functions marked `@test` are not compiled to standard assertions: they don't terminate
the program when the condition fails, but instead print source information, fail the test, and move on.

#### Old style

Example:

```python
print(2 + 2)  # EXPECT: 4
```

**Semantics:** The source file is scanned for `EXPECT`s, executed, then the output is compared to the "expected" output. Note
that if you have, for example, an `EXPECT` in a loop, you will need to duplicate it however many times the loop is executed.
Using `EXPECT` is helpful mainly in cases where you need to test control flow, **otherwise prefer the new style**.

## Pull requests

Pull requests should generally be based on the `develop` branch. Before submitting a pull request, please make sure...

- ... to provide a clear description of the purpose of the pull request.
- ... to include tests for any new or changed code.
- ... that all code is formatted as per the guidelines above.

Please be patient with pull request reviews, as our throughput is limited.


================================================
FILE: LICENSE
================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


================================================
FILE: README.md
================================================
<h1 align="center">
 <img src="docs/img/codon-banner.svg" alt="Codon banner"/>
</h1>

<h3 align="center">
  <a href="https://docs.exaloop.io/codon" target="_blank"><b>Docs</b></a>
  &nbsp;&#183;&nbsp;
  <a href="https://docs.exaloop.io/codon/general/faq" target="_blank"><b>FAQ</b></a>
  &nbsp;&#183;&nbsp;
  <a href="https://exaloop.io/blog" target="_blank"><b>Blog</b></a>
  &nbsp;&#183;&nbsp;
  <a href="https://discord.gg/HeWRhagCmP" target="_blank">Discord</a>
  &nbsp;&#183;&nbsp;
  <a href="https://docs.exaloop.io/codon/general/roadmap" target="_blank">Roadmap</a>
  &nbsp;&#183;&nbsp;
  <a href="https://exaloop.io/#benchmarks" target="_blank">Benchmarks</a>
</h3>

<a href="https://github.com/exaloop/codon/actions/workflows/ci.yml">
  <img src="https://github.com/exaloop/codon/actions/workflows/ci.yml/badge.svg"
       alt="Build Status">
</a>

# What is Codon?

Codon is a high-performance Python implementation that compiles to native machine code without
any runtime overhead. Typical speedups over vanilla Python are on the order of 10-100x or more, on
a single thread. Codon's performance is typically on par with (and sometimes better than) that of
C/C++. Unlike Python, Codon supports native multithreading, which can lead to speedups many times
higher still.

*Think of Codon as Python reimagined for static, ahead-of-time compilation, built from the ground
up with best possible performance in mind.*

## Goals

- :bulb: **No learning curve:** Be as close to CPython as possible in terms of syntax, semantics and libraries
- :rocket: **Top-notch performance:** At *least* on par with low-level languages like C, C++ or Rust
- :computer: **Hardware support:** Full, seamless support for multicore programming, multithreading (no GIL!), GPU and more
- :chart_with_upwards_trend: **Optimizations:** Comprehensive optimization framework that can target high-level Python constructs
  and libraries
- :battery: **Interoperability:** Full interoperability with Python's ecosystem of packages and libraries

## Non-goals

- :x: *Drop-in replacement for CPython:* Codon is not a drop-in replacement for CPython. There are some
  aspects of Python that are not suitable for static compilation — we don't support these in Codon.
  There are ways to use Codon in larger Python codebases via its [JIT decorator](https://docs.exaloop.io/codon/interoperability/decorator)
  or [Python extension backend](https://docs.exaloop.io/codon/interoperability/pyext). Codon also supports
  calling any Python module via its [Python interoperability](https://docs.exaloop.io/codon/interoperability/python).
  See also [*"Differences with Python"*](https://docs.exaloop.io/codon/general/differences) in the docs.

- :x: *New syntax and language constructs:* We try to avoid adding new syntax, keywords or other language
  features as much as possible. While Codon does add some new syntax in a couple places (e.g. to express
  parallelism), we try to make it as familiar and intuitive as possible.

## How it works

<p align="center">
 <img src="docs/img/codon-pipeline.svg" width="90%" alt="Codon figure"/>
</p>

# Quick start

Download and install Codon with this command:

```bash
/bin/bash -c "$(curl -fsSL https://exaloop.io/install.sh)"
```

After following the prompts, the `codon` command will be available to use. For example:

- To run a program: `codon run file.py`
- To run a program with optimizations enabled: `codon run -release file.py`
- To compile to an executable: `codon build -release file.py`
- To generate LLVM IR: `codon build -release -llvm file.py`

Many more options are available and described in [the docs](https://docs.exaloop.io/codon/general/intro).

Alternatively, you can [build from source](https://docs.exaloop.io/codon/advanced/build).

# Examples

## Basics

Codon supports much of Python, and many Python programs will work with few if any modifications.
Here's a simple script `fib.py` that computes the 40th Fibonacci number...

``` python
from time import time

def fib(n):
    return n if n < 2 else fib(n - 1) + fib(n - 2)

t0 = time()
ans = fib(40)
t1 = time()
print(f'Computed fib(40) = {ans} in {t1 - t0} seconds.')
```

... run through Python and Codon:

```
$ python3 fib.py
Computed fib(40) = 102334155 in 17.979357957839966 seconds.
$ codon run -release fib.py
Computed fib(40) = 102334155 in 0.275645 seconds.
```

## Using Python libraries

You can import and use any Python package from Codon via `from python import`. For example:

```python
from python import matplotlib.pyplot as plt
data = [x**2 for x in range(10)]
plt.plot(data)
plt.show()
```

(Just remember to set the `CODON_PYTHON` environment variable to the CPython shared library,
as explained in the [the Python interoperability docs](https://docs.exaloop.io/codon/interoperability/python).)

## Parallelism

Codon supports native multithreading via [OpenMP](https://www.openmp.org/). The `@par` annotation
in the code below tells the compiler to parallelize the following `for`-loop, in this case using
a dynamic schedule, chunk size of 100, and 16 threads.

```python
from sys import argv

def is_prime(n):
    factors = 0
    for i in range(2, n):
        if n % i == 0:
            factors += 1
    return factors == 0

limit = int(argv[1])
total = 0

@par(schedule='dynamic', chunk_size=100, num_threads=16)
for i in range(2, limit):
    if is_prime(i):
        total += 1

print(total)
```

Note that Codon automatically turns the `total += 1` statement in the loop body into an atomic
reduction to avoid race conditions. Learn more in the [multithreading docs](https://docs.exaloop.io/codon/advanced/parallel).

Codon also supports writing and executing GPU kernels. Here's an example that computes the
[Mandelbrot set](https://en.wikipedia.org/wiki/Mandelbrot_set):

```python
import gpu

MAX    = 1000  # maximum Mandelbrot iterations
N      = 4096  # width and height of image
pixels = [0 for _ in range(N * N)]

def scale(x, a, b):
    return a + (x/N)*(b - a)

@gpu.kernel
def mandelbrot(pixels):
    idx = (gpu.block.x * gpu.block.dim.x) + gpu.thread.x
    i, j = divmod(idx, N)
    c = complex(scale(j, -2.00, 0.47), scale(i, -1.12, 1.12))
    z = 0j
    iteration = 0

    while abs(z) <= 2 and iteration < MAX:
        z = z**2 + c
        iteration += 1

    pixels[idx] = int(255 * iteration/MAX)

mandelbrot(pixels, grid=(N*N)//1024, block=1024)
```

GPU programming can also be done using the `@par` syntax with `@par(gpu=True)`. See the
[GPU programming docs](https://docs.exaloop.io/codon/advanced/gpu) for more details.

## NumPy support

Codon includes a feature-complete, fully-compiled native NumPy implementation. It uses the same
API as NumPy, but re-implements everything in Codon itself, allowing for a range of optimizations
and performance improvements.

Here's an example NumPy program that approximates $\pi$ using random numbers...

``` python
import time
import numpy as np

rng = np.random.default_rng(seed=0)
x = rng.random(500_000_000)
y = rng.random(500_000_000)

t0 = time.time()
# pi ~= 4 x (fraction of points in circle)
pi = ((x-1)**2 + (y-1)**2 < 1).sum() * (4 / len(x))
t1 = time.time()

print(f'Computed pi~={pi:.4f} in {t1 - t0:.2f} sec')
```

... run through Python and Codon:

```
$ python3 pi.py
Computed pi~=3.1417 in 2.25 sec
$ codon run -release pi.py
Computed pi~=3.1417 in 0.43 sec
```

Codon can speed up NumPy code through general-purpose and NumPy-specific compiler optimizations,
including inlining, fusion, memory allocation elision and more. Furthermore, Codon's NumPy
implementation works with its multithreading and GPU capabilities, and can even integrate with
[PyTorch](https://pytorch.org). Learn more in the [Codon-NumPy docs](https://docs.exaloop.io/codon/interoperability/numpy).

# Documentation

Please see [docs.exaloop.io](https://docs.exaloop.io) for in-depth documentation.

# Acknowledgements

This project would not be possible without:

- **Funding**:
  - National Science Foundation (NSF) 🇺🇸
  - National Institutes of Health (NIH) 🇺🇸
  - MIT 🇺🇸
  - MIT E14 Fund 🇺🇸
  - Natural Sciences and Engineering Research Council (NSERC) 🇨🇦
  - Canada Research Chairs 🇨🇦
  - Canada Foundation for Innovation 🇨🇦
  - B.C. Knowledge Development Fund 🇨🇦
  - University of Victoria 🇨🇦
- **Libraries**:
  [LLVM Compiler Infrastructure](https://llvm.org/),
  [yhirose's peglib](https://github.com/yhirose/cpp-peglib),
  [Boehm-Demers-Weiser Garbage Collector](https://github.com/ivmai/bdwgc),
  [KonanM's tser](https://github.com/KonanM/tser),
  [{fmt}](https://github.com/fmtlib/fmt),
  [toml++](https://marzer.github.io/tomlplusplus/),
  [semver](https://github.com/Neargye/semver),
  [zlib-ng](https://github.com/zlib-ng/zlib-ng),
  [xz](https://github.com/tukaani-project/xz),
  [bz2](https://sourceware.org/bzip2/),
  [Google RE2](https://github.com/google/re2),
  [libbacktrace](https://github.com/ianlancetaylor/libbacktrace),
  [fast_float](https://github.com/fastfloat/fast_float),
  [Google Highway](https://github.com/google/highway),
  [NumPy](https://numpy.org/)


================================================
FILE: bench/README.md
================================================
# Codon benchmark suite

This folder contains a number of Codon benchmarks. Some are taken
from the [pyperformance suite](https://github.com/python/pyperformance)
while others are adaptations of applications we've encountered in the
wild. Further, some of the benchmarks are identical in both Python and
Codon, some are changed slightly to work with Codon's type system, and
some use Codon-specific features like parallelism or GPU.

Some of the pyperformance benchmarks can be made (much) faster in Codon
by using various Codon-specific features, but their adaptations here are
virtually identical to the original implementations (mainly just the use
of the `pyperf` module is removed).

## Benchmarks

- `chaos`: [Pyperformance's `chaos` benchmark](https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_chaos/run_benchmark.py).
- `float`: [Pyperformance's `float` benchmark](https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_float/run_benchmark.py).
- `go`: [Pyperformance's `go` benchmark](https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_go/run_benchmark.py).
- `nbody`: [Pyperformance's `nbody` benchmark](https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_nbody/run_benchmark.py).
- `spectral_norm`: [Pyperformance's `spectral_norm` benchmark](https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_spectral_norm/run_benchmark.py).
- `mandelbrot`: Generates an image of the Mandelbrot set. Codon version uses GPU via one additional `@par(gpu=True, collapse=2)` line.
- `set_partition`: Calculates set partitions. Code taken from [this Stack Overflow answer](https://stackoverflow.com/a/73549333).
- `sum`: Computes sum of integers from 1 to 50000000 with a loop. Code taken from [this article](https://towardsdatascience.com/getting-started-with-pypy-ef4ba5cb431c).
- `taq`: Performs volume peak detection on an NYSE TAQ file. Sample TAQ files can be downloaded and uncompressed from [here](https://ftp.nyse.com/Historical%20Data%20Samples/DAILY%20TAQ/)
         (e.g. `EQY_US_ALL_NBBO_20220705.gz`). We recommend using the first 10M lines for benchmarking purposes. The TAQ file path should be passed to the benchmark script
         through the `DATA_TAQ` environment variable.
- `binary_trees`: [Boehm's binary trees benchmark](https://hboehm.info/gc/gc_bench.html).
- `fannkuch`: See [*Performing Lisp analysis of the FANNKUCH benchmark*](https://dl.acm.org/doi/10.1145/382109.382124) by Kenneth R. Anderson and Duane Rettig. Benchmark
              involves generating permutations and repeatedly reversing elements of a list. Codon version is multithreaded with a dynamic schedule via one additional
              `@par(schedule='dynamic')` line.
- `word_count`: Counts occurrences of words in a file using a dictionary. The file should be passed to the benchmark script through the `DATA_WORD_COUNT` environment variable.
- `primes`: Counts the number of prime numbers below a threshold. Codon version is multithreaded with a dynamic schedule via one additional `@par(schedule='dynamic')` line.


================================================
FILE: bench/codon/binary_trees.codon
================================================
# The Computer Language Benchmarks Game
# http://benchmarksgame.alioth.debian.org/
#
# contributed by Antoine Pitrou
# modified by Dominique Wahli and Daniel Nanz
# modified by Joerg Baumann
# modified by @arshajii for Codon

import sys
import time

class Node:
    left: Optional[Node] = None
    right: Optional[Node] = None

def make_tree(d):
    return Node(make_tree(d - 1), make_tree(d - 1)) if d > 0 else Node()

def check_tree(node):
    l, r = node.left, node.right
    if l is None:
        return 1
    else:
        return 1 + check_tree(l) + check_tree(r)

def make_check(itde, make=make_tree, check=check_tree):
    i, d = itde
    return check(make(d))

def get_argchunks(i, d, chunksize=5000):
    assert chunksize % 2 == 0
    chunk = []
    for k in range(1, i + 1):
        chunk.append((k, d))
        if len(chunk) == chunksize:
            yield chunk
            chunk = []
    if len(chunk) > 0:
        yield chunk

def main(n, min_depth=4):
    max_depth = max(min_depth + 2, n)
    stretch_depth = max_depth + 1
    print(f'stretch tree of depth {stretch_depth}\t check: {make_check((0, stretch_depth))}')

    long_lived_tree = make_tree(max_depth)

    mmd = max_depth + min_depth
    for d in range(min_depth, stretch_depth, 2):
        i = 2 ** (mmd - d)
        cs = 0
        for argchunk in get_argchunks(i, d):
            cs += sum(map(make_check, argchunk))
        print(f'{i}\t trees of depth {d}\t check: {cs}')

    print(f'long lived tree of depth {max_depth}\t check: {check_tree(long_lived_tree)}')

t0 = time.time()
main(int(sys.argv[1]))
t1 = time.time()
print(t1 - t0)


================================================
FILE: bench/codon/binary_trees.cpp
================================================
#include <cassert>
#include <chrono>
#include <iostream>
#include <memory>
#include <utility>
#include <vector>

struct Node {
  std::unique_ptr<Node> left{};
  std::unique_ptr<Node> right{};
};

inline std::unique_ptr<Node> make_tree(int d) {
  if (d > 0) {
    return std::make_unique<Node>(Node{make_tree(d - 1), make_tree(d - 1)});
  } else {
    return std::make_unique<Node>();
  }
}

inline int check_tree(const std::unique_ptr<Node> &node) {
  if (!node->left)
    return 1;
  else
    return 1 + check_tree(node->left) + check_tree(node->right);
}

inline int make_check(const std::pair<int, int> &itde) {
  int i = itde.first, d = itde.second;
  auto tree = make_tree(d);
  return check_tree(tree);
}

struct ArgChunks {
  int i, k, d, chunksize;
  std::vector<std::pair<int, int>> chunk;

  ArgChunks(int i, int d, int chunksize = 5000)
      : i(i), k(1), d(d), chunksize(chunksize), chunk() {
    assert(chunksize % 2 == 0);
  }

  bool next() {
    chunk.clear();
    while (k <= i) {
      chunk.emplace_back(k++, d);
      if (chunk.size() == chunksize)
        return true;
    }
    return !chunk.empty();
  }
};

int main(int argc, char *argv[]) {
  using clock = std::chrono::high_resolution_clock;
  using std::chrono::duration_cast;
  using std::chrono::milliseconds;

  auto t = clock::now();
  int min_depth = 4;
  int n = std::stoi(argv[1]);
  int max_depth = std::max(min_depth + 2, n);
  int stretch_depth = max_depth + 1;

  std::cout << "stretch tree of depth " << stretch_depth
            << "\t check: " << make_check({0, stretch_depth}) << '\n';

  auto long_lived_tree = make_tree(max_depth);
  int mmd = max_depth + min_depth;
  for (int d = min_depth; d < stretch_depth; d += 2) {
    int i = (1 << (mmd - d));
    int cs = 0;
    ArgChunks iter(i, d);
    while (iter.next()) {
      for (auto &argchunk : iter.chunk) {
        cs += make_check(argchunk);
      }
    }
    std::cout << i << "\t trees of depth " << d << "\t check: " << cs << '\n';
  }
  std::cout << "long lived tree of depth " << max_depth
            << "\t check: " << check_tree(long_lived_tree) << '\n';
  std::cout << (duration_cast<milliseconds>(clock::now() - t).count() / 1e3)
            << std::endl;
}


================================================
FILE: bench/codon/binary_trees.py
================================================
# The Computer Language Benchmarks Game
# http://benchmarksgame.alioth.debian.org/
#
# contributed by Antoine Pitrou
# modified by Dominique Wahli and Daniel Nanz
# modified by Joerg Baumann
# modified by @arshajii for Codon

import sys
import time

class Node:
    def __init__(self, left = None, right = None):
        self.left = left
        self.right = right

def make_tree(d):
    return Node(make_tree(d - 1), make_tree(d - 1)) if d > 0 else Node()

def check_tree(node):
    l, r = node.left, node.right
    if l is None:
        return 1
    else:
        return 1 + check_tree(l) + check_tree(r)

def make_check(itde, make=make_tree, check=check_tree):
    i, d = itde
    return check(make(d))

def get_argchunks(i, d, chunksize=5000):
    assert chunksize % 2 == 0
    chunk = []
    for k in range(1, i + 1):
        chunk.append((k, d))
        if len(chunk) == chunksize:
            yield chunk
            chunk = []
    if len(chunk) > 0:
        yield chunk

def main(n, min_depth=4):
    max_depth = max(min_depth + 2, n)
    stretch_depth = max_depth + 1
    print(f'stretch tree of depth {stretch_depth}\t check: {make_check((0, stretch_depth))}')

    long_lived_tree = make_tree(max_depth)

    mmd = max_depth + min_depth
    for d in range(min_depth, stretch_depth, 2):
        i = 2 ** (mmd - d)
        cs = 0
        for argchunk in get_argchunks(i, d):
            cs += sum(map(make_check, argchunk))
        print(f'{i}\t trees of depth {d}\t check: {cs}')

    print(f'long lived tree of depth {max_depth}\t check: {check_tree(long_lived_tree)}')

t0 = time.time()
main(int(sys.argv[1]))
t1 = time.time()
print(t1 - t0)


================================================
FILE: bench/codon/chaos.codon
================================================
"""create chaosgame-like fractals
Copyright (C) 2005 Carl Friedrich Bolz

adapted by @arshajii for Codon
"""

import math
import random
import sys
import time

DEFAULT_THICKNESS = 1.0
DEFAULT_WIDTH = 2048 #256
DEFAULT_HEIGHT = 2048 #256
DEFAULT_ITERATIONS = 1000000 #5000
DEFAULT_RNG_SEED = 1234


class GVector(object):
    x: float
    y: float
    z: float

    def __init__(self, x=0, y=0, z=0):
        self.x = x
        self.y = y
        self.z = z

    def Mag(self):
        return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

    def dist(self, other):
        return math.sqrt((self.x - other.x) ** 2
                         + (self.y - other.y) ** 2
                         + (self.z - other.z) ** 2)

    def __add__(self, other):
        if not isinstance(other, GVector):
            raise ValueError("Can't add GVector to " + str(type(other)))
        v = GVector(self.x + other.x, self.y + other.y, self.z + other.z)
        return v

    def __sub__(self, other):
        return self + other * -1

    def __mul__(self, other):
        v = GVector(self.x * other, self.y * other, self.z * other)
        return v
    #__rmul__ = __mul__

    def linear_combination(self, other, l1, l2=None):
        if l2 is None:
            l2 = 1 - l1
        v = GVector(self.x * l1 + other.x * l2,
                    self.y * l1 + other.y * l2,
                    self.z * l1 + other.z * l2)
        return v

    #def __str__(self):
    #    return "<%f, %f, %f>" % (self.x, self.y, self.z)

    #def __repr__(self):
    #    return "GVector(%f, %f, %f)" % (self.x, self.y, self.z)


class Spline(object):
    """Class for representing B-Splines and NURBS of arbitrary degree"""
    knots: List[int]
    degree: int
    points: List[GVector]

    def __init__(self, points, degree, knots):
        """Creates a Spline.
        points is a list of GVector, degree is the degree of the Spline.
        """
        if len(points) > len(knots) - degree + 1:
            raise ValueError("too many control points")
        elif len(points) < len(knots) - degree + 1:
            raise ValueError("not enough control points")
        last = knots[0]
        for cur in knots[1:]:
            if cur < last:
                raise ValueError("knots not strictly increasing")
            last = cur
        self.knots = knots
        self.points = points
        self.degree = degree

    def GetDomain(self):
        """Returns the domain of the B-Spline"""
        return (self.knots[self.degree - 1],
                self.knots[len(self.knots) - self.degree])

    def __call__(self, u):
        """Calculates a point of the B-Spline using de Boors Algorithm"""
        dom = self.GetDomain()
        if u < dom[0] or u > dom[1]:
            raise ValueError("Function value not in domain")
        if u == dom[0]:
            return self.points[0]
        if u == dom[1]:
            return self.points[-1]
        I = self.GetIndex(u)
        d = [self.points[I - self.degree + 1 + ii]
             for ii in range(self.degree + 1)]
        U = self.knots
        for ik in range(1, self.degree + 1):
            for ii in range(I - self.degree + ik + 1, I + 2):
                ua = U[ii + self.degree - ik]
                ub = U[ii - 1]
                co1 = (ua - u) / (ua - ub)
                co2 = (u - ub) / (ua - ub)
                index = ii - I + self.degree - ik - 1
                d[index] = d[index].linear_combination(d[index + 1], co1, co2)
        return d[0]

    def GetIndex(self, u):
        dom = self.GetDomain()
        for ii in range(self.degree - 1, len(self.knots) - self.degree):
            if u >= self.knots[ii] and u < self.knots[ii + 1]:
                I = ii
                break
        else:
            I = dom[1] - 1
        return I

    def __len__(self):
        return len(self.points)

    #def __repr__(self):
    #    return "Spline(%r, %r, %r)" % (self.points, self.degree, self.knots)


def write_ppm(im, filename):
    magic = 'P6\n'
    maxval = 255
    w = len(im)
    h = len(im[0])

    #with open(filename, "w", encoding="latin1", newline='') as fp:
    with open(filename, "w") as fp:
        fp.write(magic)
        #fp.write('%i %i\n%i\n' % (w, h, maxval))
        fp.write(f'{w} {h}\n{maxval}\n')
        for j in range(h):
            for i in range(w):
                val = im[i][j]
                c = val * 255
                #fp.write('%c%c%c' % (c, c, c))
                c = chr(c)
                fp.write(f'{c}{c}{c}')


class Chaosgame(object):
    splines: List[Spline]
    thickness: float
    minx: float
    miny: float
    maxx: float
    maxy: float
    height: float
    width: float
    num_trafos: List[int]
    num_total: int

    def __init__(self, splines, thickness=0.1):
        self.splines = splines
        self.thickness = thickness
        self.minx = min([p.x for spl in splines for p in spl.points])
        self.miny = min([p.y for spl in splines for p in spl.points])
        self.maxx = max([p.x for spl in splines for p in spl.points])
        self.maxy = max([p.y for spl in splines for p in spl.points])
        self.height = self.maxy - self.miny
        self.width = self.maxx - self.minx
        self.num_trafos = []
        maxlength = thickness * self.width / self.height
        for spl in splines:
            length = 0.
            curr = spl(0)
            for i in range(1, 1000):
                last = curr
                t = 1 / 999 * i
                curr = spl(t)
                length += curr.dist(last)
            self.num_trafos.append(max(1, int(length / maxlength * 1.5)))
        self.num_total = sum(self.num_trafos)

    def get_random_trafo(self):
        r = random.randrange(int(self.num_total) + 1)
        l = 0
        for i in range(len(self.num_trafos)):
            if r >= l and r < l + self.num_trafos[i]:
                return i, random.randrange(self.num_trafos[i])
            l += self.num_trafos[i]
        return len(self.num_trafos) - 1, random.randrange(self.num_trafos[-1])

    def transform_point(self, point):
        x = (point.x - self.minx) / self.width
        y = (point.y - self.miny) / self.height
        #if trafo is None:
        trafo = self.get_random_trafo()
        start, end = self.splines[trafo[0]].GetDomain()
        length = end - start
        seg_length = length / self.num_trafos[trafo[0]]
        t = start + seg_length * trafo[1] + seg_length * x
        basepoint = self.splines[trafo[0]](t)
        if t + 1 / 50000 > end:
            neighbour = self.splines[trafo[0]](t - 1 / 50000)
            derivative = neighbour - basepoint
        else:
            neighbour = self.splines[trafo[0]](t + 1 / 50000)
            derivative = basepoint - neighbour
        if derivative.Mag() != 0:
            basepoint.x += derivative.y / derivative.Mag() * (y - 0.5) * \
                self.thickness
            basepoint.y += -derivative.x / derivative.Mag() * (y - 0.5) * \
                self.thickness
        else:
            print("r", end='')
        self.truncate(basepoint)
        return basepoint

    def truncate(self, point):
        if point.x >= self.maxx:
            point.x = self.maxx
        if point.y >= self.maxy:
            point.y = self.maxy
        if point.x < self.minx:
            point.x = self.minx
        if point.y < self.miny:
            point.y = self.miny

    def create_image_chaos(self, w, h, iterations, filename, rng_seed):
        # Always use the same sequence of random numbers
        # to get reproducible benchmark
        random.seed(rng_seed)

        im = [[1] * h for i in range(w)]
        point = GVector((self.maxx + self.minx) / 2,
                        (self.maxy + self.miny) / 2, 0)
        for _ in range(iterations):
            point = self.transform_point(point)
            x = (point.x - self.minx) / self.width * w
            y = (point.y - self.miny) / self.height * h
            x = int(x)
            y = int(y)
            if x == w:
                x -= 1
            if y == h:
                y -= 1
            im[x][h - y - 1] = 0

        if filename:
            write_ppm(im, filename)


def main():
    splines = [
        Spline([
            GVector(1.597350, 3.304460, 0.000000),
            GVector(1.575810, 4.123260, 0.000000),
            GVector(1.313210, 5.288350, 0.000000),
            GVector(1.618900, 5.329910, 0.000000),
            GVector(2.889940, 5.502700, 0.000000),
            GVector(2.373060, 4.381830, 0.000000),
            GVector(1.662000, 4.360280, 0.000000)],
            3, [0, 0, 0, 1, 1, 1, 2, 2, 2]),
        Spline([
            GVector(2.804500, 4.017350, 0.000000),
            GVector(2.550500, 3.525230, 0.000000),
            GVector(1.979010, 2.620360, 0.000000),
            GVector(1.979010, 2.620360, 0.000000)],
            3, [0, 0, 0, 1, 1, 1]),
        Spline([
            GVector(2.001670, 4.011320, 0.000000),
            GVector(2.335040, 3.312830, 0.000000),
            GVector(2.366800, 3.233460, 0.000000),
            GVector(2.366800, 3.233460, 0.000000)],
            3, [0, 0, 0, 1, 1, 1])
    ]

    chaos = Chaosgame(splines, DEFAULT_THICKNESS)
    chaos.create_image_chaos(DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_ITERATIONS, sys.argv[1], DEFAULT_RNG_SEED)

t0 = time.time()
main()
t1 = time.time()
print(t1 - t0)


================================================
FILE: bench/codon/chaos.py
================================================
"""create chaosgame-like fractals
Copyright (C) 2005 Carl Friedrich Bolz

adapted by @arshajii for Codon
"""

import math
import random
import sys
import time

DEFAULT_THICKNESS = 1.0
DEFAULT_WIDTH = 2048 #256
DEFAULT_HEIGHT = 2048 #256
DEFAULT_ITERATIONS = 1000000 #5000
DEFAULT_RNG_SEED = 1234


class GVector(object):

    def __init__(self, x=0, y=0, z=0):
        self.x = x
        self.y = y
        self.z = z

    def Mag(self):
        return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

    def dist(self, other):
        return math.sqrt((self.x - other.x) ** 2
                         + (self.y - other.y) ** 2
                         + (self.z - other.z) ** 2)

    def __add__(self, other):
        if not isinstance(other, GVector):
            raise ValueError("Can't add GVector to " + str(type(other)))
        v = GVector(self.x + other.x, self.y + other.y, self.z + other.z)
        return v

    def __sub__(self, other):
        return self + other * -1

    def __mul__(self, other):
        v = GVector(self.x * other, self.y * other, self.z * other)
        return v
    __rmul__ = __mul__

    def linear_combination(self, other, l1, l2=None):
        if l2 is None:
            l2 = 1 - l1
        v = GVector(self.x * l1 + other.x * l2,
                    self.y * l1 + other.y * l2,
                    self.z * l1 + other.z * l2)
        return v

    def __str__(self):
        return "<%f, %f, %f>" % (self.x, self.y, self.z)

    def __repr__(self):
        return "GVector(%f, %f, %f)" % (self.x, self.y, self.z)


class Spline(object):
    """Class for representing B-Splines and NURBS of arbitrary degree"""

    def __init__(self, points, degree, knots):
        """Creates a Spline.
        points is a list of GVector, degree is the degree of the Spline.
        """
        if len(points) > len(knots) - degree + 1:
            raise ValueError("too many control points")
        elif len(points) < len(knots) - degree + 1:
            raise ValueError("not enough control points")
        last = knots[0]
        for cur in knots[1:]:
            if cur < last:
                raise ValueError("knots not strictly increasing")
            last = cur
        self.knots = knots
        self.points = points
        self.degree = degree

    def GetDomain(self):
        """Returns the domain of the B-Spline"""
        return (self.knots[self.degree - 1],
                self.knots[len(self.knots) - self.degree])

    def __call__(self, u):
        """Calculates a point of the B-Spline using de Boors Algorithm"""
        dom = self.GetDomain()
        if u < dom[0] or u > dom[1]:
            raise ValueError("Function value not in domain")
        if u == dom[0]:
            return self.points[0]
        if u == dom[1]:
            return self.points[-1]
        I = self.GetIndex(u)
        d = [self.points[I - self.degree + 1 + ii]
             for ii in range(self.degree + 1)]
        U = self.knots
        for ik in range(1, self.degree + 1):
            for ii in range(I - self.degree + ik + 1, I + 2):
                ua = U[ii + self.degree - ik]
                ub = U[ii - 1]
                co1 = (ua - u) / (ua - ub)
                co2 = (u - ub) / (ua - ub)
                index = ii - I + self.degree - ik - 1
                d[index] = d[index].linear_combination(d[index + 1], co1, co2)
        return d[0]

    def GetIndex(self, u):
        dom = self.GetDomain()
        for ii in range(self.degree - 1, len(self.knots) - self.degree):
            if u >= self.knots[ii] and u < self.knots[ii + 1]:
                I = ii
                break
        else:
            I = dom[1] - 1
        return I

    def __len__(self):
        return len(self.points)

    def __repr__(self):
        return "Spline(%r, %r, %r)" % (self.points, self.degree, self.knots)


def write_ppm(im, filename):
    magic = 'P6\n'
    maxval = 255
    w = len(im)
    h = len(im[0])

    with open(filename, "w", encoding="latin1", newline='') as fp:
        fp.write(magic)
        fp.write('%i %i\n%i\n' % (w, h, maxval))
        for j in range(h):
            for i in range(w):
                val = im[i][j]
                c = val * 255
                fp.write('%c%c%c' % (c, c, c))


class Chaosgame(object):

    def __init__(self, splines, thickness=0.1):
        self.splines = splines
        self.thickness = thickness
        self.minx = min([p.x for spl in splines for p in spl.points])
        self.miny = min([p.y for spl in splines for p in spl.points])
        self.maxx = max([p.x for spl in splines for p in spl.points])
        self.maxy = max([p.y for spl in splines for p in spl.points])
        self.height = self.maxy - self.miny
        self.width = self.maxx - self.minx
        self.num_trafos = []
        maxlength = thickness * self.width / self.height
        for spl in splines:
            length = 0
            curr = spl(0)
            for i in range(1, 1000):
                last = curr
                t = 1 / 999 * i
                curr = spl(t)
                length += curr.dist(last)
            self.num_trafos.append(max(1, int(length / maxlength * 1.5)))
        self.num_total = sum(self.num_trafos)

    def get_random_trafo(self):
        r = random.randrange(int(self.num_total) + 1)
        l = 0
        for i in range(len(self.num_trafos)):
            if r >= l and r < l + self.num_trafos[i]:
                return i, random.randrange(self.num_trafos[i])
            l += self.num_trafos[i]
        return len(self.num_trafos) - 1, random.randrange(self.num_trafos[-1])

    def transform_point(self, point, trafo=None):
        x = (point.x - self.minx) / self.width
        y = (point.y - self.miny) / self.height
        if trafo is None:
            trafo = self.get_random_trafo()
        start, end = self.splines[trafo[0]].GetDomain()
        length = end - start
        seg_length = length / self.num_trafos[trafo[0]]
        t = start + seg_length * trafo[1] + seg_length * x
        basepoint = self.splines[trafo[0]](t)
        if t + 1 / 50000 > end:
            neighbour = self.splines[trafo[0]](t - 1 / 50000)
            derivative = neighbour - basepoint
        else:
            neighbour = self.splines[trafo[0]](t + 1 / 50000)
            derivative = basepoint - neighbour
        if derivative.Mag() != 0:
            basepoint.x += derivative.y / derivative.Mag() * (y - 0.5) * \
                self.thickness
            basepoint.y += -derivative.x / derivative.Mag() * (y - 0.5) * \
                self.thickness
        else:
            print("r", end='')
        self.truncate(basepoint)
        return basepoint

    def truncate(self, point):
        if point.x >= self.maxx:
            point.x = self.maxx
        if point.y >= self.maxy:
            point.y = self.maxy
        if point.x < self.minx:
            point.x = self.minx
        if point.y < self.miny:
            point.y = self.miny

    def create_image_chaos(self, w, h, iterations, filename, rng_seed):
        # Always use the same sequence of random numbers
        # to get reproducible benchmark
        random.seed(rng_seed)

        im = [[1] * h for i in range(w)]
        point = GVector((self.maxx + self.minx) / 2,
                        (self.maxy + self.miny) / 2, 0)
        for _ in range(iterations):
            point = self.transform_point(point)
            x = (point.x - self.minx) / self.width * w
            y = (point.y - self.miny) / self.height * h
            x = int(x)
            y = int(y)
            if x == w:
                x -= 1
            if y == h:
                y -= 1
            im[x][h - y - 1] = 0

        if filename:
            write_ppm(im, filename)


def main():
    splines = [
        Spline([
            GVector(1.597350, 3.304460, 0.000000),
            GVector(1.575810, 4.123260, 0.000000),
            GVector(1.313210, 5.288350, 0.000000),
            GVector(1.618900, 5.329910, 0.000000),
            GVector(2.889940, 5.502700, 0.000000),
            GVector(2.373060, 4.381830, 0.000000),
            GVector(1.662000, 4.360280, 0.000000)],
            3, [0, 0, 0, 1, 1, 1, 2, 2, 2]),
        Spline([
            GVector(2.804500, 4.017350, 0.000000),
            GVector(2.550500, 3.525230, 0.000000),
            GVector(1.979010, 2.620360, 0.000000),
            GVector(1.979010, 2.620360, 0.000000)],
            3, [0, 0, 0, 1, 1, 1]),
        Spline([
            GVector(2.001670, 4.011320, 0.000000),
            GVector(2.335040, 3.312830, 0.000000),
            GVector(2.366800, 3.233460, 0.000000),
            GVector(2.366800, 3.233460, 0.000000)],
            3, [0, 0, 0, 1, 1, 1])
    ]

    chaos = Chaosgame(splines, DEFAULT_THICKNESS)
    chaos.create_image_chaos(DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_ITERATIONS, sys.argv[1], DEFAULT_RNG_SEED)

t0 = time.time()
main()
t1 = time.time()
print(t1 - t0)


================================================
FILE: bench/codon/fannkuch.codon
================================================
# FANNKUCH benchmark
from math import factorial as fact
from sys import argv
from time import time

def perm(n, i):
    p = [0] * n

    for k in range(n):
        f = fact(n - 1 - k)
        p[k] = i // f
        i = i % f

    for k in range(n - 1, -1, -1):
        for j in range(k - 1, -1, -1):
            if p[j] <= p[k]:
                p[k] += 1

    return p

n = int(argv[1])
max_flips = 0

t0 = time()
@par(schedule='dynamic', num_threads=4)
for idx in range(fact(n)):
    p = perm(n, idx)
    flips = 0
    k = p[0]

    while k:
        i = 0
        j = k
        while i < j:
            p[i], p[j] = p[j], p[i]
            i += 1
            j -= 1

        k = p[0]
        flips += 1

    max_flips = max(flips, max_flips)

print(f'Pfannkuchen({n}) = {max_flips}')
t1 = time()
print(t1 - t0)


================================================
FILE: bench/codon/fannkuch.py
================================================
# FANNKUCH benchmark
from math import factorial as fact
from sys import argv
from time import time

def perm(n, i):
    p = [0] * n

    for k in range(n):
        f = fact(n - 1 - k)
        p[k] = i // f
        i = i % f

    for k in range(n - 1, -1, -1):
        for j in range(k - 1, -1, -1):
            if p[j] <= p[k]:
                p[k] += 1

    return p

n = int(argv[1])
max_flips = 0

t0 = time()
for idx in range(fact(n)):
    p = perm(n, idx)
    flips = 0
    k = p[0]

    while k:
        i = 0
        j = k
        while i < j:
            p[i], p[j] = p[j], p[i]
            i += 1
            j -= 1

        k = p[0]
        flips += 1

    max_flips = max(flips, max_flips)

print(f'Pfannkuchen({n}) = {max_flips}')
t1 = time()
print(t1 - t0)


================================================
FILE: bench/codon/float.py
================================================
from math import sin, cos, sqrt
from time import time

POINTS = 10000000


class Point:
    x: float
    y: float
    z: float

    def __init__(self, i):
        self.x = x = sin(i)
        self.y = cos(i) * 3
        self.z = (x * x) / 2

    def __repr__(self):
        return f"<Point: x={self.x}, y={self.y}, z={self.z}>"

    def normalize(self):
        x = self.x
        y = self.y
        z = self.z
        norm = sqrt(x * x + y * y + z * z)
        self.x /= norm
        self.y /= norm
        self.z /= norm

    def maximize(self, other):
        self.x = self.x if self.x > other.x else other.x
        self.y = self.y if self.y > other.y else other.y
        self.z = self.z if self.z > other.z else other.z
        return self


def maximize(points):
    next = points[0]
    for p in points[1:]:
        next = next.maximize(p)
    return next


def benchmark(n):
    points = [None] * n
    for i in range(n):
        points[i] = Point(i)
    for p in points:
        p.normalize()
    return maximize(points)


t0 = time()
print(benchmark(POINTS))
t1 = time()
print(t1 - t0)


================================================
FILE: bench/codon/go.codon
================================================
"""
Go board game
"""
import math
import random
from time import time

SIZE = 9
GAMES = 200
KOMI = 7.5
EMPTY, WHITE, BLACK = 0, 1, 2
SHOW = {EMPTY: '.', WHITE: 'o', BLACK: 'x'}
PASS = -1
MAXMOVES = SIZE * SIZE * 3
TIMESTAMP = 0
MOVES = 0


def to_pos(x, y):
    return y * SIZE + x


def to_xy(pos):
    y, x = divmod(pos, SIZE)
    return x, y


@dataclass(init=False)
class Square[Board]:
    board: Board
    pos: int
    timestamp: int
    removestamp: int
    zobrist_strings: List[int]
    neighbours: Optional[List[Square[Board]]]
    color: int
    used: bool
    reference: Optional[Square[Board]]
    ledges: int
    temp_ledges: int

    def __init__(self, board, pos):
        self.board = board
        self.pos = pos
        self.timestamp = TIMESTAMP
        self.removestamp = TIMESTAMP
        self.zobrist_strings = [random.randrange(9223372036854775807)
                                for i in range(3)]
        self.neighbours = None
        self.color = EMPTY
        self.used = False
        self.reference = None
        self.ledges = 0
        self.temp_ledges = 0

    def set_neighbours(self):
        x, y = self.pos % SIZE, self.pos // SIZE
        self.neighbours = []
        for dx, dy in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
            newx, newy = x + dx, y + dy
            if 0 <= newx < SIZE and 0 <= newy < SIZE:
                self.neighbours.append(self.board.squares[to_pos(newx, newy)])

    def move(self, color):
        global TIMESTAMP, MOVES
        TIMESTAMP += 1
        MOVES += 1
        self.board.zobrist.update(self, color)
        self.color = color
        self.reference = self
        self.ledges = 0
        self.used = True
        for neighbour in self.neighbours:
            neighcolor = neighbour.color
            if neighcolor == EMPTY:
                self.ledges += 1
            else:
                neighbour_ref = neighbour.find(update=True)
                if neighcolor == color:
                    if neighbour_ref.reference.pos != self.pos:
                        self.ledges += neighbour_ref.ledges
                        neighbour_ref.reference = self
                    self.ledges -= 1
                else:
                    neighbour_ref.ledges -= 1
                    if neighbour_ref.ledges == 0:
                        neighbour.remove(neighbour_ref)
        self.board.zobrist.add()

    def remove(self, reference, update=True):
        self.board.zobrist.update(self, EMPTY)
        self.removestamp = TIMESTAMP
        if update:
            self.color = EMPTY
            self.board.emptyset.add(self.pos)
#            if color == BLACK:
#                self.board.black_dead += 1
#            else:
#                self.board.white_dead += 1
        for neighbour in self.neighbours:
            if neighbour.color != EMPTY and neighbour.removestamp != TIMESTAMP:
                neighbour_ref = neighbour.find(update)
                if neighbour_ref.pos == reference.pos:
                    neighbour.remove(reference, update)
                else:
                    if update:
                        neighbour_ref.ledges += 1

    def find(self, update=False):
        reference = self.reference
        if reference.pos != self.pos:
            reference = reference.find(update)
            if update:
                self.reference = reference
        return reference

    def __repr__(self):
        return repr(to_xy(self.pos))


class EmptySet[Board]:
    board: Board
    empties: List[int]
    empty_pos: List[int]

    def __init__(self, board):
        self.board = board
        self.empties = list(range(SIZE * SIZE))
        self.empty_pos = list(range(SIZE * SIZE))

    def random_choice(self):
        choices = len(self.empties)
        while choices:
            i = int(random.random() * choices)
            pos = self.empties[i]
            if self.board.useful(pos):
                return pos
            choices -= 1
            self.set(i, self.empties[choices])
            self.set(choices, pos)
        return PASS

    def add(self, pos):
        self.empty_pos[pos] = len(self.empties)
        self.empties.append(pos)

    def remove(self, pos):
        self.set(self.empty_pos[pos], self.empties[len(self.empties) - 1])
        self.empties.pop()

    def set(self, i, pos):
        self.empties[i] = pos
        self.empty_pos[pos] = i


class ZobristHash[Board]:
    board: Board
    hash_set: Set[int]
    hash: int

    def __init__(self, board):
        self.board = board
        self.hash_set = set()
        self.hash = 0
        for square in self.board.squares:
            self.hash ^= square.zobrist_strings[EMPTY]
        self.hash_set.clear()
        self.hash_set.add(self.hash)

    def update(self, square, color):
        self.hash ^= square.zobrist_strings[square.color]
        self.hash ^= square.zobrist_strings[color]

    def add(self):
        self.hash_set.add(self.hash)

    def dupe(self):
        return self.hash in self.hash_set


class Board:
    squares: List[Square[Board]]
    emptyset: EmptySet[Board]
    zobrist: ZobristHash[Board]
    color: int
    finished: bool
    lastmove: int
    history: List[int]
    white_dead: int
    black_dead: int

    def __init__(self):
        self.squares = [Square(self, pos) for pos in range(SIZE * SIZE)]
        for square in self.squares:
            square.set_neighbours()
        self.reset()

    def reset(self):
        for square in self.squares:
            square.color = EMPTY
            square.used = False
        self.emptyset = EmptySet(self)
        self.zobrist = ZobristHash(self)
        self.color = BLACK
        self.finished = False
        self.lastmove = -2
        self.history = []
        self.white_dead = 0
        self.black_dead = 0

    def move(self, pos):
        square = self.squares[pos]
        if pos != PASS:
            square.move(self.color)
            self.emptyset.remove(square.pos)
        elif self.lastmove == PASS:
            self.finished = True
        if self.color == BLACK:
            self.color = WHITE
        else:
            self.color = BLACK
        self.lastmove = pos
        self.history.append(pos)

    def random_move(self):
        return self.emptyset.random_choice()

    def useful_fast(self, square):
        if not square.used:
            for neighbour in square.neighbours:
                if neighbour.color == EMPTY:
                    return True
        return False

    def useful(self, pos):
        global TIMESTAMP
        TIMESTAMP += 1
        square = self.squares[pos]
        if self.useful_fast(square):
            return True
        old_hash = self.zobrist.hash
        self.zobrist.update(square, self.color)
        empties = opps = weak_opps = neighs = weak_neighs = 0
        for neighbour in square.neighbours:
            neighcolor = neighbour.color
            if neighcolor == EMPTY:
                empties += 1
                continue
            neighbour_ref = neighbour.find()
            if neighbour_ref.timestamp != TIMESTAMP:
                if neighcolor == self.color:
                    neighs += 1
                else:
                    opps += 1
                neighbour_ref.timestamp = TIMESTAMP
                neighbour_ref.temp_ledges = neighbour_ref.ledges
            neighbour_ref.temp_ledges -= 1
            if neighbour_ref.temp_ledges == 0:
                if neighcolor == self.color:
                    weak_neighs += 1
                else:
                    weak_opps += 1
                    neighbour_ref.remove(neighbour_ref, update=False)
        dupe = self.zobrist.dupe()
        self.zobrist.hash = old_hash
        strong_neighs = neighs - weak_neighs
        strong_opps = opps - weak_opps
        return not dupe and \
            (empties or weak_opps or (strong_neighs and (strong_opps or weak_neighs)))

    def useful_moves(self):
        return [pos for pos in self.emptyset.empties if self.useful(pos)]

    def replay(self, history):
        for pos in history:
            self.move(pos)

    def score(self, color):
        if color == WHITE:
            count = KOMI + self.black_dead
        else:
            count = float(self.white_dead)
        for square in self.squares:
            squarecolor = square.color
            if squarecolor == color:
                count += 1
            elif squarecolor == EMPTY:
                surround = 0
                for neighbour in square.neighbours:
                    if neighbour.color == color:
                        surround += 1
                if surround == len(square.neighbours):
                    count += 1
        return count

    def check(self):
        for square in self.squares:
            if square.color == EMPTY:
                continue

            members1 = set([square])
            changed = True
            while changed:
                changed = False
                for member in members1.copy():
                    for neighbour in member.neighbours:
                        if neighbour.color == square.color and neighbour not in members1:
                            changed = True
                            members1.add(neighbour)
            ledges1 = 0
            for member in members1:
                for neighbour in member.neighbours:
                    if neighbour.color == EMPTY:
                        ledges1 += 1

            root = square.find()

            # print 'members1', square, root, members1
            # print 'ledges1', square, ledges1

            members2 = set()
            for square2 in self.squares:
                if square2.color != EMPTY and square2.find() == root:
                    members2.add(square2)

            ledges2 = root.ledges
            # print 'members2', square, root, members1
            # print 'ledges2', square, ledges2

            assert members1 == members2
            assert ledges1 == ledges2

            set(self.emptyset.empties)

            empties2 = set()
            for square in self.squares:
                if square.color == EMPTY:
                    empties2.add(square.pos)

    def __repr__(self):
        result = []
        for y in range(SIZE):
            start = to_pos(0, y)
            result.append(''.join(
                [SHOW[square.color] + ' ' for square in self.squares[start:start + SIZE]]))
        return '\n'.join(result)


class UCTNode:
    bestchild: Optional[UCTNode]
    pos: int
    wins: int
    losses: int
    pos_child: List[Optional[UCTNode]]
    parent: Optional[UCTNode]
    unexplored: List[int]

    def __init__(self):
        self.bestchild = None
        self.pos = -1
        self.wins = 0
        self.losses = 0
        self.pos_child = [None for x in range(SIZE * SIZE)]
        self.parent = None
        self.unexplored = []

    def play(self, board):
        """ uct tree search """
        color = board.color
        node = self
        path = [node]
        while True:
            pos = node.select(board)
            if pos == PASS:
                break
            board.move(pos)
            child = node.pos_child[pos]
            if not child:
                child = node.pos_child[pos] = UCTNode()
                child.unexplored = board.useful_moves()
                child.pos = pos
                child.parent = node
                path.append(child)
                break
            path.append(child)
            node = child
        self.random_playout(board)
        self.update_path(board, color, path)

    def select(self, board):
        """ select move; unexplored children first, then according to uct value """
        if self.unexplored:
            i = random.randrange(len(self.unexplored))
            pos = self.unexplored[i]
            self.unexplored[i] = self.unexplored[len(self.unexplored) - 1]
            self.unexplored.pop()
            return pos
        elif self.bestchild:
            return self.bestchild.pos
        else:
            return PASS

    def random_playout(self, board):
        """ random play until both players pass """
        for x in range(MAXMOVES):  # XXX while not self.finished?
            if board.finished:
                break
            board.move(board.random_move())

    def update_path(self, board, color, path):
        """ update win/loss count along path """
        wins = board.score(BLACK) >= board.score(WHITE)
        for node in path:
            if color == BLACK:
                color = WHITE
            else:
                color = BLACK
            if wins == (color == BLACK):
                node.wins += 1
            else:
                node.losses += 1
            if node.parent:
                node.parent.bestchild = node.parent.best_child()

    def score(self):
        winrate = self.wins / float(self.wins + self.losses)
        parentvisits = self.parent.wins + self.parent.losses
        if not parentvisits:
            return winrate
        nodevisits = self.wins + self.losses
        return winrate + math.sqrt((math.log(parentvisits)) / (5 * nodevisits))

    def best_child(self):
        maxscore = -1.
        maxchild = None
        for child in self.pos_child:
            if child and child.score() > maxscore:
                maxchild = child
                maxscore = child.score()
        return maxchild

    def best_visited(self):
        maxvisits = -1
        maxchild = None
        for child in self.pos_child:
            #            if child:
            # print to_xy(child.pos), child.wins, child.losses, child.score()
            if child and (child.wins + child.losses) > maxvisits:
                maxvisits, maxchild = (child.wins + child.losses), child
        return maxchild


# def user_move(board):
#     while True:
#         text = input('?').strip()
#         if text == 'p':
#             return PASS
#         if text == 'q':
#             raise EOFError
#         try:
#             x, y = [int(i) for i in text.split()]
#         except ValueError:
#             continue
#         if not (0 <= x < SIZE and 0 <= y < SIZE):
#             continue
#         pos = to_pos(x, y)
#         if board.useful(pos):
#             return pos


def computer_move(board):
    pos = board.random_move()
    if pos == PASS:
        return PASS
    tree = UCTNode()
    tree.unexplored = board.useful_moves()
    nboard = Board()
    for game in range(GAMES):
        node = tree
        nboard.reset()
        nboard.replay(board.history)
        node.play(nboard)
    return tree.best_visited().pos


def versus_cpu():
    for i in range(100):
        random.seed(i)
        board = Board()
        computer_move(board)


if __name__ == "__main__":
    t0 = time()
    versus_cpu()
    t1 = time()
    print(t1 - t0)


================================================
FILE: bench/codon/go.py
================================================
"""
Go board game
"""
import math
import random
from time import time

SIZE = 9
GAMES = 200
KOMI = 7.5
EMPTY, WHITE, BLACK = 0, 1, 2
SHOW = {EMPTY: '.', WHITE: 'o', BLACK: 'x'}
PASS = -1
MAXMOVES = SIZE * SIZE * 3
TIMESTAMP = 0
MOVES = 0


def to_pos(x, y):
    return y * SIZE + x


def to_xy(pos):
    y, x = divmod(pos, SIZE)
    return x, y


class Square:

    def __init__(self, board, pos):
        self.board = board
        self.pos = pos
        self.timestamp = TIMESTAMP
        self.removestamp = TIMESTAMP
        self.zobrist_strings = [random.randrange(9223372036854775807)
                                for i in range(3)]

    def set_neighbours(self):
        x, y = self.pos % SIZE, self.pos // SIZE
        self.neighbours = []
        for dx, dy in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
            newx, newy = x + dx, y + dy
            if 0 <= newx < SIZE and 0 <= newy < SIZE:
                self.neighbours.append(self.board.squares[to_pos(newx, newy)])

    def move(self, color):
        global TIMESTAMP, MOVES
        TIMESTAMP += 1
        MOVES += 1
        self.board.zobrist.update(self, color)
        self.color = color
        self.reference = self
        self.ledges = 0
        self.used = True
        for neighbour in self.neighbours:
            neighcolor = neighbour.color
            if neighcolor == EMPTY:
                self.ledges += 1
            else:
                neighbour_ref = neighbour.find(update=True)
                if neighcolor == color:
                    if neighbour_ref.reference.pos != self.pos:
                        self.ledges += neighbour_ref.ledges
                        neighbour_ref.reference = self
                    self.ledges -= 1
                else:
                    neighbour_ref.ledges -= 1
                    if neighbour_ref.ledges == 0:
                        neighbour.remove(neighbour_ref)
        self.board.zobrist.add()

    def remove(self, reference, update=True):
        self.board.zobrist.update(self, EMPTY)
        self.removestamp = TIMESTAMP
        if update:
            self.color = EMPTY
            self.board.emptyset.add(self.pos)
#            if color == BLACK:
#                self.board.black_dead += 1
#            else:
#                self.board.white_dead += 1
        for neighbour in self.neighbours:
            if neighbour.color != EMPTY and neighbour.removestamp != TIMESTAMP:
                neighbour_ref = neighbour.find(update)
                if neighbour_ref.pos == reference.pos:
                    neighbour.remove(reference, update)
                else:
                    if update:
                        neighbour_ref.ledges += 1

    def find(self, update=False):
        reference = self.reference
        if reference.pos != self.pos:
            reference = reference.find(update)
            if update:
                self.reference = reference
        return reference

    def __repr__(self):
        return repr(to_xy(self.pos))


class EmptySet:

    def __init__(self, board):
        self.board = board
        self.empties = list(range(SIZE * SIZE))
        self.empty_pos = list(range(SIZE * SIZE))

    def random_choice(self):
        choices = len(self.empties)
        while choices:
            i = int(random.random() * choices)
            pos = self.empties[i]
            if self.board.useful(pos):
                return pos
            choices -= 1
            self.set(i, self.empties[choices])
            self.set(choices, pos)
        return PASS

    def add(self, pos):
        self.empty_pos[pos] = len(self.empties)
        self.empties.append(pos)

    def remove(self, pos):
        self.set(self.empty_pos[pos], self.empties[len(self.empties) - 1])
        self.empties.pop()

    def set(self, i, pos):
        self.empties[i] = pos
        self.empty_pos[pos] = i


class ZobristHash:

    def __init__(self, board):
        self.board = board
        self.hash_set = set()
        self.hash = 0
        for square in self.board.squares:
            self.hash ^= square.zobrist_strings[EMPTY]
        self.hash_set.clear()
        self.hash_set.add(self.hash)

    def update(self, square, color):
        self.hash ^= square.zobrist_strings[square.color]
        self.hash ^= square.zobrist_strings[color]

    def add(self):
        self.hash_set.add(self.hash)

    def dupe(self):
        return self.hash in self.hash_set


class Board:

    def __init__(self):
        self.squares = [Square(self, pos) for pos in range(SIZE * SIZE)]
        for square in self.squares:
            square.set_neighbours()
        self.reset()

    def reset(self):
        for square in self.squares:
            square.color = EMPTY
            square.used = False
        self.emptyset = EmptySet(self)
        self.zobrist = ZobristHash(self)
        self.color = BLACK
        self.finished = False
        self.lastmove = -2
        self.history = []
        self.white_dead = 0
        self.black_dead = 0

    def move(self, pos):
        square = self.squares[pos]
        if pos != PASS:
            square.move(self.color)
            self.emptyset.remove(square.pos)
        elif self.lastmove == PASS:
            self.finished = True
        if self.color == BLACK:
            self.color = WHITE
        else:
            self.color = BLACK
        self.lastmove = pos
        self.history.append(pos)

    def random_move(self):
        return self.emptyset.random_choice()

    def useful_fast(self, square):
        if not square.used:
            for neighbour in square.neighbours:
                if neighbour.color == EMPTY:
                    return True
        return False

    def useful(self, pos):
        global TIMESTAMP
        TIMESTAMP += 1
        square = self.squares[pos]
        if self.useful_fast(square):
            return True
        old_hash = self.zobrist.hash
        self.zobrist.update(square, self.color)
        empties = opps = weak_opps = neighs = weak_neighs = 0
        for neighbour in square.neighbours:
            neighcolor = neighbour.color
            if neighcolor == EMPTY:
                empties += 1
                continue
            neighbour_ref = neighbour.find()
            if neighbour_ref.timestamp != TIMESTAMP:
                if neighcolor == self.color:
                    neighs += 1
                else:
                    opps += 1
                neighbour_ref.timestamp = TIMESTAMP
                neighbour_ref.temp_ledges = neighbour_ref.ledges
            neighbour_ref.temp_ledges -= 1
            if neighbour_ref.temp_ledges == 0:
                if neighcolor == self.color:
                    weak_neighs += 1
                else:
                    weak_opps += 1
                    neighbour_ref.remove(neighbour_ref, update=False)
        dupe = self.zobrist.dupe()
        self.zobrist.hash = old_hash
        strong_neighs = neighs - weak_neighs
        strong_opps = opps - weak_opps
        return not dupe and \
            (empties or weak_opps or (strong_neighs and (strong_opps or weak_neighs)))

    def useful_moves(self):
        return [pos for pos in self.emptyset.empties if self.useful(pos)]

    def replay(self, history):
        for pos in history:
            self.move(pos)

    def score(self, color):
        if color == WHITE:
            count = KOMI + self.black_dead
        else:
            count = self.white_dead
        for square in self.squares:
            squarecolor = square.color
            if squarecolor == color:
                count += 1
            elif squarecolor == EMPTY:
                surround = 0
                for neighbour in square.neighbours:
                    if neighbour.color == color:
                        surround += 1
                if surround == len(square.neighbours):
                    count += 1
        return count

    def check(self):
        for square in self.squares:
            if square.color == EMPTY:
                continue

            members1 = set([square])
            changed = True
            while changed:
                changed = False
                for member in members1.copy():
                    for neighbour in member.neighbours:
                        if neighbour.color == square.color and neighbour not in members1:
                            changed = True
                            members1.add(neighbour)
            ledges1 = 0
            for member in members1:
                for neighbour in member.neighbours:
                    if neighbour.color == EMPTY:
                        ledges1 += 1

            root = square.find()

            # print 'members1', square, root, members1
            # print 'ledges1', square, ledges1

            members2 = set()
            for square2 in self.squares:
                if square2.color != EMPTY and square2.find() == root:
                    members2.add(square2)

            ledges2 = root.ledges
            # print 'members2', square, root, members1
            # print 'ledges2', square, ledges2

            assert members1 == members2
            assert ledges1 == ledges2, ('ledges differ at %r: %d %d' % (
                square, ledges1, ledges2))

            set(self.emptyset.empties)

            empties2 = set()
            for square in self.squares:
                if square.color == EMPTY:
                    empties2.add(square.pos)

    def __repr__(self):
        result = []
        for y in range(SIZE):
            start = to_pos(0, y)
            result.append(''.join(
                [SHOW[square.color] + ' ' for square in self.squares[start:start + SIZE]]))
        return '\n'.join(result)


class UCTNode:

    def __init__(self):
        self.bestchild = None
        self.pos = -1
        self.wins = 0
        self.losses = 0
        self.pos_child = [None for x in range(SIZE * SIZE)]
        self.parent = None

    def play(self, board):
        """ uct tree search """
        color = board.color
        node = self
        path = [node]
        while True:
            pos = node.select(board)
            if pos == PASS:
                break
            board.move(pos)
            child = node.pos_child[pos]
            if not child:
                child = node.pos_child[pos] = UCTNode()
                child.unexplored = board.useful_moves()
                child.pos = pos
                child.parent = node
                path.append(child)
                break
            path.append(child)
            node = child
        self.random_playout(board)
        self.update_path(board, color, path)

    def select(self, board):
        """ select move; unexplored children first, then according to uct value """
        if self.unexplored:
            i = random.randrange(len(self.unexplored))
            pos = self.unexplored[i]
            self.unexplored[i] = self.unexplored[len(self.unexplored) - 1]
            self.unexplored.pop()
            return pos
        elif self.bestchild:
            return self.bestchild.pos
        else:
            return PASS

    def random_playout(self, board):
        """ random play until both players pass """
        for x in range(MAXMOVES):  # XXX while not self.finished?
            if board.finished:
                break
            board.move(board.random_move())

    def update_path(self, board, color, path):
        """ update win/loss count along path """
        wins = board.score(BLACK) >= board.score(WHITE)
        for node in path:
            if color == BLACK:
                color = WHITE
            else:
                color = BLACK
            if wins == (color == BLACK):
                node.wins += 1
            else:
                node.losses += 1
            if node.parent:
                node.parent.bestchild = node.parent.best_child()

    def score(self):
        winrate = self.wins / float(self.wins + self.losses)
        parentvisits = self.parent.wins + self.parent.losses
        if not parentvisits:
            return winrate
        nodevisits = self.wins + self.losses
        return winrate + math.sqrt((math.log(parentvisits)) / (5 * nodevisits))

    def best_child(self):
        maxscore = -1
        maxchild = None
        for child in self.pos_child:
            if child and child.score() > maxscore:
                maxchild = child
                maxscore = child.score()
        return maxchild

    def best_visited(self):
        maxvisits = -1
        maxchild = None
        for child in self.pos_child:
            #            if child:
            # print to_xy(child.pos), child.wins, child.losses, child.score()
            if child and (child.wins + child.losses) > maxvisits:
                maxvisits, maxchild = (child.wins + child.losses), child
        return maxchild


# def user_move(board):
#     while True:
#         text = input('?').strip()
#         if text == 'p':
#             return PASS
#         if text == 'q':
#             raise EOFError
#         try:
#             x, y = [int(i) for i in text.split()]
#         except ValueError:
#             continue
#         if not (0 <= x < SIZE and 0 <= y < SIZE):
#             continue
#         pos = to_pos(x, y)
#         if board.useful(pos):
#             return pos


def computer_move(board):
    pos = board.random_move()
    if pos == PASS:
        return PASS
    tree = UCTNode()
    tree.unexplored = board.useful_moves()
    nboard = Board()
    for game in range(GAMES):
        node = tree
        nboard.reset()
        nboard.replay(board.history)
        node.play(nboard)
    return tree.best_visited().pos


def versus_cpu():
    for i in range(100):
        random.seed(i)
        board = Board()
        computer_move(board)


if __name__ == "__main__":
    t0 = time()
    versus_cpu()
    t1 = time()
    print(t1 - t0)


================================================
FILE: bench/codon/mandelbrot.codon
================================================
import time
MAX    = 1000  # maximum Mandelbrot iterations
N      = 4096  # width and height of image
pixels = [0 for _ in range(N * N)]

def scale(x, a, b):
    return a + (x/N)*(b - a)

t0 = time.time()
@par(gpu=True, collapse=2)
for i in range(N):
    for j in range(N):
        c = complex(scale(j, -2.00, 0.47), scale(i, -1.12, 1.12))
        z = 0j
        iteration = 0

        while abs(z) <= 2 and iteration < MAX:
            z = z**2 + c
            iteration += 1

        pixels[i*N + j] = int(255 * iteration/MAX)
print(sum(pixels))
print(time.time() - t0)


================================================
FILE: bench/codon/mandelbrot.py
================================================
import time
MAX    = 1000  # maximum Mandelbrot iterations
N      = 4096  # width and height of image
pixels = [0 for _ in range(N * N)]

def scale(x, a, b):
    return a + (x/N)*(b - a)

t0 = time.time()
for i in range(N):
    for j in range(N):
        c = complex(scale(j, -2.00, 0.47), scale(i, -1.12, 1.12))
        z = 0j
        iteration = 0

        while abs(z) <= 2 and iteration < MAX:
            z = z**2 + c
            iteration += 1

        pixels[i*N + j] = int(255 * iteration/MAX)
print(sum(pixels))
print(time.time() - t0)


================================================
FILE: bench/codon/nbody.cpp
================================================
#include <chrono>
#include <cmath>
#include <iostream>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

namespace {

const double PI = 3.14159265358979323;
const double SOLAR_MASS = 4 * PI * PI;
const double DAYS_PER_YEAR = 365.24;

struct Body {
  std::vector<double> r, v;
  double m;
};

std::unordered_map<std::string, Body> BODIES = {
    {"sun", {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, SOLAR_MASS}},
    {"jupiter",
     {{4.84143144246472090e+00, -1.16032004402742839e+00, -1.03622044471123109e-01},
      {1.66007664274403694e-03 * DAYS_PER_YEAR, 7.69901118419740425e-03 * DAYS_PER_YEAR,
       -6.90460016972063023e-05 * DAYS_PER_YEAR},
      9.54791938424326609e-04 * SOLAR_MASS}},
    {"saturn",
     {{8.34336671824457987e+00, 4.12479856412430479e+00, -4.03523417114321381e-01},
      {-2.76742510726862411e-03 * DAYS_PER_YEAR,
       4.99852801234917238e-03 * DAYS_PER_YEAR,
       2.30417297573763929e-05 * DAYS_PER_YEAR},
      2.85885980666130812e-04 * SOLAR_MASS}},
    {"uranus",
     {{1.28943695621391310e+01, -1.51111514016986312e+01, -2.23307578892655734e-01},
      {2.96460137564761618e-03 * DAYS_PER_YEAR, 2.37847173959480950e-03 * DAYS_PER_YEAR,
       -2.96589568540237556e-05 * DAYS_PER_YEAR},
      4.36624404335156298e-05 * SOLAR_MASS}},
    {"neptune",
     {{1.53796971148509165e+01, -2.59193146099879641e+01, 1.79258772950371181e-01},
      {2.68067772490389322e-03 * DAYS_PER_YEAR, 1.62824170038242295e-03 * DAYS_PER_YEAR,
       -9.51592254519715870e-05 * DAYS_PER_YEAR},
      5.15138902046611451e-05 * SOLAR_MASS}},
};

template <typename K, typename V> auto values(std::unordered_map<K, V> &m) {
  std::vector<V *> v;
  v.reserve(m.size());
  for (auto &e : m)
    v.push_back(&e.second);
  return v;
}

template <typename T> auto combinations(const std::vector<T> &v) {
  std::vector<std::pair<T, T>> p;
  auto n = v.size();
  p.reserve(n);
  for (auto i = 0; i < n - 1; i++)
    for (auto j = i + 1; j < n; j++)
      p.push_back({v[i], v[j]});
  return p;
}

std::vector<Body *> SYSTEM = values(BODIES);
auto PAIRS = combinations(SYSTEM);

void advance(double dt, int n, std::vector<Body *> &bodies = SYSTEM,
             std::vector<std::pair<Body *, Body *>> &pairs = PAIRS) {
  for (int i = 0; i < n; i++) {
    for (auto &pair : pairs) {
      double x1 = pair.first->r[0], y1 = pair.first->r[1], z1 = pair.first->r[2];
      auto &v1 = pair.first->v;
      double m1 = pair.first->m;
      double x2 = pair.second->r[0], y2 = pair.second->r[1], z2 = pair.second->r[2];
      auto &v2 = pair.second->v;
      double m2 = pair.second->m;
      double dx = x1 - x2, dy = y1 - y2, dz = z1 - z2;
      double mag = dt * std::pow((dx * dx + dy * dy + dz * dz), -1.5);
      double b1m = m1 * mag;
      double b2m = m2 * mag;
      v1[0] -= dx * b2m;
      v1[1] -= dy * b2m;
      v1[2] -= dz * b2m;
      v2[0] += dx * b1m;
      v2[1] += dy * b1m;
      v2[2] += dz * b1m;
    }

    for (auto *body : bodies) {
      auto &r = body->r;
      double vx = body->v[0], vy = body->v[1], vz = body->v[2];
      r[0] += dt * vx;
      r[1] += dt * vy;
      r[2] += dt * vz;
    }
  }
}

void report_energy(std::vector<Body *> &bodies = SYSTEM,
                   std::vector<std::pair<Body *, Body *>> &pairs = PAIRS,
                   double e = 0.0) {
  for (auto &pair : pairs) {
    double x1 = pair.first->r[0], y1 = pair.first->r[1], z1 = pair.first->r[2];
    auto &v1 = pair.first->v;
    double m1 = pair.first->m;
    double x2 = pair.second->r[0], y2 = pair.second->r[1], z2 = pair.second->r[2];
    auto &v2 = pair.second->v;
    double m2 = pair.second->m;
    double dx = x1 - x2, dy = y1 - y2, dz = z1 - z2;
    e -= (m1 * m2) / std::pow((dx * dx + dy * dy + dz * dz), 0.5);
  }

  for (auto *body : bodies) {
    double vx = body->v[0], vy = body->v[1], vz = body->v[2];
    double m = body->m;
    e += m * (vx * vx + vy * vy + vz * vz) / 2.;
  }

  std::cout << e << std::endl;
}

void offset_momentum(Body &ref, std::vector<Body *> &bodies = SYSTEM, double px = 0.0,
                     double py = 0.0, double pz = 0.0) {
  for (auto *body : bodies) {
    double vx = body->v[0], vy = body->v[1], vz = body->v[2];
    double m = body->m;
    px -= vx * m;
    py -= vy * m;
    pz -= vz * m;
  }

  auto &v = ref.v;
  double m = ref.m;
  v[0] = px / m;
  v[1] = py / m;
  v[2] = pz / m;
}

} // namespace

int main(int argc, char *argv[]) {
  using clock = std::chrono::high_resolution_clock;
  using std::chrono::duration_cast;
  using std::chrono::milliseconds;

  auto t = clock::now();
  std::string ref = "sun";
  offset_momentum(BODIES[ref]);
  report_energy();
  advance(0.01, std::atoi(argv[1]));
  report_energy();
  std::cout << (duration_cast<milliseconds>(clock::now() - t).count() / 1e3)
            << std::endl;
}


================================================
FILE: bench/codon/nbody.py
================================================
# The Computer Language Benchmarks Game
# http://benchmarksgame.alioth.debian.org/
#
# originally by Kevin Carson
# modified by Tupteq, Fredrik Johansson, and Daniel Nanz
# modified by Maciej Fijalkowski
# modified by @arshajii
# 2to3

from time import time
import sys

def combinations(l):
    result = []
    for x in range(len(l) - 1):
        ls = l[x+1:]
        for y in ls:
            result.append((l[x],y))
    return result

PI = 3.14159265358979323
SOLAR_MASS = 4 * PI * PI
DAYS_PER_YEAR = 365.24

BODIES = {
    'sun': ([0.0, 0.0, 0.0], [0.0, 0.0, 0.0], SOLAR_MASS),

    'jupiter': ([4.84143144246472090e+00,
                 -1.16032004402742839e+00,
                 -1.03622044471123109e-01],
                [1.66007664274403694e-03 * DAYS_PER_YEAR,
                 7.69901118419740425e-03 * DAYS_PER_YEAR,
                 -6.90460016972063023e-05 * DAYS_PER_YEAR],
                9.54791938424326609e-04 * SOLAR_MASS),

    'saturn': ([8.34336671824457987e+00,
                4.12479856412430479e+00,
                -4.03523417114321381e-01],
               [-2.76742510726862411e-03 * DAYS_PER_YEAR,
                4.99852801234917238e-03 * DAYS_PER_YEAR,
                2.30417297573763929e-05 * DAYS_PER_YEAR],
               2.85885980666130812e-04 * SOLAR_MASS),

    'uranus': ([1.28943695621391310e+01,
                -1.51111514016986312e+01,
                -2.23307578892655734e-01],
               [2.96460137564761618e-03 * DAYS_PER_YEAR,
                2.37847173959480950e-03 * DAYS_PER_YEAR,
                -2.96589568540237556e-05 * DAYS_PER_YEAR],
               4.36624404335156298e-05 * SOLAR_MASS),

    'neptune': ([1.53796971148509165e+01,
                 -2.59193146099879641e+01,
                 1.79258772950371181e-01],
                [2.68067772490389322e-03 * DAYS_PER_YEAR,
                 1.62824170038242295e-03 * DAYS_PER_YEAR,
                 -9.51592254519715870e-05 * DAYS_PER_YEAR],
                5.15138902046611451e-05 * SOLAR_MASS) }


SYSTEM = list(BODIES.values())
PAIRS = combinations(SYSTEM)


def advance(dt, n, bodies=SYSTEM, pairs=PAIRS):

    for i in range(n):
        for (([x1, y1, z1], v1, m1),
             ([x2, y2, z2], v2, m2)) in pairs:
            dx = x1 - x2
            dy = y1 - y2
            dz = z1 - z2
            mag = dt * ((dx * dx + dy * dy + dz * dz) ** (-1.5))
            b1m = m1 * mag
            b2m = m2 * mag
            v1[0] -= dx * b2m
            v1[1] -= dy * b2m
            v1[2] -= dz * b2m
            v2[0] += dx * b1m
            v2[1] += dy * b1m
            v2[2] += dz * b1m
        for (r, [vx, vy, vz], m) in bodies:
            r[0] += dt * vx
            r[1] += dt * vy
            r[2] += dt * vz


def report_energy(bodies=SYSTEM, pairs=PAIRS, e=0.0):

    for (((x1, y1, z1), v1, m1),
         ((x2, y2, z2), v2, m2)) in pairs:
        dx = x1 - x2
        dy = y1 - y2
        dz = z1 - z2
        e -= (m1 * m2) / ((dx * dx + dy * dy + dz * dz) ** 0.5)
    for (r, [vx, vy, vz], m) in bodies:
        e += m * (vx * vx + vy * vy + vz * vz) / 2.
    print(e)

def offset_momentum(ref, bodies=SYSTEM, px=0.0, py=0.0, pz=0.0):

    for (r, [vx, vy, vz], m) in bodies:
        px -= vx * m
        py -= vy * m
        pz -= vz * m
    (r, v, m) = ref
    v[0] = px / m
    v[1] = py / m
    v[2] = pz / m

def main(n, ref='sun'):
    offset_momentum(BODIES[ref])
    report_energy()
    advance(0.01, n)
    report_energy()

t0 = time()
main(int(sys.argv[1]))
t1 = time()
print(t1 - t0)


================================================
FILE: bench/codon/npbench.codon
================================================
import numpy as np
from numpy.random import default_rng
import npbench_lib as bench
import time


def run(b, prep, **kwargs):
    n = prep.__class__.__name__.split("(")[0]
    with time.timing(f"{n}.prep"):
        data = prep(**kwargs)
    with time.timing(f"{n}.run"):
        if isinstance(data, Tuple):
            return b(*data)
        else:
            return b(data)


def rng_complex(shape, rng):
    return (rng.random(shape) + rng.random(shape) * 1j)


def adi(N, TSTEPS, datatype=np.float64):
    u = np.fromfunction(lambda i, j: (i + N - j) / N, (N, N), dtype=datatype)
    return TSTEPS, N, u
run(bench.adi, adi, N=500, TSTEPS=50)


def arc_distance(N):
    rng = default_rng(42)
    t0, p0, t1, p1 = rng.random((N, )), rng.random((N, )), rng.random(
        (N, )), rng.random((N, ))
    return t0, p0, t1, p1
run(bench.arc_distance, arc_distance, N=10000000)


def azimint_naive(N, npt):
    rng = default_rng(42)
    data, radius = rng.random((N, )), rng.random((N, ))
    return data, radius, npt
run(bench.azimint_naive, azimint_naive, N=4000000, npt=1000)


def azimint_hist(N, npt):
    rng = default_rng(42)
    data, radius = rng.random((N, )), rng.random((N, ))
    return data, radius, npt
run(bench.azimint_hist, azimint_hist, N=40000000, npt=1000)


def atax(M, N, datatype=np.float64):
    fn = datatype(N)
    x = np.fromfunction(lambda i: 1 + (i / fn), (N, ), dtype=datatype)
    A = np.fromfunction(lambda i, j: ((i + j) % N) / (5 * M), (M, N),
                        dtype=datatype)
    return A, x
run(bench.atax, atax, M=20000, N=25000)


def bicg(M, N, datatype=np.float64):
    A = np.fromfunction(lambda i, j: (i * (j + 1) % N) / N, (N, M),
                        dtype=datatype)
    p = np.fromfunction(lambda i: (i % M) / M, (M, ), dtype=datatype)
    r = np.fromfunction(lambda i: (i % N) / N, (N, ), dtype=datatype)
    return A, p, r
run(bench.bicg, bicg, M=20000, N=25000)


def cavity_flow(ny, nx, nt, nit, rho, nu):
    u = np.zeros((ny, nx), dtype=np.float64)
    v = np.zeros((ny, nx), dtype=np.float64)
    p = np.zeros((ny, nx), dtype=np.float64)
    dx = 2 / (nx - 1)
    dy = 2 / (ny - 1)
    dt = .1 / ((nx - 1) * (ny - 1))

    return nx, ny, nt, nit, u, v, dt, dx, dy, p, rho, nu
run(bench.cavity_flow, cavity_flow, ny=101, nx=101, nt=700, nit=50, rho=1.0, nu=0.1)


def channel_flow(ny, nx, nit, rho, nu, F):
    u = np.zeros((ny, nx), dtype=np.float64)
    v = np.zeros((ny, nx), dtype=np.float64)
    p = np.ones((ny, nx), dtype=np.float64)
    dx = 2 / (nx - 1)
    dy = 2 / (ny - 1)
    dt = .1 / ((nx - 1) * (ny - 1))
    return nit, u, v, dt, dx, dy, p, rho, nu, F
run(bench.channel_flow, channel_flow, ny=101, nx=101, nit=50, rho=1.0, nu=0.1, F=1.0)


def cholesky(N, datatype=np.float64):
    A = np.empty((N, N), dtype=datatype)
    for i in range(N):
        A[i, :i + 1] = np.fromfunction(lambda j: (-j % N) / N + 1, (i + 1, ),
                                       dtype=datatype)
        A[i, i + 1:] = 0.0
        A[i, i] = 1.0
    A[:] = A @ np.transpose(A)
    return A
run(bench.cholesky, cholesky, N=2000)


def cholesky2(N, datatype=np.float64):
    A = np.empty((N, N), dtype=datatype)
    for i in range(N):
        A[i, :i + 1] = np.fromfunction(lambda j: (-j % N) / N + 1, (i + 1, ),
                                       dtype=datatype)
        A[i, i + 1:] = 0.0
        A[i, i] = 1.0
    A[:] = A @ np.transpose(A)
    return A
run(bench.cholesky2, cholesky2, N=8000)


def compute(M, N):
    rng = default_rng(42)
    array_1 = rng.uniform(0, 1000, size=(M, N)).astype(np.int64)
    array_2 = rng.uniform(0, 1000, size=(M, N)).astype(np.int64)
    a = np.int64(4)
    b = np.int64(3)
    c = np.int64(9)
    return array_1, array_2, a, b, c
run(bench.compute, compute, M=16000, N=16000)


def contour_integral(NR, NM, slab_per_bc, num_int_pts):
    rng = default_rng(42)
    Ham = rng_complex((slab_per_bc + 1, NR, NR), rng)
    int_pts = rng_complex((num_int_pts, ), rng)
    Y = rng_complex((NR, NM), rng)
    return NR, NM, slab_per_bc, Ham, int_pts, Y
run(bench.contour_integral, contour_integral, NR=600, NM=1000, slab_per_bc=2, num_int_pts=32)


def conv2d_bias(C_in, C_out, H, K, N, W):
    rng = default_rng(42)
    # NHWC data layout
    input = rng.random((N, H, W, C_in), dtype=np.float32)
    # Weights
    weights = rng.random((K, K, C_in, C_out), dtype=np.float32)
    bias = rng.random((C_out, ), dtype=np.float32)
    return input, weights, bias
run(bench.conv2d_bias, conv2d_bias, N=8, C_in=3, C_out=16, K=20, H=256, W=256)


def correlation(M, N, datatype=np.float64):
    float_n = datatype(N)
    data = np.fromfunction(lambda i, j: (i * j) / M + i, (N, M),
                           dtype=datatype)
    return M, float_n, data
run(bench.correlation, correlation, M=3200, N=4000)


def covariance(M, N, datatype=np.float64):
    float_n = datatype(N)
    data = np.fromfunction(lambda i, j: (i * j) / M, (N, M), dtype=datatype)
    return M, float_n, data
run(bench.covariance, covariance, M=3200, N=4000)


def crc16(N):
    rng = default_rng(42)
    data = rng.integers(0, 256, size=(N, ), dtype=np.uint8)
    return data
run(bench.crc16, crc16, N=1000000)


def deriche(W, H, datatype=np.float64):
    alpha = datatype(0.25)
    imgIn = np.fromfunction(lambda i, j:
                            ((313 * i + 991 * j) % 65536) / 65535.0, (W, H),
                            dtype=datatype)
    return alpha, imgIn
run(bench.deriche, deriche, W=7680, H=4320)


def doitgen(NR, NQ, NP, datatype=np.float64):
    A = np.fromfunction(lambda i, j, k: ((i * j + k) % NP) / NP, (NR, NQ, NP),
                        dtype=datatype)
    C4 = np.fromfunction(lambda i, j: (i * j % NP) / NP, (NP, NP),
                         dtype=datatype)
    return NR, NQ, NP, A, C4
run(bench.doitgen, doitgen, NR=220, NQ=250, NP=512)


def durbin(N, datatype=np.float64):
    r = np.fromfunction(lambda i: N + 1 - i, (N, ), dtype=datatype)
    return r
run(bench.durbin, durbin, N=20000)


def fdtd_2d(TMAX, NX, NY, datatype=np.float64):
    ex = np.fromfunction(lambda i, j: (i * (j + 1)) / NX, (NX, NY),
                         dtype=datatype)
    ey = np.fromfunction(lambda i, j: (i * (j + 2)) / NY, (NX, NY),
                         dtype=datatype)
    hz = np.fromfunction(lambda i, j: (i * (j + 3)) / NX, (NX, NY),
                         dtype=datatype)
    _fict_ = np.fromfunction(lambda i: i, (TMAX, ), dtype=datatype)
    return TMAX, ex, ey, hz, _fict_
run(bench.fdtd_2d, fdtd_2d, TMAX=500, NX=1000, NY=1200)


def floyd_warshall(N, datatype=np.int32):
    path = np.fromfunction(lambda i, j: i * j % 7i32 + 1i32, (N, N), dtype=datatype)
    for i in range(N):
        for j in range(N):
            if (i + j) % 13 == 0 or (i + j) % 7 == 0 or (i + j) % 11 == 0:
                path[i, j] = 999
    return path
run(bench.floyd_warshall, floyd_warshall, N=850)


def gemm(NI, NJ, NK, datatype=np.float64):
    alpha = datatype(1.5)
    beta = datatype(1.2)
    C = np.fromfunction(lambda i, j: ((i * j + 1) % NI) / NI, (NI, NJ),
                        dtype=datatype)
    A = np.fromfunction(lambda i, k: (i * (k + 1) % NK) / NK, (NI, NK),
                        dtype=datatype)
    B = np.fromfunction(lambda k, j: (k * (j + 2) % NJ) / NJ, (NK, NJ),
                        dtype=datatype)
    return alpha, beta, C, A, B
run(bench.gemm, gemm, NI=7000, NJ=7500, NK=8000)


def gemver(N, datatype=np.float64):
    alpha = datatype(1.5)
    beta = datatype(1.2)
    fn = datatype(N)
    A = np.fromfunction(lambda i, j: (i * j % N) / N, (N, N), dtype=datatype)
    u1 = np.fromfunction(lambda i: i, (N, ), dtype=datatype)
    u2 = np.fromfunction(lambda i: ((i + 1) / fn) / 2.0, (N, ), dtype=datatype)
    v1 = np.fromfunction(lambda i: ((i + 1) / fn) / 4.0, (N, ), dtype=datatype)
    v2 = np.fromfunction(lambda i: ((i + 1) / fn) / 6.0, (N, ), dtype=datatype)
    w = np.zeros((N, ), dtype=datatype)
    x = np.zeros((N, ), dtype=datatype)
    y = np.fromfunction(lambda i: ((i + 1) / fn) / 8.0, (N, ), dtype=datatype)
    z = np.fromfunction(lambda i: ((i + 1) / fn) / 9.0, (N, ), dtype=datatype)
    return alpha, beta, A, u1, v1, u2, v2, w, x, y, z
run(bench.gemver, gemver, N=10000)


def gesummv(N, datatype=np.float64):
    alpha = datatype(1.5)
    beta = datatype(1.2)
    A = np.fromfunction(lambda i, j: ((i * j + 1) % N) / N, (N, N),
                        dtype=datatype)
    B = np.fromfunction(lambda i, j: ((i * j + 2) % N) / N, (N, N),
                        dtype=datatype)
    x = np.fromfunction(lambda i: (i % N) / N, (N, ), dtype=datatype)
    return alpha, beta, A, B, x
run(bench.gesummv, gesummv, N=14000)


def go_fast(N):
    rng = default_rng(42)
    a = rng.random((N, N), dtype=np.float64)
    return a
run(bench.go_fast, go_fast, N=20000)


def gramschmidt(M, N, datatype=np.float64):
    rng = default_rng(42)

    A = rng.random((M, N), dtype=datatype)
    while np.linalg.matrix_rank(A) < N:
        A = rng.random((M, N), dtype=datatype)
    return A
run(bench.gramschmidt, gramschmidt, M=600, N=500)


def hdiff(I, J, K):
    rng = default_rng(42)

    # Define arrays
    in_field = rng.random((I + 4, J + 4, K))
    out_field = rng.random((I, J, K))
    coeff = rng.random((I, J, K))
    return in_field, out_field, coeff
run(bench.hdiff, hdiff, I=384, J=384, K=160)


def heat_3d(N, TSTEPS, datatype=np.float64):
    A = np.fromfunction(lambda i, j, k: (i + j + (N - k)) * 10 / N, (N, N, N),
                        dtype=datatype)
    B = A.copy()  # TODO: np.copy(A)
    return TSTEPS, A, B
run(bench.heat_3d, heat_3d, N=70, TSTEPS=100)


def jacobi_1d(N, TSTEPS, datatype=np.float64):
    A = np.fromfunction(lambda i: (i + 2) / N, (N, ), dtype=datatype)
    B = np.fromfunction(lambda i: (i + 3) / N, (N, ), dtype=datatype)
    return TSTEPS, A, B
run(bench.jacobi_1d, jacobi_1d, N=34000, TSTEPS=8500)


def jacobi_2d(N, TSTEPS, datatype=np.float64):
    A = np.fromfunction(lambda i, j: i * (j + 2) / N, (N, N), dtype=datatype)
    B = np.fromfunction(lambda i, j: i * (j + 3) / N, (N, N), dtype=datatype)
    return TSTEPS, A, B
run(bench.jacobi_2d, jacobi_2d, N=700, TSTEPS=200)


def k2mm(NI, NJ, NK, NL, datatype=np.float64):
    alpha = datatype(1.5)
    beta = datatype(1.2)
    A = np.fromfunction(lambda i, j: ((i * j + 1) % NI) / NI, (NI, NK),
                        dtype=datatype)
    B = np.fromfunction(lambda i, j: (i * (j + 1) % NJ) / NJ, (NK, NJ),
                        dtype=datatype)
    C = np.fromfunction(lambda i, j: ((i * (j + 3) + 1) % NL) / NL, (NJ, NL),
                        dtype=datatype)
    D = np.fromfunction(lambda i, j: (i * (j + 2) % NK) / NK, (NI, NL),
                        dtype=datatype)
    return alpha, beta, A, B, C, D
run(bench.k2mm, k2mm, NI=6000, NJ=6500, NK=7000, NL=7500)


def k3mm(NI, NJ, NK, NL, NM, datatype=np.float64):
    A = np.fromfunction(lambda i, j: ((i * j + 1) % NI) / (5 * NI), (NI, NK),
                        dtype=datatype)
    B = np.fromfunction(lambda i, j: ((i * (j + 1) + 2) % NJ) / (5 * NJ),
                        (NK, NJ),
                        dtype=datatype)
    C = np.fromfunction(lambda i, j: (i * (j + 3) % NL) / (5 * NL), (NJ, NM),
                        dtype=datatype)
    D = np.fromfunction(lambda i, j: ((i * (j + 2) + 2) % NK) / (5 * NK),
                        (NM, NL),
                        dtype=datatype)
    return A, B, C, D
run(bench.k3mm, k3mm, NI=5500, NJ=6000, NK=6500, NL=7000, NM=7500)


def lenet(N, H, W):
    rng = default_rng(42)

    H_conv1 = H - 4
    W_conv1 = W - 4
    H_pool1 = H_conv1 // 2
    W_pool1 = W_conv1 // 2
    H_conv2 = H_pool1 - 4
    W_conv2 = W_pool1 - 4
    H_pool2 = H_conv2 // 2
    W_pool2 = W_conv2 // 2
    C_before_fc1 = 16 * H_pool2 * W_pool2

    # NHWC data layout
    input = rng.random((N, H, W, 1), dtype=np.float32)
    # Weights
    conv1 = rng.random((5, 5, 1, 6), dtype=np.float32)
    conv1bias = rng.random((6, ), dtype=np.float32)
    conv2 = rng.random((5, 5, 6, 16), dtype=np.float32)
    conv2bias = rng.random((16, ), dtype=np.float32)
    fc1w = rng.random((C_before_fc1, 120), dtype=np.float32)
    fc1b = rng.random((120, ), dtype=np.float32)
    fc2w = rng.random((120, 84), dtype=np.float32)
    fc2b = rng.random((84, ), dtype=np.float32)
    fc3w = rng.random((84, 10), dtype=np.float32)
    fc3b = rng.random((10, ), dtype=np.float32)

    return (
        input, conv1, conv1bias, conv2, conv2bias, fc1w, fc1b, fc2w, fc2b,
        fc3w, fc3b, N, C_before_fc1
    )
run(bench.lenet, lenet, N=16, H=256, W=256)


def lu(N, datatype=np.float64):
    A = np.empty((N, N), dtype=datatype)
    for i in range(N):
        A[i, :i + 1] = np.fromfunction(lambda j: (-j % N) / N + 1, (i + 1, ),
                                       dtype=datatype)
        A[i, i + 1:] = 0.0
        A[i, i] = 1.0
    A[:] = A @ np.transpose(A)
    return A
run(bench.lu, lu, N=2000)


def ludcmp(N, datatype=np.float64):
    A = np.empty((N, N), dtype=datatype)
    for i in range(N):
        A[i, :i + 1] = np.fromfunction(lambda j: (-j % N) / N + 1, (i + 1, ),
                                       dtype=datatype)
        A[i, i + 1:] = 0.0
        A[i, i] = 1.0
    A[:] = A @ np.transpose(A)
    fn = datatype(N)
    b = np.fromfunction(lambda i: (i + 1) / fn / 2.0 + 4.0, (N, ),
                        dtype=datatype)
    return A, b
run(bench.ludcmp, ludcmp, N=2000)


def mandelbrot1(xmin, xmax, ymin, ymax, xn, yn, maxiter, horizon):
    return xmin, xmax, ymin, ymax, xn, yn, maxiter, horizon
run(bench.mandelbrot1, mandelbrot1, xmin=-2.25, xmax=0.75, xn=1000, ymin=-1.25, ymax=1.25, yn=1000, maxiter=200, horizon=2.0)


def mandelbrot2(xmin, xmax, ymin, ymax, xn, yn, maxiter, horizon):
    return xmin, xmax, ymin, ymax, xn, yn, maxiter, horizon
run(bench.mandelbrot2, mandelbrot2, xmin=-2.25, xmax=0.75, xn=1000, ymin=-1.25, ymax=1.25, yn=1000, maxiter=200, horizon=2.0)


def mlp(C_in, N, S0, S1, S2):
    rng = default_rng(42)

    mlp_sizes = [S0, S1, S2]  # [300, 100, 10]
    # Inputs
    input = np.random.rand(N, C_in).astype(np.float32)
    # Weights
    w1 = rng.random((C_in, mlp_sizes[0]), dtype=np.float32)
    b1 = rng.random((mlp_sizes[0], ), dtype=np.float32)
    w2 = rng.random((mlp_sizes[0], mlp_sizes[1]), dtype=np.float32)
    b2 = rng.random((mlp_sizes[1], ), dtype=np.float32)
    w3 = rng.random((mlp_sizes[1], mlp_sizes[2]), dtype=np.float32)
    b3 = rng.random((mlp_sizes[2], ), dtype=np.float32)
    return input, w1, b1, w2, b2, w3, b3
run(bench.mlp, mlp, C_in=3, N=8, S0=30000, S1=30000, S2=30000)


def mvt(N, datatype=np.float64):
    x1 = np.fromfunction(lambda i: (i % N) / N, (N, ), dtype=datatype)
    x2 = np.fromfunction(lambda i: ((i + 1) % N) / N, (N, ), dtype=datatype)
    y_1 = np.fromfunction(lambda i: ((i + 3) % N) / N, (N, ), dtype=datatype)
    y_2 = np.fromfunction(lambda i: ((i + 4) % N) / N, (N, ), dtype=datatype)
    A = np.fromfunction(lambda i, j: (i * j % N) / N, (N, N), dtype=datatype)
    return x1, x2, y_1, y_2, A
run(bench.mvt, mvt, N=22000)


def nbody(N, tEnd, dt, softening, G):
    rng = default_rng(42)
    mass = 20.0 * np.ones((N, 1)) / N  # total mass of particles is 20
    pos = rng.random((N, 3))  # randomly selected positions and velocities
    vel = rng.random((N, 3))
    Nt = int(np.ceil(tEnd / dt))
    return mass, pos, vel, N, Nt, dt, G, softening
run(bench.nbody, nbody, N=100, tEnd=10.0, dt=0.01, softening=0.1, G=1.0)


def nussinov(N, datatype=np.int32):
    seq = np.fromfunction(lambda i: (i + 1i32) % 4i32, (N, ), dtype=datatype)
    return N, seq
run(bench.nussinov, nussinov, N=500)


def resnet(N, W, H, C1, C2):
    rng = default_rng(42)

    # Input
    input = rng.random((N, H, W, C1), dtype=np.float32)
    # Weights
    conv1 = rng.random((1, 1, C1, C2), dtype=np.float32)
    conv2 = rng.random((3, 3, C2, C2), dtype=np.float32)
    conv3 = rng.random((1, 1, C2, C1), dtype=np.float32)
    return input, conv1, conv2, conv3
run(bench.resnet, resnet, N=8, W=56, H=56, C1=256, C2=64)


def scattering_self_energies(Nkz, NE, Nqz, Nw, N3D, NA, NB, Norb):
    rng = default_rng(42)

    neigh_idx = np.empty((NA, NB), dtype=np.int32)
    for i in range(NA):
        neigh_idx[i] = np.positive(np.arange(i - NB / 2, i + NB / 2) % NA)
    dH = rng_complex((NA, NB, N3D, Norb, Norb), rng)
    G = rng_complex((Nkz, NE, NA, Norb, Norb), rng)
    D = rng_complex((Nqz, Nw, NA, NB, N3D, N3D), rng)
    Sigma = np.zeros((Nkz, NE, NA, Norb, Norb), dtype=np.complex128)
    return neigh_idx, dH, G, D, Sigma
run(bench.scattering_self_energies, scattering_self_energies, Nkz=4, NE=10, Nqz=4, Nw=3, N3D=3, NA=20, NB=4, Norb=4)


def seidel_2d(N, TSTEPS, datatype=np.float64):
    A = np.fromfunction(lambda i, j: (i * (j + 2) + 2) / N, (N, N),
                        dtype=datatype)
    return TSTEPS, N, A
run(bench.seidel_2d, seidel_2d, N=400, TSTEPS=100)


def softmax(N, H, SM):
    rng = default_rng(42)
    x = rng.random((N, H, SM, SM), dtype=np.float32)
    return x
run(bench.softmax, softmax, N=64, H=16, SM=512)


def spmv(M, N, nnz):
    from python import numpy as NP
    from python import numpy.random as NR
    from python import scipy.sparse as SS

    rng = NR.default_rng(42)
    x: np.ndarray[float,1] = rng.random((N, ))
    matrix = SS.random(
        M, N, density=nnz / (M * N), format='csr', dtype=NP.float64, random_state=rng
    )
    rows: np.ndarray[u32,1] = NP.uint32(matrix.indptr)
    cols: np.ndarray[u32,1] = NP.uint32(matrix.indices)
    vals: np.ndarray[float,1] = matrix.data
    return rows, cols, vals, x
run(bench.spmv, spmv, M=131072, N=131072, nnz=262144)


def stockham_fft(R, K):
    rng = default_rng(42)

    N = R**K
    X = rng_complex((N, ), rng)
    Y = np.zeros_like(X, dtype=np.complex128)
    return N, R, K, X, Y
run(bench.stockham_fft, stockham_fft, R=2, K=21)


def symm(M, N, datatype=np.float64):
    alpha = datatype(1.5)
    beta = datatype(1.2)
    C = np.fromfunction(lambda i, j: ((i + j) % 100) / M, (M, N),
                        dtype=datatype)
    B = np.fromfunction(lambda i, j: ((N + i - j) % 100) / M, (M, N),
                        dtype=datatype)
    A = np.empty((M, M), dtype=datatype)
    for i in range(M):
        A[i, :i + 1] = np.fromfunction(lambda j: ((i + j) % 100) / M,
                                       (i + 1, ),
                                       dtype=datatype)
        A[i, i + 1:] = -999
    return alpha, beta, C, A, B
run(bench.symm, symm, M=1000, N=1200)


def syr2k(M, N, datatype=np.float64):
    alpha = datatype(1.5)
    beta = datatype(1.2)
    C = np.fromfunction(lambda i, j: ((i * j + 3) % N) / M, (N, N),
                        dtype=datatype)
    A = np.fromfunction(lambda i, j: ((i * j + 1) % N) / N, (N, M),
                        dtype=datatype)
    B = np.fromfunction(lambda i, j: ((i * j + 2) % M) / M, (N, M),
                        dtype=datatype)
    return alpha, beta, C, A, B
run(bench.syr2k, syr2k, M=350, N=400)


def syrk(M, N, datatype=np.float64):
    alpha = datatype(1.5)
    beta = datatype(1.2)
    C = np.fromfunction(lambda i, j: ((i * j + 2) % N) / M, (N, N),
                        dtype=datatype)
    A = np.fromfunction(lambda i, j: ((i * j + 1) % N) / N, (N, M),
                        dtype=datatype)
    return alpha, beta, C, A
run(bench.syr2k, syr2k, M=1000, N=1200)


def trisolv(N, datatype=np.float64):
    L = np.fromfunction(lambda i, j: (i + N - j + 1) * 2 / N, (N, N),
                        dtype=datatype)
    x = np.full((N, ), -999, dtype=datatype)
    b = np.fromfunction(lambda i: i, (N, ), dtype=datatype)
    return L, x, b
run(bench.trisolv, trisolv, N=16000)


def trmm(M, N, datatype=np.float64):
    alpha = datatype(1.5)
    A = np.fromfunction(lambda i, j: ((i * j) % M) / M, (M, M), dtype=datatype)
    for i in range(M):
        A[i, i] = 1.0
    B = np.fromfunction(lambda i, j: ((N + i - j) % N) / N, (M, N),
                        dtype=datatype)
    return alpha, A, B
run(bench.trmm, trmm, M=1000, N=1200)


def vadv(I, J, K):
    rng = default_rng(42)
    dtr_stage = 3. / 20.

    # Define arrays
    utens_stage = rng.random((I, J, K))
    u_stage = rng.random((I, J, K))
    wcon = rng.random((I + 1, J, K))
    u_pos = rng.random((I, J, K))
    utens = rng.random((I, J, K))
    return utens_stage, u_stage, wcon, u_pos, utens, dtr_stage
run(bench.vadv, vadv, I=256, J=256, K=160)


================================================
FILE: bench/codon/npbench_lib.codon
================================================
# Copyright 2021 ETH Zurich and the NPBench authors. All rights reserved.

__CODON_RET__: Literal[bool] = True

import numpy as np
import numpy.pybridge

def adi(TSTEPS: int, N: int, u: np.ndarray[float, 2]):
    v = np.empty(u.shape, dtype=u.dtype)
    p = np.empty(u.shape, dtype=u.dtype)
    q = np.empty(u.shape, dtype=u.dtype)

    DX = 1.0 / N
    DY = 1.0 / N
    DT = 1.0 / TSTEPS
    B1 = 2.0
    B2 = 1.0
    mul1 = B1 * DT / (DX * DX)
    mul2 = B2 * DT / (DY * DY)

    a = -mul1 / 2.0
    b = 1.0 + mul2
    c = a
    d = -mul2 / 2.0
    e = 1.0 + mul2
    f = d

    for t in range(1, TSTEPS + 1):
        v[0, 1:N - 1] = 1.0
        p[1:N - 1, 0] = 0.0
        q[1:N - 1, 0] = v[0, 1:N - 1]
        for j in range(1, N - 1):
            p[1:N - 1, j] = -c / (a * p[1:N - 1, j - 1] + b)
            q[1:N - 1,
              j] = (-d *u[j, 0:N - 2] +
                    (1.0 + 2.0 * d) *u[j, 1:N - 1] - f *u[j, 2:N] -
                    a * q[1:N - 1, j - 1]) / (a * p[1:N - 1, j - 1] + b)
        v[N - 1, 1:N - 1] = 1.0
        for j in range(N - 2, 0, -1):
            v[j, 1:N - 1] = p[1:N - 1, j] * v[j + 1, 1:N - 1] + q[1:N - 1, j]

        u[1:N - 1, 0] = 1.0
        p[1:N - 1, 0] = 0.0
        q[1:N - 1, 0] = u[1:N - 1, 0]
        for j in range(1, N - 1):
            p[1:N - 1, j] = -f / (d * p[1:N - 1, j - 1] + e)
            q[1:N - 1,
              j] = (-a * v[0:N - 2, j] +
                    (1.0 + 2.0 * a) * v[1:N - 1, j] - c * v[2:N, j] -
                    d * q[1:N - 1, j - 1]) / (d * p[1:N - 1, j - 1] + e)
        u[1:N - 1, N - 1] = 1.0
        for j in range(N - 2, 0, -1):
            u[1:N - 1, j] = p[1:N - 1, j] *u[1:N - 1, j + 1] + q[1:N - 1, j]

def arc_distance(theta_1: np.ndarray[float, 1], phi_1: np.ndarray[float, 1], theta_2: np.ndarray[float, 1], phi_2: np.ndarray[float, 1]):
    """
    Calculates the pairwise arc distance between all points in vector a and b.
    """
    temp = np.sin((theta_2 - theta_1) /
                  2)**2 + np.cos(theta_1) * np.cos(theta_2) * np.sin(
                      (phi_2 - phi_1) / 2)**2
    distance_matrix = 2 * (np.arctan2(np.sqrt(temp), np.sqrt(1 - temp)))
    if __CODON_RET__: return distance_matrix

def azimint_naive(data: np.ndarray[float, 1], radius: np.ndarray[float, 1], npt: int):
    rmax = radius.max()
    res = np.zeros(npt, dtype=np.float64)
    for i in range(npt):
        r1 = rmax * i / npt
        r2 = rmax * (i + 1) / npt
        mask_r12 = np.logical_and((r1 <= radius), (radius < r2))
        values_r12 = data[mask_r12]
        res[i] = values_r12.mean()
    if __CODON_RET__: return res

def azimint_hist(data: np.ndarray[float,1], radius: np.ndarray[float,1], npt: int):
    histu = np.histogram(radius, npt)[0]
    histw = np.histogram(radius, npt, weights=data)[0]
    res = histw / histu
    if __CODON_RET__: return res

def atax(A: np.ndarray[float,2], x: np.ndarray[float,1]):
    res = (A @ x) @ A
    if __CODON_RET__: return res

def bicg(A: np.ndarray[float,2], p: np.ndarray[float,1], r: np.ndarray[float,1]):
    res = r @ A, A @ p
    if __CODON_RET__: return res

def cavity_flow(nx: int, ny: int, nt: int, nit: int, u: np.ndarray[float,2], v: np.ndarray[float,2], dt: float, dx: float, dy: float, p: np.ndarray[float,2], rho: float, nu: float):
    def build_up_b(b, rho, dt, u, v, dx, dy):
        b[1:-1,
        1:-1] = (rho * (1 / dt * ((u[1:-1, 2:] - u[1:-1, 0:-2]) / (2 * dx) +
                                    (v[2:, 1:-1] - v[0:-2, 1:-1]) / (2 * dy)) -
                        ((u[1:-1, 2:] - u[1:-1, 0:-2]) / (2 * dx))**2 - 2 *
                        ((u[2:, 1:-1] - u[0:-2, 1:-1]) / (2 * dy) *
                        (v[1:-1, 2:] - v[1:-1, 0:-2]) / (2 * dx)) -
                        ((v[2:, 1:-1] - v[0:-2, 1:-1]) / (2 * dy))**2))

    def pressure_poisson(nit, p, dx, dy, b):
        pn = np.empty_like(p)
        pn = p.copy()

        for q in range(nit):
            pn = p.copy()
            p[1:-1, 1:-1] = (((pn[1:-1, 2:] + pn[1:-1, 0:-2]) * dy**2 +
                            (pn[2:, 1:-1] + pn[0:-2, 1:-1]) * dx**2) /
                            (2 * (dx**2 + dy**2)) - dx**2 * dy**2 /
                            (2 * (dx**2 + dy**2)) * b[1:-1, 1:-1])

            p[:, -1] = p[:, -2]  # dp/dx = 0 at x = 2
            p[0, :] = p[1, :]  # dp/dy = 0 at y = 0
            p[:, 0] = p[:, 1]  # dp/dx = 0 at x = 0
            p[-1, :] = 0  # p = 0 at y = 2

    un = np.empty_like(u)
    vn = np.empty_like(v)
    b = np.zeros((ny, nx))

    for n in range(nt):
        un = u.copy()
        vn = v.copy()

        build_up_b(b, rho, dt, u, v, dx, dy)
        pressure_poisson(nit, p, dx, dy, b)

        u[1:-1,
          1:-1] = (un[1:-1, 1:-1] - un[1:-1, 1:-1] * dt / dx *
                   (un[1:-1, 1:-1] - un[1:-1, 0:-2]) -
                   vn[1:-1, 1:-1] * dt / dy *
                   (un[1:-1, 1:-1] - un[0:-2, 1:-1]) - dt / (2 * rho * dx) *
                   (p[1:-1, 2:] - p[1:-1, 0:-2]) + nu *
                   (dt / dx**2 *
                    (un[1:-1, 2:] - 2 * un[1:-1, 1:-1] + un[1:-1, 0:-2]) +
                    dt / dy**2 *
                    (un[2:, 1:-1] - 2 * un[1:-1, 1:-1] + un[0:-2, 1:-1])))

        v[1:-1,
          1:-1] = (vn[1:-1, 1:-1] - un[1:-1, 1:-1] * dt / dx *
                   (vn[1:-1, 1:-1] - vn[1:-1, 0:-2]) -
                   vn[1:-1, 1:-1] * dt / dy *
                   (vn[1:-1, 1:-1] - vn[0:-2, 1:-1]) - dt / (2 * rho * dy) *
                   (p[2:, 1:-1] - p[0:-2, 1:-1]) + nu *
                   (dt / dx**2 *
                    (vn[1:-1, 2:] - 2 * vn[1:-1, 1:-1] + vn[1:-1, 0:-2]) +
                    dt / dy**2 *
                    (vn[2:, 1:-1] - 2 * vn[1:-1, 1:-1] + vn[0:-2, 1:-1])))

        u[0, :] = 0
        u[:, 0] = 0
        u[:, -1] = 0
        u[-1, :] = 1  # set velocity on cavity lid equal to 1
        v[0, :] = 0
        v[-1, :] = 0
        v[:, 0] = 0
        v[:, -1] = 0

def channel_flow(nit: int, u: np.ndarray[float, 2], v: np.ndarray[float, 2],
                 dt: float, dx:float, dy: float, p: np.ndarray[float, 2],
                 rho: float, nu: float, F: float):
    def build_up_b(rho, dt, dx, dy, u, v):
        b = np.zeros_like(u)
        b[1:-1,
        1:-1] = (rho * (1 / dt * ((u[1:-1, 2:] - u[1:-1, 0:-2]) / (2 * dx) +
                                    (v[2:, 1:-1] - v[0:-2, 1:-1]) / (2 * dy)) -
                        ((u[1:-1, 2:] - u[1:-1, 0:-2]) / (2 * dx))**2 - 2 *
                        ((u[2:, 1:-1] - u[0:-2, 1:-1]) / (2 * dy) *
                        (v[1:-1, 2:] - v[1:-1, 0:-2]) / (2 * dx)) -
                        ((v[2:, 1:-1] - v[0:-2, 1:-1]) / (2 * dy))**2))

        # Periodic BC Pressure @ x = 2
        b[1:-1, -1] = (rho * (1 / dt * ((u[1:-1, 0] - u[1:-1, -2]) / (2 * dx) +
                                        (v[2:, -1] - v[0:-2, -1]) / (2 * dy)) -
                            ((u[1:-1, 0] - u[1:-1, -2]) / (2 * dx))**2 - 2 *
                            ((u[2:, -1] - u[0:-2, -1]) / (2 * dy) *
                            (v[1:-1, 0] - v[1:-1, -2]) / (2 * dx)) -
                            ((v[2:, -1] - v[0:-2, -1]) / (2 * dy))**2))

        # Periodic BC Pressure @ x = 0
        b[1:-1, 0] = (rho * (1 / dt * ((u[1:-1, 1] - u[1:-1, -1]) / (2 * dx) +
                                    (v[2:, 0] - v[0:-2, 0]) / (2 * dy)) -
                            ((u[1:-1, 1] - u[1:-1, -1]) / (2 * dx))**2 - 2 *
                            ((u[2:, 0] - u[0:-2, 0]) / (2 * dy) *
                            (v[1:-1, 1] - v[1:-1, -1]) /
                            (2 * dx)) - ((v[2:, 0] - v[0:-2, 0]) / (2 * dy))**2))

        return b

    def pressure_poisson_periodic(nit, p, dx, dy, b):
        pn = np.empty_like(p)

        for q in range(nit):
            pn = p.copy()
            p[1:-1, 1:-1] = (((pn[1:-1, 2:] + pn[1:-1, 0:-2]) * dy**2 +
                            (pn[2:, 1:-1] + pn[0:-2, 1:-1]) * dx**2) /
                            (2 * (dx**2 + dy**2)) - dx**2 * dy**2 /
                            (2 * (dx**2 + dy**2)) * b[1:-1, 1:-1])

            # Periodic BC Pressure @ x = 2
            p[1:-1, -1] = (((pn[1:-1, 0] + pn[1:-1, -2]) * dy**2 +
                            (pn[2:, -1] + pn[0:-2, -1]) * dx**2) /
                        (2 * (dx**2 + dy**2)) - dx**2 * dy**2 /
                        (2 * (dx**2 + dy**2)) * b[1:-1, -1])

            # Periodic BC Pressure @ x = 0
            p[1:-1,
            0] = (((pn[1:-1, 1] + pn[1:-1, -1]) * dy**2 +
                    (pn[2:, 0] + pn[0:-2, 0]) * dx**2) / (2 * (dx**2 + dy**2)) -
                    dx**2 * dy**2 / (2 * (dx**2 + dy**2)) * b[1:-1, 0])

            # Wall boundary conditions, pressure
            p[-1, :] = p[-2, :]  # dp/dy = 0 at y = 2
            p[0, :] = p[1, :]  # dp/dy = 0 at y = 0


    udiff = 1.0
    stepcount = 0

    while udiff > .001:
        un = u.copy()
        vn = v.copy()

        b = build_up_b(rho, dt, dx, dy, u, v)
        pressure_poisson_periodic(nit, p, dx, dy, b)

        u[1:-1,
          1:-1] = (un[1:-1, 1:-1] - un[1:-1, 1:-1] * dt / dx *
                   (un[1:-1, 1:-1] - un[1:-1, 0:-2]) -
                   vn[1:-1, 1:-1] * dt / dy *
                   (un[1:-1, 1:-1] - un[0:-2, 1:-1]) - dt / (2 * rho * dx) *
                   (p[1:-1, 2:] - p[1:-1, 0:-2]) + nu *
                   (dt / dx**2 *
                    (un[1:-1, 2:] - 2 * un[1:-1, 1:-1] + un[1:-1, 0:-2]) +
                    dt / dy**2 *
                    (un[2:, 1:-1] - 2 * un[1:-1, 1:-1] + un[0:-2, 1:-1])) +
                   F * dt)

        v[1:-1,
          1:-1] = (vn[1:-1, 1:-1] - un[1:-1, 1:-1] * dt / dx *
                   (vn[1:-1, 1:-1] - vn[1:-1, 0:-2]) -
                   vn[1:-1, 1:-1] * dt / dy *
                   (vn[1:-1, 1:-1] - vn[0:-2, 1:-1]) - dt / (2 * rho * dy) *
                   (p[2:, 1:-1] - p[0:-2, 1:-1]) + nu *
                   (dt / dx**2 *
                    (vn[1:-1, 2:] - 2 * vn[1:-1, 1:-1] + vn[1:-1, 0:-2]) +
                    dt / dy**2 *
                    (vn[2:, 1:-1] - 2 * vn[1:-1, 1:-1] + vn[0:-2, 1:-1])))

        # Periodic BC u @ x = 2
        u[1:-1, -1] = (
            un[1:-1, -1] - un[1:-1, -1] * dt / dx *
            (un[1:-1, -1] - un[1:-1, -2]) - vn[1:-1, -1] * dt / dy *
            (un[1:-1, -1] - un[0:-2, -1]) - dt / (2 * rho * dx) *
            (p[1:-1, 0] - p[1:-1, -2]) + nu *
            (dt / dx**2 *
             (un[1:-1, 0] - 2 * un[1:-1, -1] + un[1:-1, -2]) + dt / dy**2 *
             (un[2:, -1] - 2 * un[1:-1, -1] + un[0:-2, -1])) + F * dt)

        # Periodic BC u @ x = 0
        u[1:-1,
          0] = (un[1:-1, 0] - un[1:-1, 0] * dt / dx *
                (un[1:-1, 0] - un[1:-1, -1]) - vn[1:-1, 0] * dt / dy *
                (un[1:-1, 0] - un[0:-2, 0]) - dt / (2 * rho * dx) *
                (p[1:-1, 1] - p[1:-1, -1]) + nu *
                (dt / dx**2 *
                 (un[1:-1, 1] - 2 * un[1:-1, 0] + un[1:-1, -1]) + dt / dy**2 *
                 (un[2:, 0] - 2 * un[1:-1, 0] + un[0:-2, 0])) + F * dt)

        # Periodic BC v @ x = 2
        v[1:-1, -1] = (
            vn[1:-1, -1] - un[1:-1, -1] * dt / dx *
            (vn[1:-1, -1] - vn[1:-1, -2]) - vn[1:-1, -1] * dt / dy *
            (vn[1:-1, -1] - vn[0:-2, -1]) - dt / (2 * rho * dy) *
            (p[2:, -1] - p[0:-2, -1]) + nu *
            (dt / dx**2 *
             (vn[1:-1, 0] - 2 * vn[1:-1, -1] + vn[1:-1, -2]) + dt / dy**2 *
             (vn[2:, -1] - 2 * vn[1:-1, -1] + vn[0:-2, -1])))

        # Periodic BC v @ x = 0
        v[1:-1,
          0] = (vn[1:-1, 0] - un[1:-1, 0] * dt / dx *
                (vn[1:-1, 0] - vn[1:-1, -1]) - vn[1:-1, 0] * dt / dy *
                (vn[1:-1, 0] - vn[0:-2, 0]) - dt / (2 * rho * dy) *
                (p[2:, 0] - p[0:-2, 0]) + nu *
                (dt / dx**2 *
                 (vn[1:-1, 1] - 2 * vn[1:-1, 0] + vn[1:-1, -1]) + dt / dy**2 *
                 (vn[2:, 0] - 2 * vn[1:-1, 0] + vn[0:-2, 0])))

        # Wall BC: u,v = 0 @ y = 0,2
        u[0, :] = 0
        u[-1, :] = 0
        v[0, :] = 0
        v[-1, :] = 0

        udiff = (np.sum(u) - np.sum(un)) / np.sum(u)
        stepcount += 1

    if __CODON_RET__: return stepcount

def cholesky2(A: np.ndarray[float,2]):
    A[:] = np.linalg.cholesky(A) + np.triu(A, k=1)

def cholesky(A: np.ndarray[float,2]):
    A[0, 0] = np.sqrt(A[0, 0])
    for i in range(1, A.shape[0]):
        for j in range(i):
            A[i, j] -= np.dot(A[i, :j], A[j, :j])
            A[i, j] /= A[j, j]
        A[i, i] -= np.dot(A[i, :i], A[i, :i])
        A[i, i] = np.sqrt(A[i, i])

def compute(array_1: np.ndarray[int,2], array_2: np.ndarray[int,2], a: int, b: int, c: int):
    res = np.clip(array_1, 2, 10) * a + array_2 * b + c
    if __CODON_RET__: return res

def contour_integral(NR: int, NM: int, slab_per_bc: int, Ham: np.ndarray[complex, 3], int_pts: np.ndarray[complex, 1], Y: np.ndarray[complex, 2]):
    P0 = np.zeros((NR, NM), dtype=np.complex128)
    P1 = np.zeros((NR, NM), dtype=np.complex128)
    for z in int_pts:
        Tz = np.zeros((NR, NR), dtype=np.complex128)
        for n in range(slab_per_bc + 1):
            zz = np.power(z, slab_per_bc / 2 - n)
            Tz += zz * Ham[n]
        if NR == NM:
            X = np.linalg.inv(Tz)
        else:
            X = np.linalg.solve(Tz, Y)
        if abs(z) < 1.0:
            X = -X
        P0 += X
        P1 += z * X

    res = P0, P1
    if __CODON_RET__: return res

def conv2d_bias(input: np.ndarray[float32,4], weights: np.ndarray[float32,4], bias: np.ndarray[float32,1]):
    def conv2d(input, weights):
        K = weights.shape[0]  # Assuming square kernel
        N = input.shape[0]
        H_out = input.shape[1] - K + 1
        W_out = input.shape[2] - K + 1
        C_out = weights.shape[3]
        output = np.empty((N, H_out, W_out, C_out), dtype=np.float32)

        # Loop structure adapted from https://github.com/SkalskiP/ILearnDeepLearning.py/blob/ba0b5ba589d4e656141995e8d1a06d44db6ce58d/01_mysteries_of_neural_networks/06_numpy_convolutional_neural_net/src/layers/convolutional.py#L88
        for i in range(H_out):
            for j in range(W_out):
                output[:, i, j, :] = np.sum(
                    input[:, i:i + K, j:j + K, :, np.newaxis] *
                    weights[np.newaxis, :, :, :],
                    axis=(1, 2, 3),
                )

        return output
    res = conv2d(input, weights) + bias
    if __CODON_RET__: return res

def correlation(M: int, float_n: float, data: np.ndarray[float,2]):

    mean = np.mean(data, axis=0)
    stddev = np.std(data, axis=0)
    stddev[stddev <= 0.1] = 1.0
    data -= mean
    data /= np.sqrt(float_n) * stddev
    corr = np.eye(M, dtype=data.dtype)
    for i in range(M - 1):
        corr[i + 1:M, i] = corr[i, i + 1:M] = data[:, i] @ data[:, i + 1:M]

    if __CODON_RET__: return corr

def covariance(M: int, float_n: float, data: np.ndarray[float, 2]):

    mean = np.mean(data, axis=0)
    data -= mean
    cov = np.zeros((M, M), dtype=data.dtype)
    for i in range(M):
        cov[i:M, i] = cov[i, i:M] = data[:, i] @ data[:, i:M] / (float_n - 1.0)

    if __CODON_RET__: return cov

def crc16(data: np.ndarray[np.uint8, 1]):
    '''
    CRC-16-CCITT Algorithm
    '''
    poly=0x8408
    crc = 0xFFFF
    for b in data:
        cur_byte = 0xFF & int(b)
        for _ in range(0, 8):
            if (crc & 0x0001) ^ (cur_byte & 0x0001):
                crc = (crc >> 1) ^ poly
            else:
                crc >>= 1
            cur_byte >>= 1
    crc = (~crc & 0xFFFF)
    crc = (crc << 8) | ((crc >> 8) & 0xFF)

    res = crc & 0xFFFF
    if __CODON_RET__: return res

def deriche(alpha: float, imgIn: np.ndarray[float,2]):

    k = (1.0 - np.exp(-alpha)) * (1.0 - np.exp(-alpha)) / (
        1.0 + alpha * np.exp(-alpha) - np.exp(2.0 * alpha))
    a1 = a5 = k
    a2 = a6 = k * np.exp(-alpha) * (alpha - 1.0)
    a3 = a7 = k * np.exp(-alpha) * (alpha + 1.0)
    a4 = a8 = -k * np.exp(-2.0 * alpha)
    b1 = 2.0**(-alpha)
    b2 = -np.exp(-2.0 * alpha)
    c1 = c2 = 1

    y1 = np.empty_like(imgIn)
    y1[:, 0] = a1 * imgIn[:, 0]
    y1[:, 1] = a1 * imgIn[:, 1] + a2 * imgIn[:, 0] + b1 * y1[:, 0]
    for j in range(2, imgIn.shape[1]):
        y1[:, j] = (a1 * imgIn[:, j] + a2 * imgIn[:, j - 1] +
                    b1 * y1[:, j - 1] + b2 * y1[:, j - 2])

    y2 = np.empty_like(imgIn)
    y2[:, -1] = 0.0
    y2[:, -2] = a3 * imgIn[:, -1]
    for j in range(imgIn.shape[1] - 3, -1, -1):
        y2[:, j] = (a3 * imgIn[:, j + 1] + a4 * imgIn[:, j + 2] +
                    b1 * y2[:, j + 1] + b2 * y2[:, j + 2])

    imgOut = c1 * (y1 + y2)

    y1[0, :] = a5 * imgOut[0, :]
    y1[1, :] = a5 * imgOut[1, :] + a6 * imgOut[0, :] + b1 * y1[0, :]
    for i in range(2, imgIn.shape[0]):
        y1[i, :] = (a5 * imgOut[i, :] + a6 * imgOut[i - 1, :] +
                    b1 * y1[i - 1, :] + b2 * y1[i - 2, :])

    y2[-1, :] = 0.0
    y2[-2, :] = a7 * imgOut[-1, :]
    for i in range(imgIn.shape[0] - 3, -1, -1):
        y2[i, :] = (a7 * imgOut[i + 1, :] + a8 * imgOut[i + 2, :] +
                    b1 * y2[i + 1, :] + b2 * y2[i + 2, :])

    imgOut[:] = c2 * (y1 + y2)

    if __CODON_RET__: return imgOut

def doitgen(NR: int, NQ: int, NP: int, A: np.ndarray[float,3], C4: np.ndarray[float,2]):

    A[:] = np.reshape(np.reshape(A, (NR, NQ, 1, NP)) @ C4, (NR, NQ, NP))

def durbin(r: np.ndarray[float,1]):

    y = np.empty_like(r)
    alpha = -r[0]
    beta = 1.0
    y[0] = -r[0]

    for k in range(1, r.shape[0]):
        beta *= 1.0 - alpha * alpha
        alpha = -(r[k] + np.dot(np.flip(r[:k]), y[:k])) / beta
        y[:k] += alpha * np.flip(y[:k])
        y[k] = alpha

    if __CODON_RET__: return y

def fdtd_2d(TMAX: int, ex: np.ndarray[float,2], ey: np.ndarray[float,2], hz: np.ndarray[float,2], _fict_: np.ndarray[float,1]):

    for t in range(TMAX):
        ey[0, :] = _fict_[t]
        ey[1:, :] -= 0.5 * (hz[1:, :] - hz[:-1, :])
        ex[:, 1:] -= 0.5 * (hz[:, 1:] - hz[:, :-1])
        hz[:-1, :-1] -= 0.7 * (ex[:-1, 1:] - ex[:-1, :-1] + ey[1:, :-1] - ey[:-1, :-1])

def floyd_warshall(path: np.ndarray[Int[32],2]):

    for k in range(path.shape[0]):
        path[:] = np.minimum(path[:], np.add.outer(path[:, k], path[k, :]))

def gemm(alpha: float, beta: float, C: np.ndarray[float,2], A: np.ndarray[float,2], B: np.ndarray[float,2]):

    C[:] = alpha * A @ B + beta * C

def gemver(alpha: float, beta: float, A: np.ndarray[float,2], u1: np.ndarray[float,1], v1: np.ndarray[float,1], u2: np.ndarray[float,1], v2: np.ndarray[float,1], w: np.ndarray[float,1], x: np.ndarray[float,1], y: np.ndarray[float,1], z: np.ndarray[float,1]):

    A += np.outer(u1, v1) + np.outer(u2, v2)
    x += beta * y @ A + z
    w += alpha * A @ x

def gesummv(alpha: float, beta: float, A: np.ndarray[float,2], B: np.ndarray[float,2], x: np.ndarray[float,1]):

    res = alpha * A @ x + beta * B @ x
    if __CODON_RET__: return res

def go_fast(a: np.ndarray[float,2]):
    trace = 0.0
    for i in range(a.shape[0]):
        trace += np.tanh(a[i, i])
    res = a + trace
    if __CODON_RET__: return res

def gramschmidt(A: np.ndarray[float,2]):

    Q = np.zeros_like(A)
    R = np.zeros((A.shape[1], A.shape[1]), dtype=A.dtype)

    for k in range(A.shape[1]):
        nrm = np.dot(A[:, k], A[:, k])
        R[k, k] = np.sqrt(nrm)
        Q[:, k] = A[:, k] / R[k, k]
        for j in range(k + 1, A.shape[1]):
            R[k, j] = np.dot(Q[:, k], A[:, j])
            A[:, j] -= Q[:, k] * R[k, j]

    res = Q, R
    if __CODON_RET__: return res

def hdiff(in_field: np.ndarray[float,3], out_field: np.ndarray[float,3], coeff: np.ndarray[float,3]):
    I, J, K = out_field.shape[0], out_field.shape[1], out_field.shape[2]
    lap_field = 4.0 * in_field[1:I + 3, 1:J + 3, :] - (
        in_field[2:I + 4, 1:J + 3, :] + in_field[0:I + 2, 1:J + 3, :] +
        in_field[1:I + 3, 2:J + 4, :] + in_field[1:I + 3, 0:J + 2, :])

    res = lap_field[1:, 1:J + 1, :] - lap_field[:-1, 1:J + 1, :]
    flx_field = np.where(
        (res *
         (in_field[2:I + 3, 2:J + 2, :] - in_field[1:I + 2, 2:J + 2, :])) > 0,
        0,
        res,
    )

    res = lap_field[1:I + 1, 1:, :] - lap_field[1:I + 1, :-1, :]
    fly_field = np.where(
        (res *
         (in_field[2:I + 2, 2:J + 3, :] - in_field[2:I + 2, 1:J + 2, :])) > 0,
        0,
        res,
    )

    out_field[:, :, :] = in_field[2:I + 2, 2:J + 2, :] - coeff[:, :, :] * (
        flx_field[1:, :, :] - flx_field[:-1, :, :] + fly_field[:, 1:, :] -
        fly_field[:, :-1, :])

def heat_3d(TSTEPS: int, A: np.ndarray[float, 3], B: np.ndarray[float, 3]):
    for t in range(1, TSTEPS):
        B[1:-1, 1:-1,
          1:-1] = (0.125 * (A[2:, 1:-1, 1:-1] - 2.0 * A[1:-1, 1:-1, 1:-1] +
                            A[:-2, 1:-1, 1:-1]) + 0.125 *
                   (A[1:-1, 2:, 1:-1] - 2.0 * A[1:-1, 1:-1, 1:-1] +
                    A[1:-1, :-2, 1:-1]) + 0.125 *
                   (A[1:-1, 1:-1, 2:] - 2.0 * A[1:-1, 1:-1, 1:-1] +
                    A[1:-1, 1:-1, 0:-2]) + A[1:-1, 1:-1, 1:-1])
        A[1:-1, 1:-1,
          1:-1] = (0.125 * (B[2:, 1:-1, 1:-1] - 2.0 * B[1:-1, 1:-1, 1:-1] +
                            B[:-2, 1:-1, 1:-1]) + 0.125 *
                   (B[1:-1, 2:, 1:-1] - 2.0 * B[1:-1, 1:-1, 1:-1] +
                    B[1:-1, :-2, 1:-1]) + 0.125 *
                   (B[1:-1, 1:-1, 2:] - 2.0 * B[1:-1, 1:-1, 1:-1] +
                    B[1:-1, 1:-1, 0:-2]) + B[1:-1, 1:-1, 1:-1])

def jacobi_1d(TSTEPS: int, A: np.ndarray[float, 1], B: np.ndarray[float, 1]):

    for t in range(1, TSTEPS):
        B[1:-1] = 0.33333 * (A[:-2] + A[1:-1] + A[2:])
        A[1:-1] = 0.33333 * (B[:-2] + B[1:-1] + B[2:])

def jacobi_2d(TSTEPS: int, A: np.ndarray[float, 2], B: np.ndarray[float, 2]):

    for t in range(1, TSTEPS):
        B[1:-1, 1:-1] = 0.2 * (A[1:-1, 1:-1] + A[1:-1, :-2] + A[1:-1, 2:] +
                               A[2:, 1:-1] + A[:-2, 1:-1])
        A[1:-1, 1:-1] = 0.2 * (B[1:-1, 1:-1] + B[1:-1, :-2] + B[1:-1, 2:] +
                               B[2:, 1:-1] + B[:-2, 1:-1])

def k2mm(alpha: float, beta: float, A: np.ndarray[float,2], B: np.ndarray[float,2], C: np.ndarray[float,2], D: np.ndarray[float,2]):

    D[:] = alpha * A @ B @ C + beta * D

def k3mm(A: np.ndarray[float,2], B: np.ndarray[float,2], C: np.ndarray[float,2], D: np.ndarray[float,2]):

    res = A @ B @ C @ D
    if __CODON_RET__: return res

def lenet(input: np.ndarray[float32,4], conv1: np.ndarray[float32,4], conv1bias: np.ndarray[float32,1],
          conv2: np.ndarray[float32,4], conv2bias: np.ndarray[float32,1], fc1w: np.ndarray[float32,2], fc1b: np.ndarray[float32,1], fc2w: np.ndarray[float32,2], fc2b: np.ndarray[float32,1],
          fc3w: np.ndarray[float32,2], fc3b: np.ndarray[float32,1], N:int, C_before_fc1:int):
    def relu(x):
        return np.maximum(x, 0)

    def conv2d(input, weights):
        K = weights.shape[0]  # Assuming square kernel
        N = input.shape[0]
        H_out = input.shape[1] - K + 1
        W_out = input.shape[2] - K + 1
        C_out = weights.shape[3]
        output = np.empty((N, H_out, W_out, C_out), dtype=np.float32)

        # Loop structure adapted from https://github.com/SkalskiP/ILearnDeepLearning.py/blob/ba0b5ba589d4e656141995e8d1a06d44db6ce58d/01_mysteries_of_neural_networks/06_numpy_convolutional_neural_net/src/layers/convolutional.py#L88
        for i in range(H_out):
            for j in range(W_out):
                output[:, i, j, :] = np.sum(
                    input[:, i:i + K, j:j + K, :, np.newaxis] *
                    weights[np.newaxis, :, :, :],
                    axis=(1, 2, 3),
                )

        return output

    def maxpool2d(x):
        output = np.empty(
            (x.shape[0], x.shape[1] // 2, x.shape[2] // 2, x.shape[3]),
            dtype=x.dtype)
        for i in range(x.shape[1] // 2):
            for j in range(x.shape[2] // 2):
                output[:, i, j, :] = np.max(x[:, 2 * i:2 * i + 2,
                                            2 * j:2 * j + 2, :],
                                            axis=(1, 2))
        return output

    x = relu(conv2d(input, conv1) + conv1bias)
    x = maxpool2d(x)
    x = relu(conv2d(x, conv2) + conv2bias)
    x = maxpool2d(x)
    x = np.reshape(x, (N, C_before_fc1))
    x = relu(x @ fc1w + fc1b)
    x = relu(x @ fc2w + fc2b)
    res = x @ fc3w + fc3b
    if __CODON_RET__: return res

def lu(A: np.ndarray[float, 2]):

    for i in range(A.shape[0]):
        for j in range(i):
            A[i, j] -= A[i, :j] @ A[:j, j]
            A[i, j] /= A[j, j]
        for j in range(i, A.shape[0]):
            A[i, j] -= A[i, :i] @ A[:i, j]

def ludcmp(A: np.ndarray[float, 2], b: np.ndarray[float,1]):

    x = np.zeros_like(b)
    y = np.zeros_like(b)

    for i in range(A.shape[0]):
        for j in range(i):
            A[i, j] -= A[i, :j] @ A[:j, j]
            A[i, j] /= A[j, j]
        for j in range(i, A.shape[0]):
            A[i, j] -= A[i, :i] @ A[:i, j]
    for i in range(A.shape[0]):
        y[i] = b[i] - A[i, :i] @ y[:i]
    for i in range(A.shape[0] - 1, -1, -1):
        x[i] = (y[i] - A[i, i + 1:] @ x[i + 1:]) / A[i, i]

    res = x, y
    if __CODON_RET__: return res

def mandelbrot1(xmin: float, xmax: float, ymin: float, ymax: float, xn: int, yn: int, maxiter: int, horizon: float):
    horizon = 2.0
    X = np.linspace(xmin, xmax, xn, dtype=np.float64)
    Y = np.linspace(ymin, ymax, yn, dtype=np.float64)
    C = X + Y[:, None] * 1j
    N = np.zeros(C.shape, dtype=np.int64)
    Z = np.zeros(C.shape, dtype=np.complex128)
    for n in range(maxiter):
        I = np.less(abs(Z), horizon)
        N[I] = n
        Z[I] = Z[I]**2 + C[I]
    N[N == maxiter - 1] = 0
    res = Z, N
    if __CODON_RET__: return res

def mandelbrot2(xmin: float, xmax: float, ymin: float, ymax: float, xn: int, yn: int, itermax: int, horizon: float):
    def mgrid(xn, yn):
        Xi = np.empty((xn, yn), dtype=np.int64)
        Yi = np.empty((xn, yn), dtype=np.int64)
        for i in range(xn):
            Xi[i, :] = i
        for j in range(yn):
            Yi[:, j] = j
        return Xi, Yi

    Xi, Yi = mgrid(xn, yn)
    X = np.linspace(xmin, xmax, xn, dtype=np.float64)[Xi]
    Y = np.linspace(ymin, ymax, yn, dtype=np.float64)[Yi]
    C = X + Y * 1j
    N_ = np.zeros(C.shape, dtype=np.int64)
    Z_ = np.zeros(C.shape, dtype=np.complex128)
    # Xi.shape = Yi.shape = C.shape = xn * yn
    Xi = Xi.reshape(xn * yn)
    Yi = Yi.reshape(xn * yn)
    C = C.reshape(xn * yn)

    Z = np.zeros(C.shape, np.complex128)
    for i in range(itermax):
        if not len(Z):
            break

        # Compute for relevant points only
        np.multiply(Z, Z, Z)
        np.add(Z, C, Z)

        # Failed convergence
        I = abs(Z) > horizon
        N_[Xi[I], Yi[I]] = i + 1
        Z_[Xi[I], Yi[I]] = Z[I]

        # Keep going with those who have not diverged yet
        np.logical_not(I, I)  # np.negative(I, I) not working any longer
        Z = Z[I]
        Xi, Yi = Xi[I], Yi[I]
        C = C[I]
    res = Z_.T, N_.T
    if __CODON_RET__: return res

def mlp(input: np.ndarray[float32, 2], w1: np.ndarray[float32,2], b1: np.ndarray[float32,1], w2: np.ndarray[float32,2], b2: np.ndarray[float32,1], w3: np.ndarray[float32, 2], b3: np.ndarray[float32, 1]):
    def relu(x):
        return np.maximum(x, 0)

    def softmax(x):
        tmp_max = np.max(x, axis=-1, keepdims=True)
        tmp_out = np.exp(x - tmp_max)
        tmp_sum = np.sum(tmp_out, axis=-1, keepdims=True)
        return tmp_out / tmp_sum

    x = relu(input @ w1 + b1)
    # x = np.array(x, dtype=np.float32)
    x = relu(x @ w2 + b2)
    # x = np.array(x, dtype=np.float32)
    x = softmax(x @ w3 + b3)  # Softmax call can be omitted if necessary
    if __CODON_RET__: return x

def mvt(x1: np.ndarray[float, 1], x2: np.ndarray[float, 1], y_1: np.ndarray[float,1], y_2: np.ndarray[float,1], A: np.ndarray[float, 2]):
    x1 += A @ y_1
    x2 += y_2 @ A

def nbody(mass: np.ndarray[float, 2], pos: np.ndarray[float, 2], vel: np.ndarray[float, 2],
          N: int, Nt: int, dt: float, G: float, softening: float):
    def getAcc(pos, mass, G, softening):
        """
        Calculate the acceleration on each particle due to Newton's Law
        pos  is an N x 3 matrix of positions
        mass is an N x 1 vector of masses
        G is Newton's Gravitational constant
        softening is the softening length
        a is N x 3 matrix of accelerations
        """
        # positions r = [x,y,z] for all particles
        x = pos[:, 0:1]
        y = pos[:, 1:2]
        z = pos[:, 2:3]

        # matrix that stores all pairwise particle separations: r_j - r_i
        dx = x.T - x
        dy = y.T - y
        dz = z.T - z

        # matrix that stores 1/r^3 for all particle pairwise particle separations
        inv_r3 = (dx**2 + dy**2 + dz**2 + softening**2)
        inv_r3[inv_r3 > 0] = inv_r3[inv_r3 > 0]**(-1.5)

        ax = G * (dx * inv_r3) @ mass
        ay = G * (dy * inv_r3) @ mass
        az = G * (dz * inv_r3) @ mass

        # pack together the acceleration components
        a = np.hstack((ax, ay, az))

        return a

    def getEnergy(pos, vel, mass, G):
        """
        Get kinetic energy (KE) and potential energy (PE) of simulation
        pos is N x 3 matrix of positions
        vel is N x 3 matrix of velocities
        mass is an N x 1 vector of masses
        G is Newton's Gravitational constant
        KE is the kinetic energy of the system
        PE is the potential energy of the system
        """
        # Kinetic Energy:
        # KE = 0.5 * np.sum(np.sum( mass * vel**2 ))
        KE = 0.5 * np.sum(mass * vel**2)

        # Potential Energy:

        # positions r = [x,y,z] for all particles
        x = pos[:, 0:1]
        y = pos[:, 1:2]
        z = pos[:, 2:3]

        # matrix that stores all pairwise particle separations: r_j - r_i
        dx = x.T - x
        dy = y.T - y
        dz = z.T - z

        # matrix that stores 1/r for all particle pairwise particle separations
        inv_r = np.sqrt(dx**2 + dy**2 + dz**2)
        inv_r[inv_r > 0] = 1.0 / inv_r[inv_r > 0]

        # sum over upper triangle, to count each interaction only once
        # PE = G * np.sum(np.sum(np.triu(-(mass*mass.T)*inv_r,1)))
        PE = G * np.sum(np.triu(-(mass * mass.T) * inv_r, 1))

        return KE, PE

    # Convert to Center-of-Mass frame
    vel -= np.mean(mass * vel, axis=0) / np.mean(mass)

    # calculate initial gravitational accelerations
    acc = getAcc(pos, mass, G, softening)

    # calculate initial energy of system
    KE = np.empty(Nt + 1, dtype=np.float64)
    PE = np.empty(Nt + 1, dtype=np.float64)
    KE[0], PE[0] = getEnergy(pos, vel, mass, G)

    t = 0.0

    # Simulation Main Loop
    for i in range(Nt):
        # (1/2) kick
        vel += acc * dt / 2.0

        # drift
        pos += vel * dt

        # update accelerations
        acc = getAcc(pos, mass, G, softening)

        # (1/2) kick
        vel += acc * dt / 2.0

        # update time
        t += dt

        # get energy of system
        KE[i + 1], PE[i + 1] = getEnergy(pos, vel, mass, G)

    res = KE, PE
    if __CODON_RET__: return res

def nussinov(N: int, seq: np.ndarray[Int[32], 1]):
    def match(b1, b2):
        if b1 + b2 == 3:
            return 1
        else:
            return 0

    table = np.zeros((N, N), np.int32)

    for i in range(N - 1, -1, -1):
        for j in range(i + 1, N):
            if j - 1 >= 0:
                table[i, j] = max(table[i, j], table[i, j - 1])
            if i + 1 < N:
                table[i, j] = max(table[i, j], table[i + 1, j])
            if j - 1 >= 0 and i + 1 < N:
                if i < j - 1:
                    table[i, j] = max(table[i, j], table[i + 1, j - 1] + Int[32](match(int(seq[i]), int(seq[j]))))
                else:
                    table[i, j] = max(table[i, j], table[i + 1, j - 1])
            for k in range(i + 1, j):
                table[i, j] = max(table[i, j], table[i, k] + table[k + 1, j])

    if __CODON_RET__: return table

def resnet(input: np.ndarray[float32, 4], conv1: np.ndarray[float32, 4], conv2: np.ndarray[float32, 4], conv3: np.ndarray[float32, 4]):
    def relu(x):
        return np.maximum(x, 0)

    def conv2d(input, weights):
        K = weights.shape[0]  # Assuming square kernel
        N = input.shape[0]
        H_out = input.shape[1] - K + 1
        W_out = input.shape[2] - K + 1
        C_out = weights.shape[3]
        output = np.empty((N, H_out, W_out, C_out), dtype=np.float32)

        # Loop structure adapted from https://github.com/SkalskiP/ILearnDeepLearning.py/blob/ba0b5ba589d4e656141995e8d1a06d44db6ce58d/01_mysteries_of_neural_networks/06_numpy_convolutional_neural_net/src/layers/convolutional.py#L88
        for i in range(H_out):
            for j in range(W_out):
                output[:, i, j, :] = np.sum(np.sum(
                    np.sum(input[:, i:i + K, j:j + K, :, np.newaxis] *
                        weights[np.newaxis, :, :, :],
                        axis=1),
                    axis=1),
                                            axis=1)
        return output

    def batchnorm2d(x):
        # mean = np.mean(x, axis=0, keepdims=True)
        eps=1e-5
        mean = np.mean(x, axis=0)[np.newaxis, :, :, :]
        # std = np.std(x, axis=0, keepdims=True)
        std = np.std(x, axis=0)[np.newaxis, :, :, :]
        return (x - mean) / np.sqrt(std + eps)


    # Pad output of first convolution for second convolution
    padded = np.zeros((input.shape[0], input.shape[1] + 2, input.shape[2] + 2,
                       conv1.shape[3]))

    padded[:, 1:-1, 1:-1, :] = conv2d(input, conv1)
    x = batchnorm2d(padded)
    x = relu(x)
    x = conv2d(x, conv2)
    x = batchnorm2d(x)
    x = relu(x)
    x = conv2d(x, conv3)
    x = batchnorm2d(x)
    res = relu(x + input)
    if __CODON_RET__: return res

def scattering_self_energies(neigh_idx: np.ndarray[Int[32], 2], dH: np.ndarray[complex, 5], G: np.ndarray[complex, 5], D: np.ndarray[complex, 6], Sigma: np.ndarray[complex, 5]):

    for k in range(G.shape[0]):
        for E in range(G.shape[1]):
            for q in range(D.shape[0]):
                for w in range(D.shape[1]):
                    for i in range(D.shape[-2]):
                        for j in range(D.shape[-1]):
                            for a in range(neigh_idx.shape[0]):
                                for b in range(neigh_idx.shape[1]):
                                    if E - w >= 0:
                                        dHG = G[k, E - w, int(neigh_idx[a, b])] @ dH[a, b, i]
                                        dHD = dH[a, b, j] * D[q, w, a, b, i, j]
                                        Sigma[k, E, a] += dHG @ dHD

def seidel_2d(TSTEPS: int, N: int, A: np.ndarray[float,2]):

    for t in range(0, TSTEPS - 1):
        for i in range(1, N - 1):
            A[i, 1:-1] += (A[i - 1, :-2] + A[i - 1, 1:-1] + A[i - 1, 2:] +
                           A[i, 2:] + A[i + 1, :-2] + A[i + 1, 1:-1] +
                           A[i + 1, 2:])
            for j in range(1, N - 1):
                A[i, j] += A[i, j - 1]
                A[i, j] /= 9.0

def softmax(x: np.ndarray[float32, 4]):
    tmp_max = np.max(x, axis=-1, keepdims=True)
    tmp_out = np.exp(x - tmp_max)
    tmp_sum = np.sum(tmp_out, axis=-1, keepdims=True)
    res = tmp_out / tmp_sum
    if __CODON_RET__: return res

def spmv(A_row: np.ndarray[u32,1], A_col: np.ndarray[u32,1], A_val: np.ndarray[float,1], x: np.ndarray[float,1]):
    y = np.empty(A_row.size - 1, A_val.dtype)

    for i in range(A_row.size - 1):
        cols = A_col[int(A_row[i]):int(A_row[i + 1])].astype(np.int64)
        vals = A_val[int(A_row[i]):int(A_row[i + 1])]
        y[i] = vals @ x[cols]

    if __CODON_RET__: return y

def stockham_fft(N: int, R: int, K: int, x: np.ndarray[complex, 1], y: np.ndarray[complex, 1]):
    def mgrid_stockham(xn, yn):
        Xi = np.empty((xn, yn), dtype=np.int32)
        Yi = np.empty((xn, yn), dtype=np.int32)
        for i in range(xn):
            Xi[i, :] = i
        for j in range(yn):
            Yi[:, j] = j
        return Xi, Yi

    # Generate DFT matrix for radix R.
    # Define transient variable for matrix.
    # i_coord, j_coord = np.mgrid[0:R, 0:R]
    i_coord, j_coord = mgrid_stockham(R, R)
    dft_mat = np.empty((R, R), dtype=np.complex128)
    dft_mat = np.exp(-2.0j * np.pi * i_coord * j_coord / R)
    # Move input x to output y
    # to avoid overwriting the input.
    y[:] = x[:]

    # ii_coord, jj_coord = np.mgrid[0:R, 0:R**K]
    ii_coord, jj_coord = mgrid_stockham(R, R**K)

    # Main Stockham loop
    for i in range(K):
        # Stride permutation
        yv = np.reshape(y, (R**i, R, R**(K-i-1)))
        tmp_perm = np.transpose(yv, axes=(1, 0, 2))
        # Twiddle Factor multiplication
        D = np.empty((R, R**i, R**(K - i - 1)), dtype=np.complex128)
        tmp = np.exp(-2.0j * np.pi * ii_coord[:, :R**i] * jj_coord[:, :R**i] /
                     R**(i + 1))
        D[:] = np.repeat(np.reshape(tmp, (R, R**i, 1)), R ** (K-i-1), axis=2)
        tmp_twid = np.reshape(tmp_perm, (N, )) * np.reshape(D, (N, ))
        # Product with Butterfly
        y[:] = np.reshape(dft_mat @ np.reshape(tmp_twid, (R, R**(K-1))), (N, ))

def symm(alpha: float, beta: float, C: np.ndarray[float, 2], A: np.ndarray[float, 2], B: np.ndarray[float, 2]):

    temp2 = np.empty((C.shape[1], ), dtype=C.dtype)
    C *= beta
    for i in range(C.shape[0]):
        for j in range(C.shape[1]):
            C[:i, j] += alpha * B[i, j] * A[i, :i]
            temp2[j] = B[:i, j] @ A[i, :i]
        C[i, :] += alpha * B[i, :] * A[i, i] + alpha * temp2

def syr2k(alpha: float, beta: float, C: np.ndarray[float,2], A: np.ndarray[float,2], B: np.ndarray[float,2]):

    for i in range(A.shape[0]):
        C[i, :i + 1] *= beta
        for k in range(A.shape[1]):
            C[i, :i + 1] += (A[:i + 1, k] * alpha * B[i, k] +
                             B[:i + 1, k] * alpha * A[i, k])

def syrk(alpha: float, beta: float, C: np.ndarray[float, 2], A: np.ndarray[float, 2]):

    for i in range(A.shape[0]):
        C[i, :i + 1] *= beta
        for k in range(A.shape[1]):
            C[i, :i + 1] += alpha * A[i, k] * A[:i + 1, k]

def trisolv(L: np.ndarray[float, 2], x: np.ndarray[float, 1], b: np.ndarray[float,1]):
    for i in range(x.shape[0]):
        x[i] = (b[i] - L[i, :i] @ x[:i]) / L[i, i]

def trmm(alpha: float, A: np.ndarray[float,2], B: np.ndarray[float,2]):

    for i in range(B.shape[0]):
        for j in range(B.shape[1]):
            B[i, j] += np.dot(A[i + 1:, i], B[i + 1:, j])
    B *= alpha

def vadv(utens_stage: np.ndarray[float, 3], u_stage: np.ndarray[float,3], wcon: np.ndarray[float,3], u_pos: np.ndarray[float,3], utens: np.ndarray[float,3], dtr_stage: float):
    BET_M = 0.5
    BET_P = 0.5

    I, J, K = utens_stage.shape[0], utens_stage.shape[1], utens_stage.shape[2]
    # ccol = np.ndarray((I, J, K), dtype=utens_stage.dtype)
    # dcol = np.ndarray((I, J, K), dtype=utens_stage.dtype)
    # data_col = np.ndarray((I, J), dtype=utens_stage.dtype)
    ccol = np.empty((I, J, K), dtype=utens_stage.dtype)
    dcol = np.empty((I, J, K), dtype=utens_stage.dtype)
    data_col = np.empty((I, J), dtype=utens_stage.dtype)

    for k in range(1):
        gcv = 0.25 * (wcon[1:, :, k + 1] + wcon[:-1, :, k + 1])
        cs = gcv * BET_M

        ccol[:, :, k] = gcv * BET_P
        bcol = dtr_stage - ccol[:, :, k]

        # update the d column
        correction_term = -cs * (u_stage[:, :, k + 1] - u_stage[:, :, k])
        dcol[:, :, k] = (dtr_stage * u_pos[:, :, k] + utens[:, :, k] +
                         utens_stage[:, :, k] + correction_term)

        # Thomas forward
        divided = 1.0 / bcol
        ccol[:, :, k] = ccol[:, :, k] * divided
        dcol[:, :, k] = dcol[:, :, k] * divided

    for k in range(1, K - 1):
        gav = -0.25 * (wcon[1:, :, k] + wcon[:-1, :, k])
        gcv = 0.25 * (wcon[1:, :, k + 1] + wcon[:-1, :, k + 1])

        as_ = gav * BET_M
        cs = gcv * BET_M

        acol = gav * BET_P
        ccol[:, :, k] = gcv * BET_P
        bcol = dtr_stage - acol - ccol[:, :, k]

        # update the d column
        correction_term = -as_ * (u_stage[:, :, k - 1] -
                                  u_stage[:, :, k]) - cs * (
                                      u_stage[:, :, k + 1] - u_stage[:, :, k])
        dcol[:, :, k] = (dtr_stage * u_pos[:, :, k] + utens[:, :, k] +
                         utens_stage[:, :, k] + correction_term)

        # Thomas forward
        divided = 1.0 / (bcol - ccol[:, :, k - 1] * acol)
        ccol[:, :, k] = ccol[:, :, k] * divided
        dcol[:, :, k] = (dcol[:, :, k] - (dcol[:, :, k - 1]) * acol) * divided

    for k in range(K - 1, K):
        gav = -0.25 * (wcon[1:, :, k] + wcon[:-1, :, k])
        as_ = gav * BET_M
        acol = gav * BET_P
        bcol = dtr_stage - acol

        # update the d column
        correction_term = -as_ * (u_stage[:, :, k - 1] - u_stage[:, :, k])
        dcol[:, :, k] = (dtr_stage * u_pos[:, :, k] + utens[:, :, k] +
                         utens_stage[:, :, k] + correction_term)

        # Thomas forward
        divided = 1.0 / (bcol - ccol[:, :, k - 1] * acol)
        dcol[:, :, k] = (dcol[:, :, k] - (dcol[:, :, k - 1]) * acol) * divided

    for k in range(K - 1, K - 2, -1):
        datacol = dcol[:, :, k]
        data_col[:] = datacol
        utens_stage[:, :, k] = dtr_stage * (datacol - u_pos[:, :, k])

    for k in range(K - 2, -1, -1):
        datacol = dcol[:, :, k] - ccol[:, :, k] * data_col[:, :]
        data_col[:] = datacol
        utens_stage[:, :, k] = dtr_stage * (datacol - u_pos[:, :, k])


================================================
FILE: bench/codon/primes.codon
================================================
from sys import argv
from time import time

def is_prime(n):
    factors = 0
    for i in range(2, n):
        if n % i == 0:
            factors += 1
    return factors == 0

limit = int(argv[1])
total = 0

t0 = time()
@par(schedule='dynamic')
for i in range(2, limit):
    if is_prime(i):
        total += 1
t1 = time()

print(total)
print(t1 - t0)


================================================
FILE: bench/codon/primes.py
================================================
from sys import argv
from time import time

def is_prime(n):
    factors = 0
    for i in range(2, n):
        if n % i == 0:
            factors += 1
    return factors == 0

limit = int(argv[1])
total = 0

t0 = time()
for i in range(2, limit):
    if is_prime(i):
        total += 1
t1 = time()

print(total)
print(t1 - t0)


================================================
FILE: bench/codon/set_partition.cpp
================================================
#include <algorithm>
#include <chrono>
#include <functional>
#include <iostream>
#include <vector>

template <class T> using vec = std::vector<T>;

inline vec<int> range(int start, int stop) {
  vec<int> v(stop - start);
  uint j = 0;
  for (int i = start; i < stop; i++)
    v[j++] = i;
  return v;
}

inline bool conforms(const vec<vec<int>> &candidate, int minsize, int forgive) {
  int deficit = 0;
  for (const auto &p : candidate) {
    int need = minsize - static_cast<int>(p.size());
    if (need > 0)
      deficit += need;
  }
  return deficit <= forgive;
}

inline void partition_filtered(const vec<int> &collection,
                               std::function<void(const vec<vec<int>> &)> callback,
                               int minsize = 1, int forgive = 0) {
  if (collection.size() == 1) {
    callback({collection});
    return;
  }

  auto first = collection[0];
  auto loop = [&](const vec<vec<int>> &smaller) {
    int n = 0;

    vec<vec<int>> candidate;
    candidate.reserve(smaller.size() + 1);
    vec<int> rep;

    for (const auto &subset : smaller) {
      candidate.resize(n);
      for (int i = 0; i < n; i++)
        candidate[i] = smaller[i];

      rep.clear();
      rep.reserve(subset.size() + 1);
      rep.push_back(first);
      rep.insert(rep.end(), subset.begin(), subset.end());
      candidate.push_back({rep});

      for (int i = n + 1; i < smaller.size(); i++)
        candidate.push_back(smaller[i]);

      if (conforms(candidate, minsize, forgive))
        callback(candidate);
      ++n;
    }

    candidate.clear();
    candidate.push_back({first});
    candidate.insert(candidate.end(), smaller.begin(), smaller.end());

    if (conforms(candidate, minsize, forgive))
      callback(candidate);
  };

  vec<int> new_collection(collection.begin() + 1, collection.end());
  partition_filtered(new_collection, loop, minsize, forgive + 1);
}

int main(int argc, char *argv[]) {
  using clock = std::chrono::high_resolution_clock;
  using std::chrono::duration_cast;
  using std::chrono::milliseconds;

  auto t = clock::now();
  int n = 1;
  int x = 0;

  auto callback = [&](const vec<vec<int>> &p) {
    auto copy = p;
    std::sort(copy.begin(), copy.end());
    x += copy[copy.size() / 3][0];
  };

  auto something = range(1, std::atoi(argv[1]));
  partition_filtered(something, callback, 2);
  std::cout << x << std::endl;
  std::cout << (duration_cast<milliseconds>(clock::now() - t).count() / 1e3)
            << std::endl;
}


================================================
FILE: bench/codon/set_partition.py
================================================
# https://stackoverflow.com/questions/73473074/speed-up-set-partition-generation-by-skipping-ones-with-subsets-smaller-or-large
import sys
import time

def conforms(candidate, minsize, forgive):
    """
    Check if partition `candidate` is at most `forgive` additions from making
    all its elements conform to having minimum size `minsize`
    """
    deficit = 0
    for p in candidate:
        need = minsize - len(p)
        if need > 0:
            deficit += need

    # Is the deficit small enough?
    return (deficit <= forgive)

def partition_filtered(collection, minsize=1, forgive=0):
    """
    Generate partitions that contain at least `minsize` elements per set;
    allow `forgive` missing elements, which can get added in subsequent steps
    """
    if len(collection) == 1:
        yield [ collection ]
        return

    first = collection[0]
    for smaller in partition_filtered(collection[1:], minsize, forgive=forgive+1):
        # insert `first` in each of the subpartition's subsets
        for n, subset in enumerate(smaller):
            candidate = smaller[:n] + [[ first ] + subset]  + smaller[n+1:]
            if conforms(candidate, minsize, forgive):
                yield candidate

        # put `first` in its own subset
        candidate = [ [ first ] ] + smaller
        if conforms(candidate, minsize, forgive):
            yield candidate


import time

t = time.time()
something = list(range(1, int(sys.argv[1])))
v = partition_filtered(something, minsize=2)
x = 0
for p in v:
    p.sort()
    x += p[len(p) // 3][0]
print(x)
print(time.time() - t)


================================================
FILE: bench/codon/spectral_norm.py
================================================
"""
MathWorld: "Hundred-Dollar, Hundred-Digit Challenge Problems", Challenge #3.
http://mathworld.wolfram.com/Hundred-DollarHundred-DigitChallengeProblems.html

The Computer Language Benchmarks Game
http://benchmarksgame.alioth.debian.org/u64q/spectralnorm-description.html#spectralnorm

Contributed by Sebastien Loisel
Fixed by Isaac Gouy
Sped up by Josh Goldfoot
Dirtily sped up by Simon Descarpentries
Concurrency by Jason Stitt
Adapted for Codon by @arshajii
"""

from time import time

DEFAULT_N = 260

def eval_A(i, j):
    return 1.0 / ((i + j) * (i + j + 1) // 2 + i + 1)

def eval_times_u(func, u):
    return [func((i, u)) for i in range(len(list(u)))]

def part_At_times_u(i_u):
    i, u = i_u
    partial_sum = 0.
    for j, u_j in enumerate(u):
        partial_sum += eval_A(j, i) * u_j
    return partial_sum

def part_A_times_u(i_u):
    i, u = i_u
    partial_sum = 0.
    for j, u_j in enumerate(u):
        partial_sum += eval_A(i, j) * u_j
    return partial_sum

def eval_AtA_times_u(u):
    return eval_times_u(part_At_times_u, eval_times_u(part_A_times_u, u))

def bench_spectral_norm(loops):
    range_it = range(loops)
    total = 0.
    for _ in range_it:
        u = [1.] * DEFAULT_N
        v = None
        for dummy in range(10):
            v = eval_AtA_times_u(u)
            u = eval_AtA_times_u(v)
        vBv = vv = 0.
        for ue, ve in zip(u, v):
            vBv += ue * ve
            vv += ve * ve
        total += vBv + vv
    return total

t0 = time()
print(bench_spectral_norm(100))
t1 = time()
print(t1 - t0)


================================================
FILE: bench/codon/sum.py
================================================
# https://towardsdatascience.com/getting-started-with-pypy-ef4ba5cb431c
import time
t1 = time.time()
nums = range(50000000)
sum = 0
for k in nums:
    sum = sum + k
print("Sum of 50000000 numbers is : ", sum)
t2 = time.time()
t = t2 - t1
print(t)


================================================
FILE: bench/codon/taq.cpp
================================================
#include <algorithm>
#include <chrono>
#include <cmath>
#include <fstream>
#include <iostream>
#include <numeric>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>

namespace {
template <typename It> double mean(It begin, It end) {
  double sum = std::accumulate(begin, end, 0.0);
  double mean = sum / std::distance(begin, end);
  return mean;
}

template <typename It> double stdev(It begin, It end) {
  auto n = std::distance(begin, end);
  double sum = std::accumulate(begin, end, 0.0);
  double mean = sum / n;
  double sq_sum = std::inner_product(begin, end, begin, 0.0);
  double stdev = std::sqrt(sq_sum / n - mean * mean);
  return stdev;
}

std::vector<int> find_peaks(const std::vector<double> &y) {
  int lag = 100;
  double threshold = 10.0;
  double influence = 0.5;
  int t = y.size();
  std::vector<int> signals(t);

  if (t <= lag)
    return signals;

  std::vector<double> filtered_y;
  filtered_y.reserve(t);
  for (int i = 0; i < t; i++)
    filtered_y.push_back(i < lag ? y[i] : 0.0);

  std::vector<double> avg_filter(t);
  std::vector<double> std_filter(t);
  avg_filter[lag] = mean(y.begin(), y.begin() + lag);
  avg_filter[lag] = stdev(y.begin(), y.begin() + lag);

  for (int i = lag; i < t; i++) {
    if (std::abs(y[i] - avg_filter[i - 1]) > threshold * std_filter[i - 1]) {
      signals[i] = y[i] > avg_filter[i - 1] ? +1 : -1;
      filtered_y[i] = influence * y[i] + (1 - influence) * filtered_y[i - 1];
    } else {
      signals[i] = 0;
      filtered_y[i] = y[i];
    }

    avg_filter[i] = mean(filtered_y.begin() + (i - lag), filtered_y.begin() + i);
    std_filter[i] = stdev(filtered_y.begin() + (i - lag), filtered_y.begin() + i);
  }

  return signals;
}

std::pair<std::vector<double>, std::vector<int>>
process_data(const std::vector<std::pair<uint64_t, long>> &series) {
  std::unordered_map<uint64_t, long> grouped;
  for (const auto &p : series) {
    auto bucket = p.first;
    auto volume = p.second;
    grouped[bucket] += volume;
  }

  std::vector<std::pair<uint64_t, long>> temp;
  temp.reserve(grouped.size());
  for (const auto &p : grouped)
    temp.emplace_back(p.first, p.second);
  std::sort(temp.begin(), temp.end());

  std::vector<double> y;
  y.reserve(grouped.size());
  for (const auto &p : temp)
    y.push_back(p.second);

  return {y, find_peaks(y)};
}

const uint64_t BUCKET_SIZE = 1000000000;
} // namespace

int main(int argc, char *argv[]) {
  using clock = std::chrono::high_resolution_clock;
  using std::chrono::duration_cast;
  using std::chrono::milliseconds;

  auto t = clock::now();
  std::unordered_map<std::string, std::vector<std::pair<uint64_t, long>>> data;
  std::ifstream file(argv[1]);
  bool header = true;

  for (std::string line; std::getline(file, line);) {
    if (header) {
      header = false;
      continue;
    }

    std::stringstream ss(line);
    std::vector<std::string> x;
    for (std::string field; std::getline(ss, field, '|');)
      x.push_back(field);

    if (x[0] == "END" || x[4] == "ENDP")
      continue;

    uint64_t timestamp = std::stoull(x[0]);
    std::string symbol = x[2];
    long volume = std::stol(x[4]);
    data[symbol].emplace_back(timestamp / BUCKET_SIZE, volume);
  }

  for (auto &e : data) {
    auto symbol = e.first;
    auto &series = e.second;
    auto p = process_data(series);
    auto &signals = p.second;
    std::cout << symbol << " " << std::reduce(signals.begin(), signals.end())
              << std::endl;
  }

  std::cout << (duration_cast<milliseconds>(clock::now() - t).count() / 1e3)
            << std::endl;
}


================================================
FILE: bench/codon/taq.py
================================================
# Parses TAQ file and performs volume peak detection
from sys import argv
from time import time
from statistics import mean, stdev

# https://stackoverflow.com/questions/22583391/peak-signal-detection-in-realtime-timeseries-data
def find_peaks(y):
    lag = 100
    threshold = 10.0
    influence = 0.5

    t = len(y)
    signals = [0. for _ in range(t)]

    if t <= lag:
        return signals

    filtered_y = [y[i] if i < lag else 0. for i in range(t)]
    avg_filter = [0. for _ in range(t)]
    std_filter = [0. for _ in range(t)]
    avg_filter[lag] = mean(y[:lag])
    std_filter[lag] = stdev(y[:lag])

    for i in range(lag, t):
        if abs(y[i] - avg_filter[i-1]) > threshold * std_filter[i-1]:
            signals[i] = +1 if y[i] > avg_filter[i-1] else -1
            filtered_y[i] = influence*y[i] + (1 - influence)*filtered_y[i-1]
        else:
            signals[i] = 0
            filtered_y[i] = y[i]

        avg_filter[i] = mean(filtered_y[i-lag:i])
        std_filter[i] = stdev(filtered_y[i-lag:i])

    return signals

def process_data(series):
    grouped = {}
    for bucket, volume in series:
        grouped[bucket] = grouped.get(bucket, 0) + volume

    y = [float(t[1]) for t in sorted(grouped.items())]
    return y, find_peaks(y)

BUCKET_SIZE = 1_000_000_000
t0 = time()

data = {}
with open(argv[1]) as f:
    header = True

    for line in f:
        if header:
            header = False
            continue

        x = line.split('|')
        if x[0] == 'END' or x[4] == 'ENDP':
            continue

        timestamp = int(x[0])
        symbol = x[2]
        volume = int(x[4])

        series = data.setdefault(symbol, [])
        series.append((timestamp // BUCKET_SIZE, volume))

for symbol, series in data.items():
    y, signals = process_data(series)
    print(symbol, sum(signals))

t1 = time()
print(t1 - t0)


================================================
FILE: bench/codon/word_count.cpp
================================================
#include <chrono>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <unordered_map>

using namespace std;

int main(int argc, char *argv[]) {
  using clock = chrono::high_resolution_clock;
  using chrono::duration_cast;
  using chrono::milliseconds;
  auto t = clock::now();

  cin.tie(nullptr);
  cout.sync_with_stdio(false);

  if (argc != 2) {
    cerr << "Expected one argument." << endl;
    return -1;
  }

  ifstream file(argv[1]);
  if (!file.is_open()) {
    cerr << "Could not open file: " << argv[1] << endl;
    return -1;
  }

  unordered_map<string, int> map;
  for (string line; getline(file, line);) {
    istringstream sin(line);
    for (string word; sin >> word;)
      map[word] += 1;
  }

  cout << map.size() << endl;
  cout << (duration_cast<milliseconds>(clock::now() - t).count() / 1e3) << endl;
}


================================================
FILE: bench/codon/word_count.py
================================================
from sys import argv
from time import time

t0 = time()
wc = {}
filename = argv[-1]

with open(filename) as f:
    for l in f:
        for w in l.split():
            wc[w] = wc.get(w, 0) + 1

print(len(wc))
t1 = time()
print(t1 - t0)


================================================
FILE: bench/run.sh
================================================
# set -x

trap 'echo Exiting...; exit' INT

get_data() {
    git clone https://github.com/exaloop/seq
    mkdir -p test
    cp -r seq/test/* test/
    cp -r ../test/* test/
    mkdir -p build
    mkdir -p data
    curl -L https://ftp.nyse.com/Historical%20Data%20Samples/DAILY%20TAQ/EQY_US_ALL_NBBO_20250102.gz | gzip -d -c | head -n10000000 > data/taq.txt
    curl -L https://hgdownload.soe.ucsc.edu/goldenPath/hg38/chromosomes/chr22.fa.gz | gzip -d -c > data/chr22.fa
    samtools faidx data/chr22.fa
    curl -L https://github.com/lh3/biofast/releases/download/biofast-data-v1/biofast-data-v1.tar.gz | tar zxvf - -C data
    curl -L http://cb.csail.mit.edu/cb/seq/nbt/sw-data.tar.bz2 | tar jxvf - -C data
    curl -L http://cb.csail.mit.edu/cb/seq/nbt/umi-data.bz2 | bzip2 -c -d > data/hgmm_100_R1.fastq
    run/exe/bench_fasta 25000000 > data/three_.fa
    samtools faidx data/three_.fa
    samtools faidx data/three_.fa THREE > data/three.fa
    rm -f data/three_.fa
    samtools view https://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeSydhRnaSeq/wgEncodeSydhRnaSeqK562Ifna6hPolyaAln.bam chr22 -b -o data/rnaseq.bam
    curl -L https://hgdownload.soe.ucsc.edu/goldenPath/hg19/chromosomes/chr22.fa.gz | gzip -d -c > data/chr22_hg19.fa
    samtools faidx data/chr22_hg19.fa
    samtools index data/rnaseq.bam
}

compile() {
    name=$1
    path=$2
    extra=$3
    echo -n "====> C: ${name} ${path} "
    start=$(date +%s.%N)
    CODON_DEBUG=lt /usr/bin/time -f 'time=%e mem=%M exit=%x' \
        codon build -release $extra $path -o run/exe/${name}.exe \
        >run/log/${name}.compile.txt 2>&1
    duration=$(echo "$(date +%s.%N) $start" | awk '{printf "%.1f", $1-$2}')
    echo "[$? run/log/${name}.compile.txt ${duration}]"
}

run() {
    name=$1
    args="${@:2}"
    echo -n "      R: $name $args "
    start=$(date +%s.%N)
    eval "/usr/bin/time -o run/log/${name}.time.txt -f 'time=%e mem=%M exit=%x' run/exe/${name}.exe $args >run/log/${name}.run.txt 2>&1"
    duration=$(echo "$(date +%s.%N) $start" | awk '{printf "%.1f", $1-$2}')
    echo "[$? run/log/${name}.run.txt ${duration}]"
}

# get_data
mkdir -p run/exe
mkd
Download .txt
gitextract_o7k99b34/

├── .clang-format
├── .clang-tidy
├── .gitattributes
├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       └── ci.yml
├── .gitignore
├── .pre-commit-config.yaml
├── CMakeLists.txt
├── CODEOWNERS
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── bench/
│   ├── README.md
│   ├── codon/
│   │   ├── binary_trees.codon
│   │   ├── binary_trees.cpp
│   │   ├── binary_trees.py
│   │   ├── chaos.codon
│   │   ├── chaos.py
│   │   ├── fannkuch.codon
│   │   ├── fannkuch.py
│   │   ├── float.py
│   │   ├── go.codon
│   │   ├── go.py
│   │   ├── mandelbrot.codon
│   │   ├── mandelbrot.py
│   │   ├── nbody.cpp
│   │   ├── nbody.py
│   │   ├── npbench.codon
│   │   ├── npbench_lib.codon
│   │   ├── primes.codon
│   │   ├── primes.py
│   │   ├── set_partition.cpp
│   │   ├── set_partition.py
│   │   ├── spectral_norm.py
│   │   ├── sum.py
│   │   ├── taq.cpp
│   │   ├── taq.py
│   │   ├── word_count.cpp
│   │   └── word_count.py
│   └── run.sh
├── cmake/
│   ├── CMakeRC.cmake
│   ├── backtrace-config.h.in
│   ├── backtrace-supported.h.in
│   ├── config.h.in
│   ├── config.py.in
│   └── deps.cmake
├── codon/
│   ├── app/
│   │   └── main.cpp
│   ├── cir/
│   │   ├── analyze/
│   │   │   ├── analysis.cpp
│   │   │   ├── analysis.h
│   │   │   ├── dataflow/
│   │   │   │   ├── capture.cpp
│   │   │   │   ├── capture.h
│   │   │   │   ├── cfg.cpp
│   │   │   │   ├── cfg.h
│   │   │   │   ├── dominator.cpp
│   │   │   │   ├── dominator.h
│   │   │   │   ├── reaching.cpp
│   │   │   │   └── reaching.h
│   │   │   └── module/
│   │   │       ├── global_vars.cpp
│   │   │       ├── global_vars.h
│   │   │       ├── side_effect.cpp
│   │   │       └── side_effect.h
│   │   ├── attribute.cpp
│   │   ├── attribute.h
│   │   ├── base.cpp
│   │   ├── base.h
│   │   ├── cir.h
│   │   ├── const.cpp
│   │   ├── const.h
│   │   ├── dsl/
│   │   │   ├── codegen.h
│   │   │   ├── nodes.cpp
│   │   │   └── nodes.h
│   │   ├── flow.cpp
│   │   ├── flow.h
│   │   ├── func.cpp
│   │   ├── func.h
│   │   ├── instr.cpp
│   │   ├── instr.h
│   │   ├── llvm/
│   │   │   ├── gpu.cpp
│   │   │   ├── gpu.h
│   │   │   ├── llvisitor.cpp
│   │   │   ├── llvisitor.h
│   │   │   ├── llvm.h
│   │   │   ├── native/
│   │   │   │   ├── native.cpp
│   │   │   │   ├── native.h
│   │   │   │   └── targets/
│   │   │   │       ├── aarch64.cpp
│   │   │   │       ├── aarch64.h
│   │   │   │       ├── arm.cpp
│   │   │   │       ├── arm.h
│   │   │   │       ├── target.h
│   │   │   │       ├── x86.cpp
│   │   │   │       └── x86.h
│   │   │   ├── optimize.cpp
│   │   │   └── optimize.h
│   │   ├── module.cpp
│   │   ├── module.h
│   │   ├── pyextension.h
│   │   ├── transform/
│   │   │   ├── cleanup/
│   │   │   │   ├── canonical.cpp
│   │   │   │   ├── canonical.h
│   │   │   │   ├── dead_code.cpp
│   │   │   │   ├── dead_code.h
│   │   │   │   ├── global_demote.cpp
│   │   │   │   ├── global_demote.h
│   │   │   │   ├── replacer.cpp
│   │   │   │   └── replacer.h
│   │   │   ├── folding/
│   │   │   │   ├── const_fold.cpp
│   │   │   │   ├── const_fold.h
│   │   │   │   ├── const_prop.cpp
│   │   │   │   ├── const_prop.h
│   │   │   │   ├── folding.cpp
│   │   │   │   ├── folding.h
│   │   │   │   └── rule.h
│   │   │   ├── lowering/
│   │   │   │   ├── async_for.cpp
│   │   │   │   ├── async_for.h
│   │   │   │   ├── await.cpp
│   │   │   │   ├── await.h
│   │   │   │   ├── imperative.cpp
│   │   │   │   ├── imperative.h
│   │   │   │   ├── pipeline.cpp
│   │   │   │   └── pipeline.h
│   │   │   ├── manager.cpp
│   │   │   ├── manager.h
│   │   │   ├── numpy/
│   │   │   │   ├── expr.cpp
│   │   │   │   ├── forward.cpp
│   │   │   │   ├── indexing.cpp
│   │   │   │   ├── indexing.h
│   │   │   │   ├── numpy.cpp
│   │   │   │   └── numpy.h
│   │   │   ├── parallel/
│   │   │   │   ├── openmp.cpp
│   │   │   │   ├── openmp.h
│   │   │   │   ├── schedule.cpp
│   │   │   │   └── schedule.h
│   │   │   ├── pass.cpp
│   │   │   ├── pass.h
│   │   │   ├── pythonic/
│   │   │   │   ├── dict.cpp
│   │   │   │   ├── dict.h
│   │   │   │   ├── generator.cpp
│   │   │   │   ├── generator.h
│   │   │   │   ├── io.cpp
│   │   │   │   ├── io.h
│   │   │   │   ├── list.cpp
│   │   │   │   ├── list.h
│   │   │   │   ├── str.cpp
│   │   │   │   └── str.h
│   │   │   └── rewrite.h
│   │   ├── types/
│   │   │   ├── types.cpp
│   │   │   └── types.h
│   │   ├── util/
│   │   │   ├── cloning.cpp
│   │   │   ├── cloning.h
│   │   │   ├── context.h
│   │   │   ├── format.cpp
│   │   │   ├── format.h
│   │   │   ├── inlining.cpp
│   │   │   ├── inlining.h
│   │   │   ├── irtools.cpp
│   │   │   ├── irtools.h
│   │   │   ├── iterators.h
│   │   │   ├── matching.cpp
│   │   │   ├── matching.h
│   │   │   ├── operator.h
│   │   │   ├── outlining.cpp
│   │   │   ├── outlining.h
│   │   │   ├── packs.h
│   │   │   ├── side_effect.cpp
│   │   │   ├── side_effect.h
│   │   │   ├── visitor.cpp
│   │   │   └── visitor.h
│   │   ├── value.cpp
│   │   ├── value.h
│   │   ├── var.cpp
│   │   └── var.h
│   ├── compiler/
│   │   ├── compiler.cpp
│   │   ├── compiler.h
│   │   ├── debug_listener.cpp
│   │   ├── debug_listener.h
│   │   ├── engine.cpp
│   │   ├── engine.h
│   │   ├── error.cpp
│   │   ├── error.h
│   │   ├── jit.cpp
│   │   ├── jit.h
│   │   ├── jit_extern.h
│   │   ├── memory_manager.cpp
│   │   └── memory_manager.h
│   ├── config/
│   │   └── .gitignore
│   ├── dsl/
│   │   ├── dsl.h
│   │   ├── plugins.cpp
│   │   └── plugins.h
│   ├── parser/
│   │   ├── ast/
│   │   │   ├── attr.cpp
│   │   │   ├── attr.h
│   │   │   ├── error.h
│   │   │   ├── expr.cpp
│   │   │   ├── expr.h
│   │   │   ├── node.h
│   │   │   ├── stmt.cpp
│   │   │   ├── stmt.h
│   │   │   ├── types/
│   │   │   │   ├── class.cpp
│   │   │   │   ├── class.h
│   │   │   │   ├── function.cpp
│   │   │   │   ├── function.h
│   │   │   │   ├── link.cpp
│   │   │   │   ├── link.h
│   │   │   │   ├── static.cpp
│   │   │   │   ├── static.h
│   │   │   │   ├── traits.cpp
│   │   │   │   ├── traits.h
│   │   │   │   ├── type.cpp
│   │   │   │   ├── type.h
│   │   │   │   ├── union.cpp
│   │   │   │   └── union.h
│   │   │   └── types.h
│   │   ├── ast.h
│   │   ├── cache.cpp
│   │   ├── cache.h
│   │   ├── common.cpp
│   │   ├── common.h
│   │   ├── ctx.h
│   │   ├── match.cpp
│   │   ├── match.h
│   │   ├── peg/
│   │   │   ├── grammar.peg
│   │   │   ├── openmp.peg
│   │   │   ├── peg.cpp
│   │   │   ├── peg.h
│   │   │   └── rules.h
│   │   └── visitors/
│   │       ├── doc/
│   │       │   ├── doc.cpp
│   │       │   └── doc.h
│   │       ├── format/
│   │       │   ├── format.cpp
│   │       │   └── format.h
│   │       ├── scoping/
│   │       │   ├── scoping.cpp
│   │       │   └── scoping.h
│   │       ├── translate/
│   │       │   ├── translate.cpp
│   │       │   ├── translate.h
│   │       │   ├── translate_ctx.cpp
│   │       │   └── translate_ctx.h
│   │       ├── typecheck/
│   │       │   ├── access.cpp
│   │       │   ├── assign.cpp
│   │       │   ├── basic.cpp
│   │       │   ├── call.cpp
│   │       │   ├── class.cpp
│   │       │   ├── collections.cpp
│   │       │   ├── cond.cpp
│   │       │   ├── ctx.cpp
│   │       │   ├── ctx.h
│   │       │   ├── error.cpp
│   │       │   ├── function.cpp
│   │       │   ├── import.cpp
│   │       │   ├── infer.cpp
│   │       │   ├── loops.cpp
│   │       │   ├── op.cpp
│   │       │   ├── special.cpp
│   │       │   ├── typecheck.cpp
│   │       │   └── typecheck.h
│   │       ├── visitor.cpp
│   │       └── visitor.h
│   ├── runtime/
│   │   ├── exc.cpp
│   │   ├── floatlib/
│   │   │   ├── extenddftf2.c
│   │   │   ├── extendhfsf2.c
│   │   │   ├── extendhftf2.c
│   │   │   ├── extendsfdf2.c
│   │   │   ├── extendsftf2.c
│   │   │   ├── fp_extend.h
│   │   │   ├── fp_extend_impl.inc
│   │   │   ├── fp_lib.h
│   │   │   ├── fp_trunc.h
│   │   │   ├── fp_trunc_impl.inc
│   │   │   ├── int_endianness.h
│   │   │   ├── int_lib.h
│   │   │   ├── int_math.h
│   │   │   ├── int_types.h
│   │   │   ├── int_util.h
│   │   │   ├── truncdfbf2.c
│   │   │   ├── truncdfhf2.c
│   │   │   ├── truncdfsf2.c
│   │   │   ├── truncsfbf2.c
│   │   │   ├── truncsfhf2.c
│   │   │   ├── trunctfdf2.c
│   │   │   ├── trunctfhf2.c
│   │   │   └── trunctfsf2.c
│   │   ├── lib.cpp
│   │   ├── lib.h
│   │   ├── numpy/
│   │   │   ├── loops.cpp
│   │   │   ├── sort.cpp
│   │   │   └── zmath.cpp
│   │   └── re.cpp
│   └── util/
│       ├── common.cpp
│       ├── common.h
│       ├── jupyter.cpp
│       ├── jupyter.h
│       ├── peg2cpp.cpp
│       ├── serialize.h
│       └── tser.h
├── docs/
│   ├── css/
│   │   └── extra.css
│   ├── developers/
│   │   ├── build.md
│   │   ├── compilation.md
│   │   ├── contribute.md
│   │   ├── extend.md
│   │   ├── ir.md
│   │   └── roadmap.md
│   ├── img/
│   │   └── image.avif
│   ├── index.md
│   ├── integrations/
│   │   ├── cpp/
│   │   │   ├── codon-from-cpp.md
│   │   │   ├── cpp-from-codon.md
│   │   │   └── jit.md
│   │   ├── jupyter.md
│   │   └── python/
│   │       ├── codon-from-python.md
│   │       ├── extensions.md
│   │       └── python-from-codon.md
│   ├── js/
│   │   └── mathjax.js
│   ├── labs/
│   │   ├── catalog/
│   │   │   └── start.md
│   │   └── index.md
│   ├── language/
│   │   ├── classes.md
│   │   ├── generics.md
│   │   ├── llvm.md
│   │   ├── lowlevel.md
│   │   ├── meta.md
│   │   └── overview.md
│   ├── libraries/
│   │   ├── api/
│   │   │   └── .gitignore
│   │   ├── numpy.md
│   │   └── stdlib.md
│   ├── overrides/
│   │   └── main.html
│   ├── parallel/
│   │   ├── gpu.md
│   │   ├── multithreading.md
│   │   └── simd.md
│   └── start/
│       ├── changelog.md
│       ├── faq.md
│       ├── install.md
│       └── usage.md
├── jit/
│   ├── .gitignore
│   ├── MANIFEST.in
│   ├── README.md
│   ├── codon/
│   │   ├── __init__.py
│   │   ├── decorator.py
│   │   ├── jit.pxd
│   │   └── jit.pyx
│   ├── pyproject.toml
│   └── setup.py
├── jupyter/
│   ├── CMakeLists.txt
│   ├── jupyter.cpp
│   ├── jupyter.h
│   ├── share/
│   │   └── jupyter/
│   │       └── kernels/
│   │           └── codon/
│   │               └── kernel.json.in
│   └── xeus.patch
├── mkdocs.yml
├── scripts/
│   ├── Dockerfile.codon-build
│   ├── Dockerfile.codon-jupyter
│   ├── Dockerfile.gpu
│   ├── Dockerfile.llvm-build
│   ├── deps.sh
│   ├── docgen.py
│   ├── fix_loader_paths.sh
│   ├── get_system_libs.sh
│   └── install.sh
├── stdlib/
│   ├── algorithms/
│   │   ├── heapsort.codon
│   │   ├── insertionsort.codon
│   │   ├── pdqsort.codon
│   │   ├── qsort.codon
│   │   ├── strings.codon
│   │   └── timsort.codon
│   ├── asyncio.codon
│   ├── bisect.codon
│   ├── bz2.codon
│   ├── cmath.codon
│   ├── codon/
│   │   └── static.codon
│   ├── collections.codon
│   ├── copy.codon
│   ├── datetime.codon
│   ├── functools.codon
│   ├── getopt.codon
│   ├── gpu.codon
│   ├── gzip.codon
│   ├── heapq.codon
│   ├── internal/
│   │   ├── __init__.codon
│   │   ├── __init_test__.codon
│   │   ├── attributes.codon
│   │   ├── builtin.codon
│   │   ├── c_stubs.codon
│   │   ├── core.codon
│   │   ├── dlopen.codon
│   │   ├── file.codon
│   │   ├── format.codon
│   │   ├── gc.codon
│   │   ├── gpu.codon
│   │   ├── internal.codon
│   │   ├── khash.codon
│   │   ├── pynumerics.codon
│   │   ├── python.codon
│   │   ├── sort.codon
│   │   ├── static.codon
│   │   ├── str.codon
│   │   └── types/
│   │       ├── any.codon
│   │       ├── array.codon
│   │       ├── bool.codon
│   │       ├── byte.codon
│   │       ├── collections/
│   │       │   ├── dict.codon
│   │       │   ├── list.codon
│   │       │   ├── set.codon
│   │       │   └── tuple.codon
│   │       ├── complex.codon
│   │       ├── ellipsis.codon
│   │       ├── error.codon
│   │       ├── float.codon
│   │       ├── function.codon
│   │       ├── generator.codon
│   │       ├── import_.codon
│   │       ├── int.codon
│   │       ├── intn.codon
│   │       ├── optional.codon
│   │       ├── ptr.codon
│   │       ├── range.codon
│   │       ├── rtti.codon
│   │       ├── slice.codon
│   │       ├── str.codon
│   │       ├── strbuf.codon
│   │       ├── tuple.codon
│   │       ├── type.codon
│   │       └── union.codon
│   ├── itertools.codon
│   ├── math.codon
│   ├── numpy/
│   │   ├── __init__.codon
│   │   ├── const.codon
│   │   ├── dragon4.codon
│   │   ├── dtype.codon
│   │   ├── emath.codon
│   │   ├── fft/
│   │   │   ├── __init__.codon
│   │   │   └── pocketfft.codon
│   │   ├── format.codon
│   │   ├── functional.codon
│   │   ├── fusion.codon
│   │   ├── indexing.codon
│   │   ├── interp.codon
│   │   ├── lib/
│   │   │   ├── __init__.codon
│   │   │   ├── arraysetops.codon
│   │   │   └── stride_tricks.codon
│   │   ├── linalg/
│   │   │   ├── __init__.codon
│   │   │   ├── blas.codon
│   │   │   └── linalg.codon
│   │   ├── linalg_sym.codon
│   │   ├── misc.codon
│   │   ├── ndarray.codon
│   │   ├── ndgpu.codon
│   │   ├── ndmath.codon
│   │   ├── npdatetime.codon
│   │   ├── npio.codon
│   │   ├── operators.codon
│   │   ├── pybridge.codon
│   │   ├── random/
│   │   │   ├── __init__.codon
│   │   │   ├── bitgen.codon
│   │   │   ├── logfactorial.codon
│   │   │   ├── mt19937.codon
│   │   │   ├── pcg64.codon
│   │   │   ├── philox.codon
│   │   │   ├── seed.codon
│   │   │   ├── sfc64.codon
│   │   │   ├── splitmix64.codon
│   │   │   └── ziggurat.codon
│   │   ├── reductions.codon
│   │   ├── routines.codon
│   │   ├── sorting.codon
│   │   ├── statistics.codon
│   │   ├── ufunc.codon
│   │   ├── util.codon
│   │   ├── window.codon
│   │   └── zmath.codon
│   ├── openmp.codon
│   ├── operator.codon
│   ├── os/
│   │   ├── __init__.codon
│   │   └── path.codon
│   ├── pickle.codon
│   ├── python.codon
│   ├── random.codon
│   ├── re.codon
│   ├── simd.codon
│   ├── sortedlist.codon
│   ├── statistics.codon
│   ├── string.codon
│   ├── sys.codon
│   ├── threading.codon
│   ├── time.codon
│   ├── typing.codon
│   └── unittest.codon
└── test/
    ├── CMakeLists.txt.in
    ├── app/
    │   ├── argv.codon
    │   ├── build.codon
    │   ├── exit.codon
    │   ├── export.codon
    │   ├── input.codon
    │   ├── input.txt
    │   ├── test.c
    │   └── test.sh
    ├── cir/
    │   ├── analyze/
    │   │   ├── dominator.cpp
    │   │   └── reaching.cpp
    │   ├── base.cpp
    │   ├── constant.cpp
    │   ├── flow.cpp
    │   ├── func.cpp
    │   ├── instr.cpp
    │   ├── module.cpp
    │   ├── test.h
    │   ├── transform/
    │   │   └── manager.cpp
    │   ├── types/
    │   │   └── types.cpp
    │   ├── util/
    │   │   └── matching.cpp
    │   ├── value.cpp
    │   └── var.cpp
    ├── core/
    │   ├── arguments.codon
    │   ├── arithmetic.codon
    │   ├── bltin.codon
    │   ├── containers.codon
    │   ├── empty.codon
    │   ├── exceptions.codon
    │   ├── generators.codon
    │   ├── generics.codon
    │   ├── helloworld.codon
    │   ├── match.codon
    │   ├── numerics.codon
    │   ├── parser.codon
    │   ├── pipeline.codon
    │   ├── range.codon
    │   ├── serialization.codon
    │   ├── sort.codon
    │   ├── trees.codon
    │   └── vec_simd.codon
    ├── main.cpp
    ├── numpy/
    │   ├── data/
    │   │   └── .gitignore
    │   ├── random_tests/
    │   │   ├── test_mt19937.codon
    │   │   ├── test_pcg64.codon
    │   │   ├── test_philox.codon
    │   │   └── test_sfc64.codon
    │   ├── test_dtype.codon
    │   ├── test_elision.codon
    │   ├── test_fft.codon
    │   ├── test_functional.codon
    │   ├── test_fusion.codon
    │   ├── test_indexing.codon
    │   ├── test_io.codon
    │   ├── test_lib.codon
    │   ├── test_linalg.codon
    │   ├── test_loops.codon
    │   ├── test_misc.codon
    │   ├── test_ndmath.codon
    │   ├── test_npdatetime.codon
    │   ├── test_pybridge.codon
    │   ├── test_reductions.codon
    │   ├── test_routines.codon
    │   ├── test_sorting.codon
    │   ├── test_statistics.codon
    │   ├── test_ufunc.codon
    │   └── test_window.codon
    ├── parser/
    │   ├── llvm.codon
    │   ├── simplify_expr.codon
    │   ├── simplify_stmt.codon
    │   ├── typecheck/
    │   │   ├── a/
    │   │   │   ├── __init__.codon
    │   │   │   ├── b/
    │   │   │   │   ├── __init__.codon
    │   │   │   │   ├── rec1.codon
    │   │   │   │   ├── rec1_err.codon
    │   │   │   │   ├── rec2.codon
    │   │   │   │   └── rec2_err.codon
    │   │   │   └── sub/
    │   │   │       └── __init__.codon
    │   │   ├── test_access.codon
    │   │   ├── test_assign.codon
    │   │   ├── test_basic.codon
    │   │   ├── test_call.codon
    │   │   ├── test_class.codon
    │   │   ├── test_collections.codon
    │   │   ├── test_cond.codon
    │   │   ├── test_ctx.codon
    │   │   ├── test_error.codon
    │   │   ├── test_function.codon
    │   │   ├── test_import.codon
    │   │   ├── test_infer.codon
    │   │   ├── test_loops.codon
    │   │   ├── test_op.codon
    │   │   ├── test_parser.codon
    │   │   ├── test_python.codon
    │   │   └── test_typecheck.codon
    │   ├── typecheck_expr.codon
    │   ├── typecheck_stmt.codon
    │   └── types.codon
    ├── python/
    │   ├── __init__.py
    │   ├── cython_jit.py
    │   ├── find-python-library.py
    │   ├── myextension.codon
    │   ├── myextension2.codon
    │   ├── mymodule.py
    │   ├── pybridge.codon
    │   ├── pyext.py
    │   └── setup.py
    ├── stdlib/
    │   ├── asyncio_test.codon
    │   ├── bisect_test.codon
    │   ├── cmath_test.codon
    │   ├── cmath_testcases.txt
    │   ├── datetime_test.codon
    │   ├── heapq_test.codon
    │   ├── itertools_test.codon
    │   ├── llvm_test.codon
    │   ├── math_test.codon
    │   ├── operator_test.codon
    │   ├── random_test.codon
    │   ├── re_test.codon
    │   ├── sort_test.codon
    │   ├── statistics_test.codon
    │   └── str_test.codon
    ├── transform/
    │   ├── canonical.codon
    │   ├── dict_opt.codon
    │   ├── escapes.codon
    │   ├── folding.codon
    │   ├── for_lowering.codon
    │   ├── inlining.codon
    │   ├── io_opt.codon
    │   ├── kernels.codon
    │   ├── list_opt.codon
    │   ├── omp.codon
    │   ├── outlining.codon
    │   └── str_opt.codon
    └── types.cpp
Download .txt
SYMBOL INDEX (2352 symbols across 274 files)

FILE: bench/codon/binary_trees.cpp
  type Node (line 8) | struct Node {
  function make_tree (line 13) | inline std::unique_ptr<Node> make_tree(int d) {
  function check_tree (line 21) | inline int check_tree(const std::unique_ptr<Node> &node) {
  function make_check (line 28) | inline int make_check(const std::pair<int, int> &itde) {
  type ArgChunks (line 34) | struct ArgChunks {
    method ArgChunks (line 38) | ArgChunks(int i, int d, int chunksize = 5000)
    method next (line 43) | bool next() {
  function main (line 54) | int main(int argc, char *argv[]) {

FILE: bench/codon/binary_trees.py
  class Node (line 12) | class Node:
    method __init__ (line 13) | def __init__(self, left = None, right = None):
  function make_tree (line 17) | def make_tree(d):
  function check_tree (line 20) | def check_tree(node):
  function make_check (line 27) | def make_check(itde, make=make_tree, check=check_tree):
  function get_argchunks (line 31) | def get_argchunks(i, d, chunksize=5000):
  function main (line 42) | def main(n, min_depth=4):

FILE: bench/codon/chaos.py
  class GVector (line 19) | class GVector(object):
    method __init__ (line 21) | def __init__(self, x=0, y=0, z=0):
    method Mag (line 26) | def Mag(self):
    method dist (line 29) | def dist(self, other):
    method __add__ (line 34) | def __add__(self, other):
    method __sub__ (line 40) | def __sub__(self, other):
    method __mul__ (line 43) | def __mul__(self, other):
    method linear_combination (line 48) | def linear_combination(self, other, l1, l2=None):
    method __str__ (line 56) | def __str__(self):
    method __repr__ (line 59) | def __repr__(self):
  class Spline (line 63) | class Spline(object):
    method __init__ (line 66) | def __init__(self, points, degree, knots):
    method GetDomain (line 83) | def GetDomain(self):
    method __call__ (line 88) | def __call__(self, u):
    method GetIndex (line 111) | def GetIndex(self, u):
    method __len__ (line 121) | def __len__(self):
    method __repr__ (line 124) | def __repr__(self):
  function write_ppm (line 128) | def write_ppm(im, filename):
  class Chaosgame (line 144) | class Chaosgame(object):
    method __init__ (line 146) | def __init__(self, splines, thickness=0.1):
    method get_random_trafo (line 168) | def get_random_trafo(self):
    method transform_point (line 177) | def transform_point(self, point, trafo=None):
    method truncate (line 203) | def truncate(self, point):
    method create_image_chaos (line 213) | def create_image_chaos(self, w, h, iterations, filename, rng_seed):
  function main (line 237) | def main():

FILE: bench/codon/fannkuch.py
  function perm (line 6) | def perm(n, i):

FILE: bench/codon/float.py
  class Point (line 7) | class Point:
    method __init__ (line 12) | def __init__(self, i):
    method __repr__ (line 17) | def __repr__(self):
    method normalize (line 20) | def normalize(self):
    method maximize (line 29) | def maximize(self, other):
  function maximize (line 36) | def maximize(points):
  function benchmark (line 43) | def benchmark(n):

FILE: bench/codon/go.py
  function to_pos (line 19) | def to_pos(x, y):
  function to_xy (line 23) | def to_xy(pos):
  class Square (line 28) | class Square:
    method __init__ (line 30) | def __init__(self, board, pos):
    method set_neighbours (line 38) | def set_neighbours(self):
    method move (line 46) | def move(self, color):
    method remove (line 72) | def remove(self, reference, update=True):
    method find (line 91) | def find(self, update=False):
    method __repr__ (line 99) | def __repr__(self):
  class EmptySet (line 103) | class EmptySet:
    method __init__ (line 105) | def __init__(self, board):
    method random_choice (line 110) | def random_choice(self):
    method add (line 122) | def add(self, pos):
    method remove (line 126) | def remove(self, pos):
    method set (line 130) | def set(self, i, pos):
  class ZobristHash (line 135) | class ZobristHash:
    method __init__ (line 137) | def __init__(self, board):
    method update (line 146) | def update(self, square, color):
    method add (line 150) | def add(self):
    method dupe (line 153) | def dupe(self):
  class Board (line 157) | class Board:
    method __init__ (line 159) | def __init__(self):
    method reset (line 165) | def reset(self):
    method move (line 178) | def move(self, pos):
    method random_move (line 192) | def random_move(self):
    method useful_fast (line 195) | def useful_fast(self, square):
    method useful (line 202) | def useful(self, pos):
    method useful_moves (line 238) | def useful_moves(self):
    method replay (line 241) | def replay(self, history):
    method score (line 245) | def score(self, color):
    method check (line 263) | def check(self):
    method __repr__ (line 308) | def __repr__(self):
  class UCTNode (line 317) | class UCTNode:
    method __init__ (line 319) | def __init__(self):
    method play (line 327) | def play(self, board):
    method select (line 350) | def select(self, board):
    method random_playout (line 363) | def random_playout(self, board):
    method update_path (line 370) | def update_path(self, board, color, path):
    method score (line 385) | def score(self):
    method best_child (line 393) | def best_child(self):
    method best_visited (line 402) | def best_visited(self):
  function computer_move (line 431) | def computer_move(board):
  function versus_cpu (line 446) | def versus_cpu():

FILE: bench/codon/mandelbrot.py
  function scale (line 6) | def scale(x, a, b):

FILE: bench/codon/nbody.cpp
  type Body (line 15) | struct Body {
  function values (line 45) | auto values(std::unordered_map<K, V> &m) {
  function combinations (line 53) | auto combinations(const std::vector<T> &v) {
  function advance (line 66) | void advance(double dt, int n, std::vector<Body *> &bodies = SYSTEM,
  function report_energy (line 98) | void report_energy(std::vector<Body *> &bodies = SYSTEM,
  function offset_momentum (line 121) | void offset_momentum(Body &ref, std::vector<Body *> &bodies = SYSTEM, do...
  function main (line 140) | int main(int argc, char *argv[]) {

FILE: bench/codon/nbody.py
  function combinations (line 13) | def combinations(l):
  function advance (line 65) | def advance(dt, n, bodies=SYSTEM, pairs=PAIRS):
  function report_energy (line 88) | def report_energy(bodies=SYSTEM, pairs=PAIRS, e=0.0):
  function offset_momentum (line 100) | def offset_momentum(ref, bodies=SYSTEM, px=0.0, py=0.0, pz=0.0):
  function main (line 111) | def main(n, ref='sun'):

FILE: bench/codon/primes.py
  function is_prime (line 4) | def is_prime(n):

FILE: bench/codon/set_partition.cpp
  function range (line 9) | inline vec<int> range(int start, int stop) {
  function conforms (line 17) | inline bool conforms(const vec<vec<int>> &candidate, int minsize, int fo...
  function partition_filtered (line 27) | inline void partition_filtered(const vec<int> &collection,
  function main (line 74) | int main(int argc, char *argv[]) {

FILE: bench/codon/set_partition.py
  function conforms (line 5) | def conforms(candidate, minsize, forgive):
  function partition_filtered (line 19) | def partition_filtered(collection, minsize=1, forgive=0):

FILE: bench/codon/spectral_norm.py
  function eval_A (line 20) | def eval_A(i, j):
  function eval_times_u (line 23) | def eval_times_u(func, u):
  function part_At_times_u (line 26) | def part_At_times_u(i_u):
  function part_A_times_u (line 33) | def part_A_times_u(i_u):
  function eval_AtA_times_u (line 40) | def eval_AtA_times_u(u):
  function bench_spectral_norm (line 43) | def bench_spectral_norm(loops):

FILE: bench/codon/taq.cpp
  function mean (line 13) | double mean(It begin, It end) {
  function stdev (line 19) | double stdev(It begin, It end) {
  function find_peaks (line 28) | std::vector<int> find_peaks(const std::vector<double> &y) {
  function process_data (line 64) | std::pair<std::vector<double>, std::vector<int>>
  function main (line 90) | int main(int argc, char *argv[]) {

FILE: bench/codon/taq.py
  function find_peaks (line 7) | def find_peaks(y):
  function process_data (line 37) | def process_data(series):

FILE: bench/codon/word_count.cpp
  function main (line 10) | int main(int argc, char *argv[]) {

FILE: codon/app/main.cpp
  function versMsg (line 25) | void versMsg(llvm::raw_ostream &out) {
  function isMacOS (line 30) | bool isMacOS() {
  function hasExtension (line 43) | bool hasExtension(const std::string &filename, const std::string &extens...
  function trimExtension (line 49) | std::string trimExtension(const std::string &filename, const std::string...
  function makeOutputFilename (line 57) | std::string makeOutputFilename(const std::string &filename,
  function display (line 66) | void display(const codon::error::ParserErrorInfo &e) {
  function initLogFlags (line 93) | void initLogFlags(const llvm::cl::opt<std::string> &log) {
  type BuildKind (line 99) | enum BuildKind {
  type OptMode (line 110) | enum OptMode { Debug, Release }
  type Numerics (line 111) | enum Numerics { C, Python }
  function docMode (line 114) | int docMode(const std::vector<const char *> &args, const std::string &ar...
  function processSource (line 161) | std::unique_ptr<codon::Compiler> processSource(
  function runMode (line 254) | int runMode(const std::vector<const char *> &args) {
  function jitExec (line 270) | std::string jitExec(codon::jit::JIT *jit, const std::string &code) {
  function jitLoop (line 290) | void jitLoop(codon::jit::JIT *jit, std::istream &fp) {
  function jitMode (line 306) | int jitMode(const std::vector<const char *> &args) {
  function buildMode (line 342) | int buildMode(const std::vector<const char *> &args, const std::string &...
  function jupyterMode (line 451) | int jupyterMode(const std::vector<const char *> &args) {
  function showCommandsAndExit (line 462) | void showCommandsAndExit() {
  function otherMode (line 466) | int otherMode(const std::vector<const char *> &args) {
  function main (line 479) | int main(int argc, const char **argv) {

FILE: codon/cir/analyze/analysis.cpp
  type codon (line 7) | namespace codon {
    type ir (line 8) | namespace ir {
      type analyze (line 9) | namespace analyze {
        function Result (line 11) | Result *Analysis::doGetAnalysis(const std::string &key) {

FILE: codon/cir/analyze/analysis.h
  function namespace (line 10) | namespace codon {

FILE: codon/cir/analyze/dataflow/capture.cpp
  type codon (line 13) | namespace codon {
    type ir (line 14) | namespace ir {
      type analyze (line 15) | namespace analyze {
        type dataflow (line 16) | namespace dataflow {
          function contains (line 19) | bool contains(const S &x, T i) {
          function containsId (line 27) | bool containsId(const S &x, T i) {
          function shouldTrack (line 35) | bool shouldTrack(const T *x) {
          function shouldTrack (line 42) | bool shouldTrack(const types::Type *x) { return x && !x->isAtomi...
          type CaptureContext (line 44) | struct CaptureContext
            method CaptureContext (line 276) | CaptureContext(RDResult *reaching, DominatorResult *dominating)
            method CFGraph (line 282) | CFGraph *getCFGraph(const Func *func) {
            method RDInspector (line 289) | RDInspector *getRDInspector(const Func *func) {
            method DominatorInspector (line 296) | DominatorInspector *getDomInspector(const Func *func) {
          function reachable (line 48) | bool reachable(CFBlock *start, CFBlock *end, std::unordered_set<...
          function happensBefore (line 68) | bool happensBefore(const Value *before, const Value *after, CFGr...
          type RDManager (line 96) | struct RDManager {
            type IDPairHash (line 97) | struct IDPairHash {
            method RDManager (line 107) | explicit RDManager(RDInspector *rd) : rd(rd), cache() {}
            method getReachingDefinitions (line 109) | std::unordered_set<id_t> getReachingDefinitions(const Var *var...
            method isInvalid (line 125) | bool isInvalid(const Var *v) { return rd->isInvalid(v); }
          type DerivedSet (line 128) | struct DerivedSet {
            method setReturnCaptured (line 136) | void setReturnCaptured() {
            method setExternCaptured (line 141) | void setExternCaptured() {
            method isDerived (line 146) | bool isDerived(const Var *v, const Value *loc, RDManager &rd) ...
            method isDerived (line 173) | bool isDerived(const Value *v) const {
            method setDerived (line 177) | void setDerived(const Var *v, const Value *cause, bool shouldA...
            method setDerived (line 202) | void setDerived(const Value *v) {
            method size (line 209) | unsigned size() const {
            method DerivedSet (line 217) | explicit DerivedSet(const Func *func, const Var *root = nullptr)
            method DerivedSet (line 221) | DerivedSet(const Func *func, const Var *root, const Value *cause)
            method DerivedSet (line 232) | DerivedSet(const Func *func, const Value *value, CaptureContex...
          function noCaptureByAnnotation (line 246) | bool noCaptureByAnnotation(const Func *func) {
          function makeAllCaptureInfo (line 252) | std::vector<CaptureInfo> makeAllCaptureInfo(const Func *func) {
          function makeNoCaptureInfo (line 260) | std::vector<CaptureInfo> makeNoCaptureInfo(const Func *func, boo...
          type CaptureContext (line 271) | struct CaptureContext {
            method CaptureContext (line 276) | CaptureContext(RDResult *reaching, DominatorResult *dominating)
            method CFGraph (line 282) | CFGraph *getCFGraph(const Func *func) {
            method RDInspector (line 289) | RDInspector *getRDInspector(const Func *func) {
            method DominatorInspector (line 296) | DominatorInspector *getDomInspector(const Func *func) {
          type ExtractVars (line 309) | struct ExtractVars : public util::ConstVisitor {
            method ExtractVars (line 314) | explicit ExtractVars(CaptureContext &cc)
            method process (line 317) | void process(const Node *v) { v->accept(*this); }
            method add (line 319) | void add(const Var *v) {
            method defaultVisit (line 324) | void defaultVisit(const Node *) override {}
            method visit (line 326) | void visit(const VarValue *v) override { add(v->getVar()); }
            method visit (line 328) | void visit(const PointerValue *v) override { add(v->getVar()); }
            method visit (line 330) | void visit(const CallInstr *v) override {
            method visit (line 350) | void visit(const YieldInInstr *v) override {
            method visit (line 357) | void visit(const TernaryInstr *v) override {
            method visit (line 362) | void visit(const ExtractInstr *v) override { process(v->getVal...
            method visit (line 364) | void visit(const FlowInstr *v) override { process(v->getValue(...
            method visit (line 366) | void visit(const dsl::CustomInstr *v) override {
          function extractVars (line 371) | bool extractVars(CaptureContext &cc, const Value *v, std::vector...
          type CaptureTracker (line 381) | struct CaptureTracker : public util::Operator {
            method CaptureTracker (line 388) | CaptureTracker(CaptureContext &cc, const Func *func, bool isArg)
            method CaptureTracker (line 392) | CaptureTracker(CaptureContext &cc, const BodiedFunc *func)
            method CaptureTracker (line 423) | CaptureTracker(CaptureContext &cc, const BodiedFunc *func, con...
            method size (line 428) | unsigned size() const {
            method forEachDSetOf (line 436) | void forEachDSetOf(Value *v, std::function<void(DerivedSet &)>...
            method forEachDSetOf (line 446) | void forEachDSetOf(Var *v, Value *loc, std::function<void(Deri...
            method forwardLink (line 456) | void forwardLink(Value *from, Value *cause, const std::vector<...
            method backwardLinkFunc (line 468) | void backwardLinkFunc(DerivedSet &dset, Value *cause,
            method link (line 508) | void link(Value *from, Value *to, Value *cause) {
            method link (line 519) | void link(Value *from, Var *to, Value *cause) {
            method handle (line 530) | void handle(VarValue *v) override {
            method handle (line 534) | void handle(PointerValue *v) override {
            method handle (line 538) | void handle(AssignInstr *v) override { link(v->getRhs(), v->ge...
            method handle (line 540) | void handle(ExtractInstr *v) override {
            method handle (line 547) | void handle(InsertInstr *v) override {
            method handle (line 552) | void handle(CallInstr *v) override {
            method handle (line 607) | void handle(ForFlow *v) override {
            method handle (line 627) | void handle(TernaryInstr *v) override {
            method handle (line 632) | void handle(FlowInstr *v) override {
            method handle (line 636) | void handle(dsl::CustomInstr *v) override {
            method handle (line 642) | void handle(ReturnInstr *v) override {
            method handle (line 647) | void handle(YieldInstr *v) override {
            method handle (line 652) | void handle(AwaitInstr *v) override {
            method handle (line 657) | void handle(ThrowInstr *v) override {
            method runToCompletion (line 663) | void runToCompletion(const Func *func) {
          function CaptureInfo (line 742) | CaptureInfo CaptureInfo::unknown(const Func *func, types::Type *...
          function CaptureInfo (line 784) | CaptureInfo escapes(const BodiedFunc *func, const Value *value, ...

FILE: codon/cir/analyze/dataflow/capture.h
  function namespace (line 14) | namespace codon {

FILE: codon/cir/analyze/dataflow/cfg.cpp
  type codon (line 10) | namespace codon {
    type ir (line 11) | namespace ir {
      type analyze (line 12) | namespace analyze {
        type dataflow (line 13) | namespace dataflow {
          function Value (line 16) | Value *callStage(analyze::dataflow::CFGraph *cfg, PipelineFlow::...
          function Value (line 25) | Value *convertPipelineToForLoopsHelper(analyze::dataflow::CFGrap...
          function Value (line 50) | const Value *convertPipelineToForLoops(analyze::dataflow::CFGrap...
          function buildCFGraph (line 128) | std::unique_ptr<CFGraph> buildCFGraph(const BodiedFunc *f) {

FILE: codon/cir/analyze/dataflow/cfg.h
  function namespace (line 18) | namespace codon {
  function class (line 312) | class CFGraph {
  function Result (line 452) | struct CFResult : public Result {
  function class (line 458) | class CFAnalysis : public Analysis {
  function class (line 466) | class CFVisitor : public util::ConstVisitor {
  function ostream_formatter (line 550) | struct fmt::formatter<codon::ir::analyze::dataflow::CFGraph> : fmt::ostr...

FILE: codon/cir/analyze/dataflow/dominator.cpp
  type codon (line 7) | namespace codon {
    type ir (line 8) | namespace ir {
      type analyze (line 9) | namespace analyze {
        type dataflow (line 10) | namespace dataflow {

FILE: codon/cir/analyze/dataflow/dominator.h
  function namespace (line 12) | namespace codon {

FILE: codon/cir/analyze/dataflow/reaching.cpp
  type codon (line 8) | namespace codon {
    type ir (line 9) | namespace ir {
      type analyze (line 10) | namespace analyze {
        type dataflow (line 11) | namespace dataflow {
          function id_t (line 14) | id_t getKilled(const Value *val) {
          function getGenerated (line 23) | std::pair<id_t, ReachingDef> getGenerated(const Value *val) {
          type WorkList (line 37) | struct WorkList {
            method push (line 41) | void push(T *a) {
            method T (line 49) | T *pop() {
            method WorkList (line 58) | WorkList(S *x) : have(), queue() {
          type BitSet (line 65) | struct BitSet {
            method allocSize (line 67) | static unsigned allocSize(unsigned size) { return (size + B - ...
            method BitSet (line 71) | explicit BitSet(unsigned size) : words(allocSize(size), 0) {}
            method BitSet (line 73) | BitSet copy(unsigned size) const {
            method set (line 79) | void set(unsigned bit) { words.data()[bit / B] |= (1UL << (bit...
            method get (line 81) | bool get(unsigned bit) const {
            method equals (line 85) | bool equals(const BitSet &other, unsigned size) {
            method clear (line 90) | void clear(unsigned size) { std::memset(words.data(), 0, alloc...
            method setAll (line 92) | void setAll(unsigned size) {
            method overwrite (line 96) | void overwrite(const BitSet &other, unsigned size) {
            method update (line 100) | void update(const BitSet &other, unsigned size) {
            method subtract (line 109) | void subtract(const BitSet &other, unsigned size) {
          type BlockBitSets (line 119) | struct BlockBitSets {
            method BlockBitSets (line 126) | BlockBitSets(T *blk, BitSet gen, BitSet kill, BitSet in, BitSe...

FILE: codon/cir/analyze/dataflow/reaching.h
  function namespace (line 10) | namespace codon {
  function namespace (line 47) | namespace std {
  function namespace (line 56) | namespace codon {

FILE: codon/cir/analyze/module/global_vars.cpp
  type codon (line 7) | namespace codon {
    type ir (line 8) | namespace ir {
      type analyze (line 9) | namespace analyze {
        type module (line 10) | namespace module {
          type GlobalVarAnalyzer (line 12) | struct GlobalVarAnalyzer : public util::Operator {
            method handle (line 15) | void handle(PointerValue *v) override {
            method handle (line 20) | void handle(AssignInstr *v) override {

FILE: codon/cir/analyze/module/global_vars.h
  function namespace (line 9) | namespace codon {

FILE: codon/cir/analyze/module/side_effect.cpp
  type codon (line 12) | namespace codon {
    type ir (line 13) | namespace ir {
      type analyze (line 14) | namespace analyze {
        type module (line 15) | namespace module {
          function T (line 17) | T max(T &&t) { return std::forward<T>(t); }
          function max (line 20) | typename std::common_type<T0, T1, Ts...>::type max(T0 &&val1, T1...
          type VarUseAnalyzer (line 25) | struct VarUseAnalyzer : public util::Operator {
            method preHook (line 29) | void preHook(Node *v) override {
            method handle (line 35) | void handle(AssignInstr *v) override { ++varAssignCounts[v->ge...
          type SideEfectAnalyzer (line 38) | struct SideEfectAnalyzer : public util::ConstVisitor {
            method Status (line 41) | static Status getFunctionStatusFromAttributes(const Func *v, b...
            method SideEfectAnalyzer (line 85) | SideEfectAnalyzer(VarUseAnalyzer &vua, dataflow::CaptureResult...
            method has (line 91) | bool has(const T *v) {
            method set (line 95) | void set(const T *v, Status expr, Status func = Status::PURE) {
            method Status (line 100) | Status process(const T *v) {
            method getVarAssignStatus (line 110) | std::pair<Status, Status> getVarAssignStatus(const Var *var) {
            method handleVarAssign (line 132) | void handleVarAssign(const Value *v, const Var *var, Status ba...
            method visit (line 137) | void visit(const Module *v) override {
            method visit (line 144) | void visit(const Var *v) override { set(v, Status::PURE); }
            method visit (line 146) | void visit(const BodiedFunc *v) override {
            method visit (line 161) | void visit(const ExternalFunc *v) override {
            method visit (line 165) | void visit(const InternalFunc *v) override { set(v, Status::PU...
            method visit (line 167) | void visit(const LLVMFunc *v) override { set(v, getFunctionSta...
            method visit (line 169) | void visit(const VarValue *v) override { set(v, Status::PURE); }
            method visit (line 171) | void visit(const PointerValue *v) override { set(v, Status::PU...
            method visit (line 173) | void visit(const SeriesFlow *v) override {
            method visit (line 181) | void visit(const IfFlow *v) override {
            method visit (line 186) | void visit(const WhileFlow *v) override {
            method visit (line 190) | void visit(const ForFlow *v) override {
            method visit (line 200) | void visit(const ImperativeForFlow *v) override {
            method visit (line 210) | void visit(const TryCatchFlow *v) override {
            method visit (line 224) | void visit(const PipelineFlow *v) override {
            method visit (line 247) | void visit(const dsl::CustomFlow *v) override {
            method visit (line 252) | void visit(const IntConst *v) override { set(v, Status::PURE); }
            method visit (line 254) | void visit(const FloatConst *v) override { set(v, Status::PURE...
            method visit (line 256) | void visit(const BoolConst *v) override { set(v, Status::PURE); }
            method visit (line 258) | void visit(const StringConst *v) override { set(v, Status::PUR...
            method visit (line 260) | void visit(const dsl::CustomConst *v) override { set(v, Status...
            method visit (line 262) | void visit(const AssignInstr *v) override {
            method visit (line 266) | void visit(const ExtractInstr *v) override { set(v, process(v-...
            method visit (line 268) | void visit(const InsertInstr *v) override {
            method visit (line 296) | void visit(const CallInstr *v) override {
            method visit (line 312) | void visit(const StackAllocInstr *v) override { set(v, Status:...
            method visit (line 314) | void visit(const TypePropertyInstr *v) override { set(v, Statu...
            method visit (line 316) | void visit(const YieldInInstr *v) override { set(v, Status::NO...
            method visit (line 318) | void visit(const TernaryInstr *v) override {
            method visit (line 323) | void visit(const BreakInstr *v) override { set(v, Status::NO_C...
            method visit (line 325) | void visit(const ContinueInstr *v) override { set(v, Status::N...
            method visit (line 327) | void visit(const ReturnInstr *v) override {
            method visit (line 331) | void visit(const YieldInstr *v) override {
            method visit (line 335) | void visit(const AwaitInstr *v) override {
            method visit (line 339) | void visit(const ThrowInstr *v) override {
            method visit (line 344) | void visit(const FlowInstr *v) override {
            method visit (line 348) | void visit(const dsl::CustomInstr *v) override {

FILE: codon/cir/analyze/module/side_effect.h
  function namespace (line 10) | namespace codon {

FILE: codon/cir/attribute.cpp
  type codon (line 10) | namespace codon {
    type ir (line 11) | namespace ir {
    function clone (line 199) | std::unordered_map<int, std::unique_ptr<ir::Attribute>>

FILE: codon/cir/attribute.h
  function namespace (line 14) | namespace codon {
  function ostream_formatter (line 356) | struct fmt::formatter<codon::ir::Attribute> : fmt::ostream_formatter {}

FILE: codon/cir/base.cpp
  type codon (line 10) | namespace codon {
    type ir (line 11) | namespace ir {

FILE: codon/cir/base.h
  function namespace (line 18) | namespace codon {
  function virtual (line 228) | virtual int replaceUsedType(const std::string &name, types::Type *newTyp...
  function virtual (line 238) | virtual std::vector<Var *> getUsedVariables() { return {}; }
  function virtual (line 240) | virtual std::vector<const Var *> getUsedVariables() const { return {}; }
  function Node (line 257) | const Node *getActual() const {
  function virtual (line 271) | virtual bool isConvertible(const void *other) const override {
  function accept (line 278) | void accept(util::Visitor &v) override {
  function accept (line 285) | void accept(util::ConstVisitor &v) const override {
  function Derived (line 305) | Derived *getActual() {
  function Derived (line 311) | const Derived *getActual() const {
  function replaceAll (line 319) | void replaceAll(Derived *v) {
  function ostream_formatter (line 352) | struct fmt::formatter<codon::ir::Node> : fmt::ostream_formatter {}

FILE: codon/cir/const.cpp
  type codon (line 5) | namespace codon {
    type ir (line 6) | namespace ir {

FILE: codon/cir/const.h
  function namespace (line 8) | namespace codon {

FILE: codon/cir/dsl/codegen.h
  function namespace (line 10) | namespace codon {

FILE: codon/cir/dsl/nodes.cpp
  type codon (line 5) | namespace codon {
    type ir (line 6) | namespace ir {
      type dsl (line 7) | namespace dsl {
        type types (line 9) | namespace types {

FILE: codon/cir/dsl/nodes.h
  function namespace (line 15) | namespace util {
  function namespace (line 21) | namespace codegen {
  function namespace (line 27) | namespace types {

FILE: codon/cir/flow.cpp
  type codon (line 9) | namespace codon {
    type ir (line 10) | namespace ir {
      function findAndReplace (line 12) | int findAndReplace(id_t id, codon::ir::Value *newVal,

FILE: codon/cir/flow.h
  function namespace (line 13) | namespace codon {
  function Value (line 238) | Value *getStart() const { return start; }
  function setStart (line 241) | void setStart(Value *val) { start = val; }
  function setStep (line 247) | void setStep(int64_t val) { step = val; }
  function Value (line 250) | Value *getEnd() const { return end; }
  function setEnd (line 253) | void setEnd(Value *val) { end = val; }
  function Flow (line 256) | Flow *getBody() { return cast<Flow>(body); }
  function Flow (line 258) | const Flow *getBody() const { return cast<Flow>(body); }
  function setBody (line 261) | void setBody(Flow *f) { body = f; }
  function Var (line 264) | Var *getVar() { return var; }
  function Var (line 266) | const Var *getVar() const { return var; }
  function setVar (line 269) | void setVar(Var *c) { var = c; }
  function transform (line 285) | const transform::parallel::OMPSched *getSchedule() const { return schedu...
  function setSchedule (line 288) | void setSchedule(std::unique_ptr<transform::parallel::OMPSched> s) {
  function override (line 296) | const override { return {var}; }
  function Flow (line 324) | Flow *getTrueBranch() { return cast<Flow>(trueBranch); }
  function Flow (line 326) | const Flow *getTrueBranch() const { return cast<Flow>(trueBranch); }
  function setTrueBranch (line 329) | void setTrueBranch(Flow *f) { trueBranch = f; }
  function Flow (line 332) | Flow *getFalseBranch() { return cast<Flow>(falseBranch); }
  function Flow (line 334) | const Flow *getFalseBranch() const { return cast<Flow>(falseBranch); }
  function setFalseBranch (line 337) | void setFalseBranch(Flow *f) { falseBranch = f; }
  function Value (line 340) | Value *getCond() { return cond; }
  function Value (line 342) | const Value *getCond() const { return cond; }
  function setCond (line 345) | void setCond(Value *c) { cond = c; }
  function Flow (line 372) | const Flow *getHandler() const { return cast<Flow>(handler); }
  function setHandler (line 375) | void setHandler(Flow *h) { handler = h; }
  function setType (line 381) | void setType(types::Type *t) { type = t; }
  function Var (line 384) | Var *getVar() { return catchVar; }
  function Var (line 386) | const Var *getVar() const { return catchVar; }
  function setVar (line 389) | void setVar(Var *v) { catchVar = v; }
  function Flow (line 417) | const Flow *getBody() const { return cast<Flow>(body); }
  function setBody (line 420) | void setBody(Flow *f) { body = f; }
  function Flow (line 423) | Flow *getElse() { return cast<Flow>(else_); }
  function Flow (line 425) | const Flow *getElse() const { return cast<Flow>(else_); }
  function setElse (line 428) | void setElse(Flow *f) { else_ = f; }
  function Flow (line 431) | Flow *getFinally() { return cast<Flow>(finally); }
  function Flow (line 433) | const Flow *getFinally() const { return cast<Flow>(finally); }
  function setFinally (line 436) | void setFinally(Flow *f) { finally = f; }
  function push_back (line 464) | void push_back(Catch v) { catches.push_back(v); }
  function Value (line 529) | Value *front() { return args.front(); }
  function Value (line 531) | Value *back() { return args.back(); }
  function Value (line 533) | const Value *front() const { return args.front(); }
  function Value (line 535) | const Value *back() const { return args.back(); }
  function push_back (line 544) | void push_back(Value *v) { args.push_back(v); }
  function setCallee (line 553) | void setCallee(Value *c) { callee = c; }
  function Value (line 555) | Value *getCallee() { return callee; }
  function Value (line 557) | const Value *getCallee() const { return callee; }
  function push_back (line 615) | void push_back(Stage v) { stages.push_back(std::move(v)); }

FILE: codon/cir/func.cpp
  type codon (line 14) | namespace codon {
    type ir (line 15) | namespace ir {
      function findAndReplace (line 17) | int findAndReplace(id_t id, codon::ir::Var *newVal,
      function Var (line 46) | Var *Func::getArgVar(const std::string &n) {

FILE: codon/cir/func.h
  function namespace (line 9) | namespace codon {
  function Var (line 119) | Var *front() { return symbols.front(); }
  function Var (line 121) | Var *back() { return symbols.back(); }
  function Var (line 123) | const Var *front() const { return symbols.front(); }
  function Var (line 125) | const Var *back() const { return symbols.back(); }
  function push_back (line 134) | void push_back(Var *v) { symbols.push_back(v); }
  function Flow (line 142) | Flow *getBody() { return cast<Flow>(body); }
  function Flow (line 144) | const Flow *getBody() const { return cast<Flow>(body); }
  function setBody (line 147) | void setBody(Flow *b) { body = b; }
  function override (line 156) | const override {
  function setLLVMLiterals (line 200) | void setLLVMLiterals(std::vector<types::Generic> v) { llvmLiterals = std...
  function setLLVMDeclarations (line 224) | void setLLVMDeclarations(std::string v) { llvmDeclares = std::move(v); }
  function setLLVMBody (line 229) | void setLLVMBody(std::string v) { llvmBody = std::move(v); }
  function ostream_formatter (line 233) | int doReplaceUsedType(const std::string &name, types::Type *newType) ove...

FILE: codon/cir/instr.cpp
  type codon (line 8) | namespace codon {
    type ir (line 9) | namespace ir {
      function findAndReplace (line 11) | int findAndReplace(id_t id, codon::ir::Value *newVal,

FILE: codon/cir/instr.h
  function namespace (line 14) | namespace codon {
  function Value (line 184) | Value *getCallee() { return callee; }
  function Value (line 186) | const Value *getCallee() const { return callee; }
  function setCallee (line 189) | void setCallee(Value *c) { callee = c; }
  function Value (line 201) | Value *front() { return args.front(); }
  function Value (line 203) | Value *back() { return args.back(); }
  function Value (line 205) | const Value *front() const { return args.front(); }
  function Value (line 207) | const Value *back() const { return args.back(); }
  function push_back (line 216) | void push_back(Value *v) { args.push_back(v); }
  function setArgs (line 220) | void setArgs(std::vector<Value *> v) { args = std::move(v); }
  function setCount (line 253) | void setCount(int64_t c) { count = c; }
  function setArrayType (line 261) | void setArrayType(types::Type *t) { arrayType = t; }
  function override (line 265) | const override { return {arrayType}; }
  type Property (line 272) | enum Property { IS_ATOMIC, IS_CONTENT_ATOMIC, SIZEOF }
  function setInspectType (line 296) | void setInspectType(types::Type *t) { inspectType = t; }
  function setProperty (line 302) | void setProperty(Property p) { property = p; }
  function setType (line 336) | void setType(types::Type *t) { type = t; }
  function Value (line 367) | Value *getCond() { return cond; }
  function Value (line 369) | const Value *getCond() const { return cond; }
  function setCond (line 372) | void setCond(Value *v) { cond = v; }
  function Value (line 375) | Value *getTrueValue() { return trueValue; }
  function Value (line 377) | const Value *getTrueValue() const { return trueValue; }
  function setTrueValue (line 380) | void setTrueValue(Value *v) { trueValue = v; }
  function Value (line 383) | Value *getFalseValue() { return falseValue; }
  function Value (line 385) | const Value *getFalseValue() const { return falseValue; }
  function setFalseValue (line 388) | void setFalseValue(Value *v) { falseValue = v; }
  function override (line 392) | const override {
  function setLoop (line 424) | void setLoop(Value *v) { loop = v; }
  function setLoop (line 449) | void setLoop(Value *v) { loop = v; }
  function Value (line 470) | const Value *getValue() const { return value; }
  function setValue (line 473) | void setValue(Value *v) { value = v; }
  function Value (line 497) | const Value *getValue() const { return value; }
  function setValue (line 500) | void setValue(Value *v) { value = v; }
  function Value (line 534) | const Value *getValue() const { return value; }
  function setValue (line 537) | void setValue(Value *v) { value = v; }
  function setType (line 541) | void setType(types::Type *t) { type = t; }
  function override (line 551) | const override { return {value}; }
  function Value (line 571) | const Value *getValue() const { return value; }
  function setValue (line 574) | void setValue(Value *v) { value = v; }
  function Flow (line 602) | const Flow *getFlow() const { return cast<Flow>(flow); }
  function setFlow (line 605) | void setFlow(Flow *f) { flow = f; }
  function Value (line 608) | Value *getValue() { return val; }
  function Value (line 610) | const Value *getValue() const { return val; }
  function setValue (line 613) | void setValue(Value *v) { val = v; }
  function override (line 617) | const override { return {flow, val}; }

FILE: codon/cir/llvm/gpu.cpp
  type codon (line 12) | namespace codon {
    type ir (line 13) | namespace ir {
      class GVExtractor (line 36) | class GVExtractor : public llvm::PassInfoMixin<GVExtractor> {
        method GVExtractor (line 45) | explicit GVExtractor(std::vector<llvm::GlobalValue *> &GVs, bool d...
        method makeVisible (line 54) | static void makeVisible(llvm::GlobalValue &GV, bool del) {
        method run (line 81) | llvm::PreservedAnalyses run(llvm::Module &M, llvm::ModuleAnalysisM...
      function cleanUpName (line 156) | std::string cleanUpName(llvm::StringRef name) {
      function linkLibdevice (line 176) | void linkLibdevice(llvm::Module *M, const std::string &path) {
      function codegenVectorizedUnaryLoop (line 222) | void codegenVectorizedUnaryLoop(llvm::IRBuilder<> &B,
      function codegenVectorizedBinaryLoop (line 283) | void codegenVectorizedBinaryLoop(llvm::IRBuilder<> &B,
      function remapFunctions (line 386) | void remapFunctions(llvm::Module *M) {
      function exploreGV (line 677) | void exploreGV(llvm::GlobalValue *G, llvm::SmallPtrSetImpl<llvm::Glo...
      function getRequiredGVs (line 692) | std::vector<llvm::GlobalValue *>
      function moduleToPTX (line 701) | std::string moduleToPTX(llvm::Module *M, std::vector<llvm::GlobalVal...
      function cleanUpIntrinsics (line 834) | void cleanUpIntrinsics(llvm::Module *M) {
      function patchPTXVar (line 850) | void patchPTXVar(llvm::Module *M, llvm::GlobalValue *ptxVar,
      function applyGPUTransformations (line 890) | void applyGPUTransformations(llvm::Module *M, const std::string &ptx...

FILE: codon/cir/llvm/gpu.h
  function namespace (line 9) | namespace codon {

FILE: codon/cir/llvm/llvisitor.cpp
  type codon (line 22) | namespace codon {
    type ir (line 23) | namespace ir {
      type GlobalCTORMode (line 36) | enum GlobalCTORMode { No, Yes, Auto }
      function executeCommand (line 431) | void executeCommand(const std::vector<std::string> &args) {
      function typeIdxLookup (line 1389) | int typeIdxLookup(types::Type *type) {
      function internalFuncMatchesIgnoreArgs (line 1728) | bool internalFuncMatchesIgnoreArgs(const std::string &name, const In...
      function internalFuncMatches (line 1733) | bool internalFuncMatches(const std::string &name, const InternalFunc...
      function internalFuncMatches (line 1747) | bool internalFuncMatches(const std::string &name, const InternalFunc...
      function anyMatch (line 2705) | bool anyMatch(types::Type *type, std::vector<types::Type *> types) {

FILE: codon/cir/llvm/llvisitor.h
  function namespace (line 16) | namespace codon {
  function insertVar (line 226) | void insertVar(const Var *var, llvm::Value *x) { vars.emplace(var->getId...
  function insertFunc (line 228) | void insertFunc(const Func *func, llvm::Function *x) {
  function std (line 240) | static std::string getDebugNameForVariable(const Var *x) {
  function SrcInfo (line 250) | static const SrcInfo *getDefaultSrcInfo() {
  function SrcInfo (line 255) | static const SrcInfo *getSrcInfo(const Node *x) {
  function setFlags (line 294) | void setFlags(const std::string &f) { db.flags = f; }
  function setFunc (line 309) | void setFunc(llvm::Function *f) { func = f; }
  function setBlock (line 310) | void setBlock(llvm::BasicBlock *b) { block = b; }
  function setValue (line 311) | void setValue(llvm::Value *v) { value = v; }
  function setPluginManager (line 412) | void setPluginManager(PluginManager *p) { plugins = p; }
  function PluginManager (line 414) | PluginManager *getPluginManager() { return plugins; }

FILE: codon/cir/llvm/native/native.cpp
  type codon (line 13) | namespace codon {
    type ir (line 14) | namespace ir {
      function getNativeTarget (line 16) | std::unique_ptr<Target> getNativeTarget(const llvm::Triple &triple) {
      class ArchNativePass (line 83) | class ArchNativePass : public llvm::PassInfoMixin<ArchNativePass> {
        method ArchNativePass (line 89) | explicit ArchNativePass(const std::string &cpu = "", const std::st...
        method run (line 92) | llvm::PreservedAnalyses run(llvm::Function &F, llvm::FunctionAnaly...
      function addNativeLLVMPasses (line 103) | void addNativeLLVMPasses(llvm::PassBuilder *pb) {

FILE: codon/cir/llvm/native/native.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/llvm/native/targets/aarch64.cpp
  type codon (line 7) | namespace codon {
    type ir (line 8) | namespace ir {
      function join (line 10) | std::string join(const T &v, const std::string &delim = ",") {

FILE: codon/cir/llvm/native/targets/aarch64.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/llvm/native/targets/arm.cpp
  type codon (line 7) | namespace codon {
    type ir (line 8) | namespace ir {
      function join (line 10) | std::string join(const T &v, const std::string &delim = ",") {
      function getARMSubArchVersionNumber (line 20) | int getARMSubArchVersionNumber(const llvm::Triple &triple) {
      function isARMMProfile (line 25) | bool isARMMProfile(const llvm::Triple &triple) {
      function isARMBigEndian (line 30) | bool isARMBigEndian(const llvm::Triple &triple) {
      function isARMAProfile (line 35) | bool isARMAProfile(const llvm::Triple &triple) {
      function isARMEABIBareMetal (line 40) | bool isARMEABIBareMetal(const llvm::Triple &triple) {
      function useAAPCSForMachO (line 59) | bool useAAPCSForMachO(const llvm::Triple &triple) {
      type FloatABI (line 65) | enum FloatABI { Invalid, Hard, Soft, SoftFP }
      function FloatABI (line 67) | FloatABI getDefaultFloatABI(const llvm::Triple &triple) {
      function FloatABI (line 140) | FloatABI getARMFloatABI(const llvm::Triple &triple) {
      function getLLVMArchKindForARM (line 153) | llvm::ARM::ArchKind getLLVMArchKindForARM(llvm::StringRef cpu, llvm:...
      function getLLVMArchSuffixForARM (line 159) | llvm::StringRef getLLVMArchSuffixForARM(llvm::StringRef cpu, llvm::S...
      function hasIntegerMVE (line 167) | bool hasIntegerMVE(const std::vector<llvm::StringRef> &F) {

FILE: codon/cir/llvm/native/targets/arm.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/llvm/native/targets/target.h
  function namespace (line 10) | namespace codon {

FILE: codon/cir/llvm/native/targets/x86.cpp
  type codon (line 5) | namespace codon {
    type ir (line 6) | namespace ir {
      function join (line 8) | std::string join(const T &v, const std::string &delim = ",") {

FILE: codon/cir/llvm/native/targets/x86.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/llvm/optimize.cpp
  type codon (line 15) | namespace codon {
    type ir (line 16) | namespace ir {
      function getTargetMachine (line 28) | std::unique_ptr<llvm::TargetMachine>
      function getTargetMachine (line 45) | std::unique_ptr<llvm::TargetMachine>
      function applyDebugTransformations (line 65) | void applyDebugTransformations(llvm::Module *module, bool debug, boo...
      function applyFastMathTransformations (line 93) | void applyFastMathTransformations(llvm::Module *module) {
      type AllocInfo (line 114) | struct AllocInfo {
        method AllocInfo (line 119) | AllocInfo(std::vector<std::string> allocators, const std::string &...
        method getFixedArg (line 123) | static bool getFixedArg(llvm::CallBase &cb, uint64_t &size, unsign...
        method isAlloc (line 135) | bool isAlloc(const llvm::Value *value) {
        method isRealloc (line 143) | bool isRealloc(const llvm::Value *value) {
        method isFree (line 151) | bool isFree(const llvm::Value *value) {
        method isNeverEqualToUnescapedAlloc (line 172) | bool isNeverEqualToUnescapedAlloc(llvm::Value *value, llvm::Instru...
        method isAllocSiteRemovable (line 183) | bool isAllocSiteRemovable(llvm::Instruction *ai,
        method isAllocSiteDemotable (line 281) | bool isAllocSiteDemotable(llvm::Instruction *ai, uint64_t &size,
        method isAllocSiteHoistable (line 398) | bool isAllocSiteHoistable(llvm::Instruction *ai, llvm::Loop &loop,
      type AllocationRemover (line 576) | struct AllocationRemover : public llvm::PassInfoMixin<AllocationRemo...
        method AllocationRemover (line 579) | explicit AllocationRemover(
        method getErasesAndReplacementsForAlloc (line 586) | void getErasesAndReplacementsForAlloc(
        method run (line 644) | llvm::PreservedAnalyses run(llvm::Function &func, llvm::FunctionAn...
      type AllocationHoister (line 689) | struct AllocationHoister : public llvm::PassInfoMixin<AllocationHois...
        method AllocationHoister (line 692) | explicit AllocationHoister(std::vector<std::string> allocators = {...
        method processLoop (line 698) | bool processLoop(llvm::Loop &loop, llvm::LoopInfo &loops, llvm::Cy...
        method run (line 773) | llvm::PreservedAnalyses run(llvm::Function &F, llvm::FunctionAnaly...
      type AllocationAutoFree (line 788) | struct AllocationAutoFree : public llvm::PassInfoMixin<AllocationAut...
        method AllocationAutoFree (line 791) | explicit AllocationAutoFree(
        method run (line 798) | llvm::PreservedAnalyses run(llvm::Function &F, llvm::FunctionAnaly...
        method insertFree (line 831) | bool insertFree(llvm::Instruction *Alloc, llvm::Function &F, llvm:...
      type CoroBranchSimplifier (line 921) | struct CoroBranchSimplifier : public llvm::PassInfoMixin<CoroBranchS...
        method run (line 936) | llvm::PreservedAnalyses run(llvm::Loop &loop, llvm::LoopAnalysisMa...
      function runLLVMOptimizationPasses (line 998) | void runLLVMOptimizationPasses(llvm::Module *module, bool debug, boo...
      function verify (line 1060) | void verify(llvm::Module *module) {
      function optimize (line 1075) | void optimize(llvm::Module *module, bool debug, bool jit, PluginMana...
      function isFastMathOn (line 1092) | bool isFastMathOn() { return FastMath; }

FILE: codon/cir/llvm/optimize.h
  function namespace (line 10) | namespace codon {

FILE: codon/cir/module.cpp
  type codon (line 12) | namespace codon {
    type ir (line 13) | namespace ir {
      function translateGenerics (line 15) | std::vector<codon::ast::types::TypePtr>
      function generateDummyNames (line 35) | std::vector<codon::ast::types::Type *>
      function translateArgs (line 45) | std::vector<codon::ast::types::TypePtr>
      function Func (line 159) | Func *Module::getOrRealizeMethod(types::Type *parent, const std::str...
      function Func (line 180) | Func *Module::getOrRealizeFunc(const std::string &funcName,
      function Value (line 344) | Value *Module::getInt(int64_t v) { return Nr<IntConst>(v, getIntType...
      function Value (line 346) | Value *Module::getFloat(double v) { return Nr<FloatConst>(v, getFloa...
      function Value (line 348) | Value *Module::getBool(bool v) { return Nr<BoolConst>(v, getBoolType...
      function Value (line 350) | Value *Module::getString(std::string v) {

FILE: codon/cir/module.h
  function namespace (line 18) | namespace codon {
  function store (line 491) | void store(Value *v) {
  function store (line 497) | void store(Var *v) {
  function ostream_formatter (line 508) | struct fmt::formatter<codon::ir::Module> : fmt::ostream_formatter {}

FILE: codon/cir/pyextension.h
  function namespace (line 11) | namespace codon {

FILE: codon/cir/transform/cleanup/canonical.cpp
  type codon (line 16) | namespace codon {
    type ir (line 17) | namespace ir {
      type transform (line 18) | namespace transform {
        type cleanup (line 19) | namespace cleanup {
          type NodeRanker (line 21) | struct NodeRanker : public util::Operator {
            method hash_combine (line 35) | void hash_combine(const T &v) {
            method preHook (line 40) | void preHook(Node *node) {
            method Rank (line 52) | Rank getRank() {
          function getRank (line 57) | NodeRanker::Rank getRank(Node *node) {
          function isCommutativeOp (line 63) | bool isCommutativeOp(Func *fn) {
          function isAssociativeOp (line 68) | bool isAssociativeOp(Func *fn) {
          function isDistributiveOp (line 73) | bool isDistributiveOp(Func *fn) {
          function isInequalityOp (line 78) | bool isInequalityOp(Func *fn) {
          type CanonOpChain (line 86) | struct CanonOpChain : public RewriteRule {
            method extractAssociativeOpChain (line 87) | static void extractAssociativeOpChain(Value *v, const std::str...
            method orderOperands (line 99) | static void orderOperands(std::vector<Value *> &operands) {
            method visit (line 112) | void visit(CallInstr *v) override {
          type CanonInequality (line 147) | struct CanonInequality : public RewriteRule {
            method visit (line 148) | void visit(CallInstr *v) override {
          type CanonAddMul (line 188) | struct CanonAddMul : public RewriteRule {
            method varMatch (line 189) | static bool varMatch(Value *a, Value *b) {
            method Func (line 195) | static Func *getOp(Value *v) {
            method Value (line 200) | static Value *addMul(Value *a, Value *b, Value *x) {
            method visit (line 225) | void visit(CallInstr *v) override {
          type CanonConstSub (line 277) | struct CanonConstSub : public RewriteRule {
            method visit (line 278) | void visit(CallInstr *v) override {

FILE: codon/cir/transform/cleanup/canonical.h
  function namespace (line 8) | namespace codon {

FILE: codon/cir/transform/cleanup/dead_code.cpp
  type codon (line 8) | namespace codon {
    type ir (line 9) | namespace ir {
      type transform (line 10) | namespace transform {
        type cleanup (line 11) | namespace cleanup {
          function BoolConst (line 13) | BoolConst *boolConst(Value *v) { return cast<BoolConst>(v); }
          function IntConst (line 15) | IntConst *intConst(Value *v) { return cast<IntConst>(v); }

FILE: codon/cir/transform/cleanup/dead_code.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/cleanup/global_demote.cpp
  type codon (line 5) | namespace codon {
    type ir (line 6) | namespace ir {
      type transform (line 7) | namespace transform {
        type cleanup (line 8) | namespace cleanup {
          type GetUsedGlobals (line 10) | struct GetUsedGlobals : public util::Operator {
            method preHook (line 12) | void preHook(Node *v) override {

FILE: codon/cir/transform/cleanup/global_demote.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/cleanup/replacer.cpp
  type codon (line 11) | namespace codon {
    type ir (line 12) | namespace ir {
      type transform (line 13) | namespace transform {
        type cleanup (line 14) | namespace cleanup {

FILE: codon/cir/transform/cleanup/replacer.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/folding/const_fold.cpp
  type codon (line 14) | namespace codon {
    type ir (line 15) | namespace ir {
      type transform (line 16) | namespace transform {
        type folding (line 17) | namespace folding {
          function pyDivmod (line 19) | auto pyDivmod(int64_t self, int64_t other) {
          class IntFloatBinaryRule (line 29) | class IntFloatBinaryRule : public RewriteRule {
            method IntFloatBinaryRule (line 37) | IntFloatBinaryRule(Func f, std::string magic, types::Type *out,
            method visit (line 44) | void visit(CallInstr *v) override {
          class DoubleConstantBinaryRuleExcludeRHSZero (line 75) | class DoubleConstantBinaryRuleExcludeRHSZero
            method DoubleConstantBinaryRuleExcludeRHSZero (line 78) | DoubleConstantBinaryRuleExcludeRHSZero(Func f, std::string magic,
            method visit (line 86) | void visit(CallInstr *v) override {
          function id_val (line 96) | auto id_val(Module *m) {
          function int_pow (line 103) | int64_t int_pow(int64_t base, int64_t exp) {
          function To (line 119) | To convert(From x) { return To(x); }
          function intSingleRule (line 121) | auto intSingleRule(Module *m, Args &&...args) {
          function intNoOp (line 126) | auto intNoOp(Module *m, std::string magic) {
          function intDoubleApplyNoOp (line 130) | auto intDoubleApplyNoOp(Module *m, std::string magic) {
          function intToIntBinary (line 134) | auto intToIntBinary(Module *m, Func f, std::string magic) {
          function intToIntBinaryNoZeroRHS (line 140) | auto intToIntBinaryNoZeroRHS(Module *m, Func f, std::string magi...
          function intToBoolBinary (line 146) | auto intToBoolBinary(Module *m, Func f, std::string magic) {
          function boolToBoolBinary (line 151) | auto boolToBoolBinary(Module *m, Func f, std::string magic) {
          function floatToFloatBinary (line 156) | auto floatToFloatBinary(Module *m, Func f, std::string magic) {
          function floatToFloatBinaryNoZeroRHS (line 162) | auto floatToFloatBinaryNoZeroRHS(Module *m, Func f, std::string ...
          function floatToBoolBinary (line 167) | auto floatToBoolBinary(Module *m, Func f, std::string magic) {
          function intFloatToFloatBinary (line 173) | auto intFloatToFloatBinary(Module *m, Func f, std::string magic,
          function intFloatToBoolBinary (line 180) | auto intFloatToBoolBinary(Module *m, Func f, std::string magic) {
          function intToIntUnary (line 185) | auto intToIntUnary(Module *m, Func f, std::string magic) {
          function floatToFloatUnary (line 190) | auto floatToFloatUnary(Module *m, Func f, std::string magic) {
          function boolToBoolUnary (line 195) | auto boolToBoolUnary(Module *m, Func f, std::string magic) {
          function identityConvert (line 200) | auto identityConvert(Module *m, std::string magic, types::Type *...
          function typeConvert (line 206) | auto typeConvert(Module *m, std::string magic, types::Type *from...

FILE: codon/cir/transform/folding/const_fold.h
  function namespace (line 11) | namespace codon {

FILE: codon/cir/transform/folding/const_prop.cpp
  type codon (line 10) | namespace codon {
    type ir (line 11) | namespace ir {
      type transform (line 12) | namespace transform {
        type folding (line 13) | namespace folding {
          function okConst (line 15) | bool okConst(const Value *v) {

FILE: codon/cir/transform/folding/const_prop.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/folding/folding.cpp
  type codon (line 8) | namespace codon {
    type ir (line 9) | namespace ir {
      type transform (line 10) | namespace transform {
        type folding (line 11) | namespace folding {

FILE: codon/cir/transform/folding/folding.h
  function namespace (line 10) | namespace codon {

FILE: codon/cir/transform/folding/rule.h
  function namespace (line 12) | namespace codon {

FILE: codon/cir/transform/lowering/async_for.cpp
  type codon (line 8) | namespace codon {
    type ir (line 9) | namespace ir {
      type transform (line 10) | namespace transform {
        type lowering (line 11) | namespace lowering {

FILE: codon/cir/transform/lowering/async_for.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/lowering/await.cpp
  type codon (line 11) | namespace codon {
    type ir (line 12) | namespace ir {
      type transform (line 13) | namespace transform {
        type lowering (line 14) | namespace lowering {
          function isFuture (line 17) | bool isFuture(const types::Type *type) {
          function isTask (line 21) | bool isTask(const types::Type *type) {

FILE: codon/cir/transform/lowering/await.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/lowering/imperative.cpp
  type codon (line 11) | namespace codon {
    type ir (line 12) | namespace ir {
      type transform (line 13) | namespace transform {
        type lowering (line 14) | namespace lowering {
          function CallInstr (line 16) | CallInstr *getRangeIter(Value *iter) {
          function Value (line 44) | Value *getListIter(Value *iter) {

FILE: codon/cir/transform/lowering/imperative.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/lowering/pipeline.cpp
  type codon (line 11) | namespace codon {
    type ir (line 12) | namespace ir {
      type transform (line 13) | namespace transform {
        type lowering (line 14) | namespace lowering {
          function Value (line 16) | Value *callStage(Module *M, PipelineFlow::Stage *stage, Value *l...
          function Value (line 24) | Value *convertPipelineToForLoopsHelper(Module *M, BodiedFunc *pa...
          function Value (line 51) | Value *convertPipelineToForLoops(PipelineFlow *p, BodiedFunc *pa...

FILE: codon/cir/transform/lowering/pipeline.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/manager.cpp
  type codon (line 31) | namespace codon {
    type ir (line 32) | namespace ir {
      type transform (line 33) | namespace transform {

FILE: codon/cir/transform/manager.h
  function namespace (line 16) | namespace codon {
  function isDisabled (line 177) | bool isDisabled(const std::string &key) {

FILE: codon/cir/transform/numpy/expr.cpp
  type codon (line 7) | namespace codon {
    type ir (line 8) | namespace ir {
      type transform (line 9) | namespace transform {
        type numpy (line 10) | namespace numpy {
          function isPythonScalar (line 66) | bool isPythonScalar(NumPyType &t) {
          function Value (line 470) | Value *NumPyExpr::codegenBroadcasts(CodegenContext &C) {
          function Var (line 503) | Var *NumPyExpr::codegenFusedEval(CodegenContext &C) {
          function Var (line 597) | Var *NumPyExpr::codegenSequentialEval(CodegenContext &C) {
          function BroadcastInfo (line 904) | BroadcastInfo NumPyExpr::getBroadcastInfo() {
          function Value (line 943) | Value *NumPyExpr::codegenScalarExpr(

FILE: codon/cir/transform/numpy/forward.cpp
  type codon (line 5) | namespace codon {
    type ir (line 6) | namespace ir {
      type transform (line 7) | namespace transform {
        type numpy (line 8) | namespace numpy {
          type GetVars (line 15) | struct GetVars : public util::Operator {
            method GetVars (line 18) | explicit GetVars(std::unordered_set<id_t> &vids) : util::Opera...
            method preHook (line 20) | void preHook(Node *v) override {
          type OkToForwardPast (line 28) | struct OkToForwardPast : public util::Operator {
            method OkToForwardPast (line 34) | OkToForwardPast(std::unordered_set<id_t> &vids,
            method preHook (line 38) | void preHook(Node *v) override {
          type GetAllUses (line 61) | struct GetAllUses : public util::Operator {
            method GetAllUses (line 65) | GetAllUses(Var *var, std::vector<Value *> &uses)
            method preHook (line 68) | void preHook(Node *n) override {
          function canForwardExpressionAlongPath (line 77) | bool canForwardExpressionAlongPath(
          function canForwardExpression (line 111) | bool canForwardExpression(NumPyOptimizationUnit *expr, Value *ta...
          function canForwardVariable (line 159) | bool canForwardVariable(AssignInstr *assign, Value *destination,...
          function ForwardingDAG (line 186) | ForwardingDAG buildForwardingDAG(BodiedFunc *func, RD *rd, CFG *...
          type UnionFind (line 230) | struct UnionFind {
            method UnionFind (line 234) | explicit UnionFind(int64_t n) : parent(n), rank(n) {
            method find (line 241) | int64_t find(int64_t u) {
            method union_ (line 247) | void union_(int64_t u, int64_t v) {
          function getForwardingDAGConnectedComponents (line 263) | std::vector<ForwardingDAG>
          function hasCycleHelper (line 295) | bool hasCycleHelper(int64_t v, ForwardingDAG &dag,
          function hasCycle (line 314) | bool hasCycle(ForwardingDAG &dag, std::vector<NumPyOptimizationU...
          function doForwardingHelper (line 327) | void doForwardingHelper(ForwardingDAG &dag, NumPyOptimizationUni...
          function getForwardingDAGs (line 348) | std::vector<ForwardingDAG>
          function NumPyOptimizationUnit (line 359) | NumPyOptimizationUnit *doForwarding(ForwardingDAG &dag,

FILE: codon/cir/transform/numpy/indexing.cpp
  type codon (line 11) | namespace codon {
    type ir (line 12) | namespace ir {
      type transform (line 13) | namespace transform {
        type numpy (line 14) | namespace numpy {
          type Term (line 18) | struct Term {
            type Kind (line 19) | enum Kind { INT, VAR, LEN }
            method Term (line 23) | Term(Kind kind, int64_t val, const VarValue *var) : kind(kind)...
            method Term (line 25) | static Term valTerm(int64_t v) { return {Kind::INT, v, nullptr...
            method Term (line 27) | static Term varTerm(VarValue *v) { return {Kind::VAR, 1, v}; }
            method Term (line 29) | static Term lenTerm(VarValue *v) { return {Kind::LEN, 1, v}; }
            method negate (line 31) | void negate() { val = -val; }
            method multiply (line 33) | void multiply(int64_t n) { val *= n; }
            method combine (line 35) | bool combine(const Term &other) {
            method zero (line 44) | bool zero() const { return val == 0; }
            method str (line 46) | std::string str() const {
          function t2s (line 60) | std::string t2s(const std::vector<Term> &terms) {
          function simplify (line 71) | void simplify(std::vector<Term> &terms) {
          function checkTotal (line 92) | bool checkTotal(const std::vector<Term> &terms, bool strict) {
          function lessCheck (line 111) | bool lessCheck(const std::vector<Term> &terms1, const std::vecto...
          function lessThan (line 125) | bool lessThan(const std::vector<Term> &terms1, const std::vector...
          function lessThanOrEqual (line 129) | bool lessThanOrEqual(const std::vector<Term> &terms1, const std:...
          function replaceLoopVariable (line 133) | std::vector<Term> replaceLoopVariable(const std::vector<Term> &t...
          function isArrayType (line 150) | bool isArrayType(types::Type *t, bool dim1 = false) {
          function isLen (line 164) | bool isLen(Func *f) {
          function parse (line 169) | bool parse(Value *x, std::vector<Term> &terms, bool negate = fal...
          type IndexInfo (line 219) | struct IndexInfo {
            method IndexInfo (line 225) | IndexInfo(CallInstr *orig, VarValue *arr, Value *idx, Value *i...
          type FindArrayIndex (line 229) | struct FindArrayIndex : public util::Operator {
            method FindArrayIndex (line 232) | FindArrayIndex() : util::Operator(/*childrenFirst=*/true), ind...
            method handle (line 234) | void handle(CallInstr *v) override {
          function elideBoundsCheck (line 257) | void elideBoundsCheck(IndexInfo &index) {
          function isOriginalLoopVar (line 280) | bool isOriginalLoopVar(const Value *loc, ImperativeForFlow *loop,
          function VarValue (line 316) | const VarValue *isAliasOfLoopVar(const VarValue *v, ImperativeFo...
          function canElideBoundsCheck (line 329) | bool canElideBoundsCheck(ImperativeForFlow *loop, IndexInfo &index,

FILE: codon/cir/transform/numpy/indexing.h
  function namespace (line 6) | namespace codon {

FILE: codon/cir/transform/numpy/numpy.cpp
  type codon (line 24) | namespace codon {
    type ir (line 25) | namespace ir {
      type transform (line 26) | namespace transform {
        type numpy (line 27) | namespace numpy {
          function isArrayType (line 41) | bool isArrayType(types::Type *t) {
          function isUFuncType (line 47) | bool isUFuncType(types::Type *t) {
          function isNoneType (line 55) | bool isNoneType(types::Type *t, NumPyPrimitiveTypes &T) {
          function NumPyType (line 79) | NumPyType NumPyType::get(types::Type *t, NumPyPrimitiveTypes &T) {
          function parse (line 255) | std::unique_ptr<NumPyExpr> parse(Value *v,
          function Var (line 699) | Var *optimizeHelper(NumPyOptimizationUnit &unit, NumPyExpr *expr...
          type ExtractArrayExpressions (line 816) | struct ExtractArrayExpressions : public util::Operator {
            method ExtractArrayExpressions (line 822) | explicit ExtractArrayExpressions(BodiedFunc *func)
            method extract (line 825) | void extract(Value *v, AssignInstr *assign = nullptr) {
            method preHook (line 844) | void preHook(Node *n) override {

FILE: codon/cir/transform/numpy/numpy.h
  function namespace (line 15) | namespace codon {

FILE: codon/cir/transform/parallel/openmp.cpp
  type codon (line 15) | namespace codon {
    type ir (line 16) | namespace ir {
      type transform (line 17) | namespace transform {
        type parallel (line 18) | namespace parallel {
          function warn (line 24) | void warn(const std::string &msg, const Value *v) {
          type OMPTypes (line 29) | struct OMPTypes {
            method OMPTypes (line 35) | explicit OMPTypes(Module *M) {
          function Var (line 43) | Var *getVarFromOutlinedArg(Value *arg) {
          function Value (line 54) | Value *ptrFromFunc(Func *func) {
          type ReductionLocks (line 63) | struct ReductionLocks {
            method Var (line 68) | Var *createLock(Module *M) {
            method Var (line 84) | Var *getMainLock(Module *M) {
            method Var (line 90) | Var *getCritLock(Module *M) {
          type Reduction (line 97) | struct Reduction {
            type Kind (line 98) | enum Kind {
            method Value (line 118) | Value *getInitial() {
            method Value (line 186) | Value *generateNonAtomicReduction(Value *ptr, Value *arg) {
            method Value (line 224) | Value *generateAtomicReduction(Value *ptr, Value *arg, Var *lo...
          type ReductionFunction (line 357) | struct ReductionFunction {
          type ReductionIdentifier (line 363) | struct ReductionIdentifier : public util::Operator {
            method ReductionIdentifier (line 368) | ReductionIdentifier()
            method ReductionIdentifier (line 371) | ReductionIdentifier(std::vector<Var *> shareds, Var *loopVarArg)
            method isShared (line 375) | bool isShared(Var *shared) {
            method isSharedDeref (line 385) | bool isSharedDeref(Var *shared, Value *v) {
            method extractAssociativeOpChain (line 402) | static void extractAssociativeOpChain(Value *v, const std::str...
            method Reduction (line 415) | Reduction getReductionFromCall(CallInstr *v) {
            method Reduction (line 505) | Reduction getReduction(Var *shared) {
            method handle (line 510) | void handle(CallInstr *v) override {
          type SharedInfo (line 524) | struct SharedInfo {
          type LoopTemplateReplacer (line 530) | struct LoopTemplateReplacer : public util::Operator {
            method LoopTemplateReplacer (line 535) | LoopTemplateReplacer(BodiedFunc *parent, CallInstr *replacemen...
          type ParallelLoopTemplateReplacer (line 539) | struct ParallelLoopTemplateReplacer : public LoopTemplateReplacer {
            method ParallelLoopTemplateReplacer (line 547) | ParallelLoopTemplateReplacer(BodiedFunc *parent, CallInstr *re...
            method numReductions (line 552) | unsigned numReductions() {
            method Value (line 561) | Value *getReductionTuple() {
            method BodiedFunc (line 571) | BodiedFunc *makeReductionFunc() {
            method handle (line 598) | void handle(CallInstr *v) override {
          type ImperativeLoopTemplateReplacer (line 686) | struct ImperativeLoopTemplateReplacer : public ParallelLoopTempl...
            method ImperativeLoopTemplateReplacer (line 690) | ImperativeLoopTemplateReplacer(BodiedFunc *parent, CallInstr *...
            method handle (line 696) | void handle(CallInstr *v) override {
          type TaskLoopReductionVarReplacer (line 804) | struct TaskLoopReductionVarReplacer : public util::Operator {
            method setupReductionRemap (line 809) | void setupReductionRemap() {
            method TaskLoopReductionVarReplacer (line 818) | TaskLoopReductionVarReplacer(std::vector<Var *> reductionArgs,...
            method preHook (line 824) | void preHook(Node *v) override {
            method finalize (line 832) | void finalize() {
          type TaskLoopBodyStubReplacer (line 851) | struct TaskLoopBodyStubReplacer : public util::Operator {
            method TaskLoopBodyStubReplacer (line 855) | TaskLoopBodyStubReplacer(CallInstr *replacement, std::vector<b...
            method handle (line 858) | void handle(CallInstr *v) override {
          type TaskLoopRoutineStubReplacer (line 912) | struct TaskLoopRoutineStubReplacer : public ParallelLoopTemplate...
            method setupSharedInfo (line 918) | void setupSharedInfo(std::vector<Reduction> &sharedRedux) {
            method TaskLoopRoutineStubReplacer (line 933) | TaskLoopRoutineStubReplacer(BodiedFunc *parent, CallInstr *rep...
            method BodiedFunc (line 943) | BodiedFunc *makeTaskRedInitFunc(Reduction *reduction) {
            method BodiedFunc (line 958) | BodiedFunc *makeTaskRedCombFunc(Reduction *reduction) {
            method Value (line 976) | Value *makeTaskRedInput(Reduction *reduction, Value *shar, Val...
            method handle (line 991) | void handle(VarValue *v) override {
            method handle (line 1030) | void handle(CallInstr *v) override {
          type GPULoopBodyStubReplacer (line 1166) | struct GPULoopBodyStubReplacer : public util::Operator {
            method GPULoopBodyStubReplacer (line 1171) | GPULoopBodyStubReplacer(CallInstr *replacement, Var *loopVar, ...
            method handle (line 1174) | void handle(CallInstr *v) override {
          type GPULoopTemplateReplacer (line 1210) | struct GPULoopTemplateReplacer : public LoopTemplateReplacer {
            method GPULoopTemplateReplacer (line 1213) | GPULoopTemplateReplacer(BodiedFunc *parent, CallInstr *replace...
            method handle (line 1217) | void handle(CallInstr *v) override {
          type OpenMPTransformData (line 1230) | struct OpenMPTransformData {
          function OpenMPTransformData (line 1236) | OpenMPTransformData unpar(T *v) {
          function OpenMPTransformData (line 1242) | OpenMPTransformData setupOpenMPTransform(T *v, BodiedFunc *paren...
          type ForkCallData (line 1277) | struct ForkCallData {
          function ForkCallData (line 1282) | ForkCallData createForkCall(Module *M, OMPTypes &types, Value *r...
          type CollapseResult (line 1301) | struct CollapseResult {
          type LoopRange (line 1309) | struct LoopRange {
          function CollapseResult (line 1317) | CollapseResult collapseLoop(BodiedFunc *parent, ImperativeForFlo...

FILE: codon/cir/transform/parallel/openmp.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/parallel/schedule.cpp
  type codon (line 11) | namespace codon {
    type ir (line 12) | namespace ir {
      type transform (line 13) | namespace transform {
        type parallel (line 14) | namespace parallel {
          function getScheduleCode (line 16) | int getScheduleCode(const std::string &schedule = "static", bool...
          function Value (line 45) | Value *nullIfNeg(Value *v) {

FILE: codon/cir/transform/parallel/schedule.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/pass.cpp
  type codon (line 7) | namespace codon {
    type ir (line 8) | namespace ir {
      type transform (line 9) | namespace transform {

FILE: codon/cir/transform/pass.h
  function namespace (line 8) | namespace codon {

FILE: codon/cir/transform/pythonic/dict.cpp
  type codon (line 11) | namespace codon {
    type ir (line 12) | namespace ir {
      type transform (line 13) | namespace transform {
        type pythonic (line 14) | namespace pythonic {
          type GetCall (line 17) | struct GetCall {
          function GetCall (line 31) | GetCall analyzeGet(CallInstr *call) {

FILE: codon/cir/transform/pythonic/dict.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/pythonic/generator.cpp
  type codon (line 11) | namespace codon {
    type ir (line 12) | namespace ir {
      type transform (line 13) | namespace transform {
        type pythonic (line 14) | namespace pythonic {
          function isSum (line 16) | bool isSum(Func *f) {
          function isAny (line 21) | bool isAny(Func *f) {
          function isAll (line 26) | bool isAll(Func *f) {
          type GeneratorSumTransformer (line 32) | struct GeneratorSumTransformer : public util::Operator {
            method GeneratorSumTransformer (line 36) | explicit GeneratorSumTransformer(Var *accumulator)
            method handle (line 39) | void handle(YieldInstr *v) override {
            method handle (line 62) | void handle(ReturnInstr *v) override {
            method handle (line 73) | void handle(YieldInInstr *v) override { valid = false; }
          type GeneratorAnyAllTransformer (line 77) | struct GeneratorAnyAllTransformer : public util::Operator {
            method GeneratorAnyAllTransformer (line 81) | explicit GeneratorAnyAllTransformer(bool any)
            method handle (line 84) | void handle(YieldInstr *v) override {
            method handle (line 101) | void handle(ReturnInstr *v) override {
            method handle (line 114) | void handle(YieldInInstr *v) override { valid = false; }
          function Func (line 117) | Func *genToSum(BodiedFunc *gen, types::Type *startType, types::T...
          function Func (line 171) | Func *genToAnyAll(BodiedFunc *gen, bool any) {

FILE: codon/cir/transform/pythonic/generator.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/pythonic/io.cpp
  type codon (line 10) | namespace codon {
    type ir (line 11) | namespace ir {
      type transform (line 12) | namespace transform {
        type pythonic (line 13) | namespace pythonic {
          function optimizePrint (line 15) | void optimizePrint(CallInstr *v) {
          function optimizeWrite (line 56) | void optimizeWrite(CallInstr *v) {

FILE: codon/cir/transform/pythonic/io.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/pythonic/list.cpp
  type codon (line 10) | namespace codon {
    type ir (line 11) | namespace ir {
      type transform (line 12) | namespace transform {
        type pythonic (line 13) | namespace pythonic {
          function isList (line 20) | bool isList(Value *v) { return v->getType()->getName().rfind(LIS...
          function isSlice (line 21) | bool isSlice(Value *v) { return v->getType()->getName() == SLICE; }
          type ElementHandler (line 37) | struct ElementHandler {
            method ElementHandler (line 40) | ElementHandler() : vars() {}
            method doSetup (line 46) | void doSetup(const std::vector<Value *> &values, SeriesFlow *b...
          type DefaultHandler (line 56) | struct DefaultHandler : public ElementHandler {
            method DefaultHandler (line 59) | DefaultHandler(Value *element) : ElementHandler(), element(ele...
            method setup (line 61) | void setup(SeriesFlow *block, BodiedFunc *parent) override {
            method Value (line 65) | Value *length(Module *M) override {
            method Value (line 73) | Value *append(Value *result) override {
            method get (line 82) | static std::unique_ptr<ElementHandler> get(Value *v, types::Ty...
          type SliceHandler (line 89) | struct SliceHandler : public ElementHandler {
            method SliceHandler (line 93) | SliceHandler(Value *element, Value *slice)
            method setup (line 96) | void setup(SeriesFlow *block, BodiedFunc *parent) override {
            method Value (line 100) | Value *length(Module *M) override {
            method Value (line 110) | Value *append(Value *result) override {
            method get (line 121) | static std::unique_ptr<ElementHandler> get(Value *v, types::Ty...
          type LiteralHandler (line 138) | struct LiteralHandler : public ElementHandler {
            method LiteralHandler (line 141) | LiteralHandler(std::vector<Value *> elements)
            method setup (line 144) | void setup(SeriesFlow *block, BodiedFunc *parent) override {
            method Value (line 148) | Value *length(Module *M) override { return M->getInt(elements....
            method Value (line 150) | Value *append(Value *result) override {
            method get (line 165) | static std::unique_ptr<ElementHandler> get(Value *v, types::Ty...
          type InspectionResult (line 193) | struct InspectionResult {
          function inspect (line 198) | void inspect(Value *v, InspectionResult &r) {
          function Value (line 216) | Value *optimize(BodiedFunc *parent, InspectionResult &r) {

FILE: codon/cir/transform/pythonic/list.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/pythonic/str.cpp
  type codon (line 10) | namespace codon {
    type ir (line 11) | namespace ir {
      type transform (line 12) | namespace transform {
        type pythonic (line 13) | namespace pythonic {
          type InspectionResult (line 15) | struct InspectionResult {
          function isString (line 20) | bool isString(Value *v) {
          function inspect (line 25) | void inspect(Value *v, InspectionResult &r) {

FILE: codon/cir/transform/pythonic/str.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/transform/rewrite.h
  function namespace (line 8) | namespace codon {

FILE: codon/cir/types/types.cpp
  type codon (line 17) | namespace codon {
    type ir (line 18) | namespace ir {
      type types (line 19) | namespace types {
        function extractTypes (line 21) | std::vector<codon::ast::types::TypePtr>
        function Value (line 56) | Value *Type::doConstruct(std::vector<Value *> args) {
        function Type (line 115) | Type *RecordType::getMemberType(const std::string &n) const {
        function Value (line 144) | Value *RefType::doConstruct(std::vector<Value *> args) {

FILE: codon/cir/types/types.h
  function namespace (line 18) | namespace codon {
  function ostream_formatter (line 586) | struct fmt::formatter<codon::ir::types::Type> : fmt::ostream_formatter {}

FILE: codon/cir/util/cloning.cpp
  type codon (line 7) | namespace codon {
    type ir (line 8) | namespace ir {
      type util (line 9) | namespace util {
        type GatherLocals (line 11) | struct GatherLocals : public util::Operator {
          method preHook (line 13) | void preHook(Node *node) override {
        function Value (line 22) | Value *CloneVisitor::clone(const Value *other, BodiedFunc *cloneTo,
        function Var (line 64) | Var *CloneVisitor::clone(const Var *other) {

FILE: codon/cir/util/cloning.h
  function class (line 14) | class CloneVisitor : public ConstVisitor {

FILE: codon/cir/util/context.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/util/format.cpp
  type codon (line 12) | namespace codon {
    type ir (line 13) | namespace ir {
      type util (line 14) | namespace util {
        type NodeFormatter (line 16) | struct NodeFormatter {
          method NodeFormatter (line 25) | NodeFormatter(const types::Type *type, std::unordered_set<id_t> ...
          method NodeFormatter (line 29) | NodeFormatter(const Value *value, std::unordered_set<id_t> &seen...
          method NodeFormatter (line 32) | NodeFormatter(const Var *var, std::unordered_set<id_t> &seenNodes,
        function escapeString (line 40) | std::string escapeString(const std::string &str) {
        class FormatVisitor (line 84) | class FormatVisitor : util::ConstVisitor {
          method FormatVisitor (line 91) | FormatVisitor(std::ostream &os, std::unordered_set<id_t> &seenNo...
          method visit (line 96) | void visit(const Module *v) override {
          method defaultVisit (line 106) | void defaultVisit(const Node *) override { os << "(unknown_node)...
          method visit (line 108) | void visit(const Var *v) override {
          method visit (line 115) | void visit(const BodiedFunc *v) override {
          method visit (line 124) | void visit(const ExternalFunc *v) override {
          method visit (line 128) | void visit(const InternalFunc *v) override {
          method visit (line 132) | void visit(const LLVMFunc *v) override {
          method visit (line 156) | void visit(const VarValue *v) override {
          method visit (line 159) | void visit(const PointerValue *v) override {
          method visit (line 164) | void visit(const SeriesFlow *v) override {
          method visit (line 169) | void visit(const IfFlow *v) override {
          method visit (line 173) | void visit(const WhileFlow *v) override {
          method visit (line 177) | void visit(const ForFlow *v) override {
          method visit (line 182) | void visit(const ImperativeForFlow *v) override {
          method visit (line 188) | void visit(const TryCatchFlow *v) override {
          method visit (line 202) | void visit(const PipelineFlow *v) override {
          method visit (line 214) | void visit(const dsl::CustomFlow *v) override { v->doFormat(os); }
          method visit (line 216) | void visit(const IntConst *v) override {
          method visit (line 219) | void visit(const FloatConst *v) override {
          method visit (line 222) | void visit(const BoolConst *v) override {
          method visit (line 225) | void visit(const StringConst *v) override {
          method visit (line 228) | void visit(const dsl::CustomConst *v) override { v->doFormat(os); }
          method visit (line 230) | void visit(const AssignInstr *v) override {
          method visit (line 234) | void visit(const ExtractInstr *v) override {
          method visit (line 238) | void visit(const InsertInstr *v) override {
          method visit (line 242) | void visit(const CallInstr *v) override {
          method visit (line 247) | void visit(const StackAllocInstr *v) override {
          method visit (line 251) | void visit(const TypePropertyInstr *v) override {
          method visit (line 263) | void visit(const YieldInInstr *v) override {
          method visit (line 266) | void visit(const TernaryInstr *v) override {
          method visit (line 270) | void visit(const BreakInstr *v) override {
          method visit (line 273) | void visit(const ContinueInstr *v) override {
          method visit (line 276) | void visit(const ReturnInstr *v) override {
          method visit (line 279) | void visit(const YieldInstr *v) override {
          method visit (line 282) | void visit(const AwaitInstr *v) override {
          method visit (line 286) | void visit(const ThrowInstr *v) override {
          method visit (line 289) | void visit(const FlowInstr *v) override {
          method visit (line 293) | void visit(const dsl::CustomInstr *v) override { v->doFormat(os); }
          method visit (line 295) | void visit(const types::IntType *v) override {
          method visit (line 298) | void visit(const types::FloatType *v) override {
          method visit (line 301) | void visit(const types::Float32Type *v) override {
          method visit (line 304) | void visit(const types::Float16Type *v) override {
          method visit (line 307) | void visit(const types::BFloat16Type *v) override {
          method visit (line 310) | void visit(const types::Float128Type *v) override {
          method visit (line 313) | void visit(const types::BoolType *v) override {
          method visit (line 316) | void visit(const types::ByteType *v) override {
          method visit (line 319) | void visit(const types::VoidType *v) override {
          method visit (line 322) | void visit(const types::RecordType *v) override {
          method visit (line 333) | void visit(const types::RefType *v) override {
          method visit (line 337) | void visit(const types::FuncType *v) override {
          method visit (line 343) | void visit(const types::OptionalType *v) override {
          method visit (line 347) | void visit(const types::PointerType *v) override {
          method visit (line 351) | void visit(const types::GeneratorType *v) override {
          method visit (line 355) | void visit(const types::IntNType *v) override {
          method visit (line 359) | void visit(const types::VectorType *v) override {
          method visit (line 363) | void visit(const types::UnionType *v) override {
          method visit (line 368) | void visit(const dsl::types::CustomType *v) override { v->doForm...
          method format (line 370) | void format(const Node *n) {
          method format (line 377) | void format(const types::Type *t, bool canShowFull = false) {
          method format (line 389) | void format(const Value *t) {
          method format (line 402) | void format(const Var *t, bool canShowFull = false) {
          method NodeFormatter (line 415) | NodeFormatter makeFormatter(const types::Type *node, bool canSho...
          method NodeFormatter (line 420) | NodeFormatter makeFormatter(const Value *node) {
          method NodeFormatter (line 423) | NodeFormatter makeFormatter(const Var *node, bool canShowFull = ...
          method makeFormatters (line 429) | std::vector<NodeFormatter> makeFormatters(It begin, It end) {
          method makeFormatters (line 438) | std::vector<NodeFormatter> makeFormatters(It begin, It end, bool...
        function format (line 460) | std::string format(const Node *node) {
  type fmt::formatter<codon::ir::util::NodeFormatter> (line 481) | struct fmt::formatter<codon::ir::util::NodeFormatter> : ostream_formatte...

FILE: codon/cir/util/format.h
  function namespace (line 9) | namespace codon {

FILE: codon/cir/util/inlining.cpp
  type codon (line 11) | namespace codon {
    type ir (line 12) | namespace ir {
      type util (line 13) | namespace util {
        class ReturnVerifier (line 17) | class ReturnVerifier : public util::Operator {
          method handle (line 21) | void handle(ReturnInstr *v) {
        class ReturnReplacer (line 46) | class ReturnReplacer : public util::Operator {
          method ReturnReplacer (line 54) | ReturnReplacer(Value *implicitLoop, Var *var, bool aggressive, u...
          method handle (line 57) | void handle(ReturnInstr *v) {
        function InlineResult (line 72) | InlineResult inlineFunction(Func *func, std::vector<Value *> args,...
        function InlineResult (line 130) | InlineResult inlineCall(CallInstr *v, bool aggressive) {

FILE: codon/cir/util/inlining.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/util/irtools.cpp
  type codon (line 7) | namespace codon {
    type ir (line 8) | namespace ir {
      type util (line 9) | namespace util {
        function hasAttribute (line 11) | bool hasAttribute(const Func *func, const std::string &attribute) {
        function isStdlibFunc (line 18) | bool isStdlibFunc(const Func *func, const std::string &submodule) {
        function CallInstr (line 26) | CallInstr *call(Func *func, const std::vector<Value *> &args) {
        function isCallOf (line 31) | bool isCallOf(const Value *value, const std::string &name,
        function isCallOf (line 63) | bool isCallOf(const Value *value, const std::string &name, int num...
        function isMagicMethodCall (line 84) | bool isMagicMethodCall(const Value *value) {
        function Value (line 103) | Value *makeTuple(const std::vector<Value *> &args, Module *M) {
        function Var (line 119) | Var *makeVar(Value *x, SeriesFlow *flow, BodiedFunc *parent, bool ...
        function Value (line 139) | Value *alloc(types::Type *type, Value *count) {
        function Value (line 145) | Value *alloc(types::Type *type, int64_t count) {
        function Var (line 150) | Var *getVar(Value *x) {
        function Var (line 161) | const Var *getVar(const Value *x) {
        function Func (line 172) | Func *getFunc(Value *x) {
        function Func (line 181) | const Func *getFunc(const Value *x) {
        function Value (line 190) | Value *ptrLoad(Value *ptr) {
        function Value (line 197) | Value *ptrStore(Value *ptr, Value *val) {
        function Value (line 206) | Value *tupleGet(Value *tuple, unsigned index) {
        function Value (line 211) | Value *tupleStore(Value *tuple, unsigned index, Value *val) {
        function BodiedFunc (line 222) | BodiedFunc *getStdlibFunc(Value *x, const std::string &name,
        function BodiedFunc (line 234) | const BodiedFunc *getStdlibFunc(const Value *x, const std::string ...
        function setReturnType (line 250) | void setReturnType(Func *func, types::Type *rType) {

FILE: codon/cir/util/irtools.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/util/iterators.h
  function namespace (line 9) | namespace codon {

FILE: codon/cir/util/matching.cpp
  type codon (line 25) | namespace codon {
    type ir (line 26) | namespace ir {
      type util (line 27) | namespace util {
        class MatchVisitor (line 29) | class MatchVisitor : public util::ConstVisitor {
          method MatchVisitor (line 39) | explicit MatchVisitor(bool checkName = false, bool varIdMatch = ...
          method handle (line 43) | void handle(const Var *x, const Var *y) { result = compareVars(x...
          method handle (line 46) | void handle(const Func *x, const Func *y) {}
          method handle (line 48) | void handle(const BodiedFunc *x, const BodiedFunc *y) {
          method handle (line 55) | void handle(const ExternalFunc *x, const ExternalFunc *y) {
          method handle (line 59) | void handle(const InternalFunc *x, const InternalFunc *y) {
          method handle (line 63) | void handle(const LLVMFunc *x, const LLVMFunc *y) {
          method handle (line 80) | void handle(const Value *x, const Value *y) {}
          method handle (line 82) | void handle(const VarValue *x, const VarValue *y) {
          method handle (line 86) | void handle(const PointerValue *x, const PointerValue *y) {
          method handle (line 91) | void handle(const Flow *x, const Flow *y) {}
          method handle (line 93) | void handle(const SeriesFlow *x, const SeriesFlow *y) {
          method handle (line 98) | void handle(const IfFlow *x, const IfFlow *y) {
          method handle (line 105) | void handle(const WhileFlow *x, const WhileFlow *y) {
          method handle (line 109) | void handle(const ForFlow *x, const ForFlow *y) {
          method handle (line 114) | void handle(const ImperativeForFlow *x, const ImperativeForFlow ...
          method handle (line 120) | void handle(const TryCatchFlow *x, const TryCatchFlow *y) {
          method handle (line 132) | void handle(const PipelineFlow *x, const PipelineFlow *y) {
          method handle (line 142) | void handle(const dsl::CustomFlow *x, const dsl::CustomFlow *y) {
          method handle (line 147) | void handle(const IntConst *x, const IntConst *y) {
          method handle (line 151) | void handle(const FloatConst *x, const FloatConst *y) {
          method handle (line 155) | void handle(const BoolConst *x, const BoolConst *y) {
          method handle (line 159) | void handle(const StringConst *x, const StringConst *y) {
          method handle (line 163) | void handle(const dsl::CustomConst *x, const dsl::CustomConst *y) {
          method handle (line 168) | void handle(const AssignInstr *x, const AssignInstr *y) {
          method handle (line 172) | void handle(const ExtractInstr *x, const ExtractInstr *y) {
          method handle (line 176) | void handle(const InsertInstr *x, const InsertInstr *y) {
          method handle (line 181) | void handle(const CallInstr *x, const CallInstr *y) {
          method handle (line 187) | void handle(const StackAllocInstr *x, const StackAllocInstr *y) {
          method handle (line 191) | void handle(const TypePropertyInstr *x, const TypePropertyInstr ...
          method handle (line 196) | void handle(const YieldInInstr *x, const YieldInInstr *y) {
          method handle (line 200) | void handle(const TernaryInstr *x, const TernaryInstr *y) {
          method handle (line 206) | void handle(const BreakInstr *x, const BreakInstr *y) {
          method handle (line 210) | void handle(const ContinueInstr *x, const ContinueInstr *y) {
          method handle (line 214) | void handle(const ReturnInstr *x, const ReturnInstr *y) {
          method handle (line 218) | void handle(const YieldInstr *x, const YieldInstr *y) {
          method handle (line 222) | void handle(const AwaitInstr *x, const AwaitInstr *y) {
          method handle (line 228) | void handle(const ThrowInstr *x, const ThrowInstr *y) {
          method handle (line 232) | void handle(const FlowInstr *x, const FlowInstr *y) {
          method handle (line 237) | void handle(const dsl::CustomInstr *x, const dsl::CustomInstr *y) {
          method process (line 241) | bool process(const Node *x, const Node *y) const {
          method compareVars (line 260) | bool compareVars(const Var *x, const Var *y) const {
          method compareFuncs (line 265) | bool compareFuncs(const Func *x, const Func *y) const {
        function match (line 286) | bool match(Node *a, Node *b, bool checkNames, bool varIdMatch) {

FILE: codon/cir/util/matching.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/util/operator.h
  function virtual (line 52) | virtual void preHook(Node *node) {}
  function virtual (line 57) | virtual void postHook(Node *node) {}

FILE: codon/cir/util/outlining.cpp
  type codon (line 13) | namespace codon {
    type ir (line 14) | namespace ir {
      type util (line 15) | namespace util {
        type OutlineReplacer (line 17) | struct OutlineReplacer : public Operator {
          method OutlineReplacer (line 23) | OutlineReplacer(Module *M, std::unordered_set<id_t> &modVars,
          method postHook (line 29) | void postHook(Node *node) override {
          method Var (line 35) | Var *mappedVar(Var *v) {
          method replaceOutFlowWithReturn (line 46) | void replaceOutFlowWithReturn(InstrType *v) {
          method handle (line 58) | void handle(ReturnInstr *v) override { replaceOutFlowWithReturn(...
          method handle (line 60) | void handle(BreakInstr *v) override { replaceOutFlowWithReturn(v...
          method handle (line 62) | void handle(ContinueInstr *v) override { replaceOutFlowWithRetur...
          method handle (line 66) | void handle(VarValue *v) override {
          method handle (line 78) | void handle(PointerValue *v) override {
          method handle (line 90) | void handle(AssignInstr *v) override {
        type Outliner (line 102) | struct Outliner : public Operator {
          method Outliner (line 119) | Outliner(BodiedFunc *parent, SeriesFlow *flowRegion,
          method isEnclosingLoopInRegion (line 127) | bool isEnclosingLoopInRegion(id_t loopId = -1) {
          method handle (line 142) | void handle(WhileFlow *v) override {
          method handle (line 147) | void handle(ForFlow *v) override {
          method handle (line 152) | void handle(ImperativeForFlow *v) override {
          method handle (line 157) | void handle(ReturnInstr *v) override {
          method handle (line 162) | void handle(BreakInstr *v) override {
          method handle (line 168) | void handle(ContinueInstr *v) override {
          method handle (line 174) | void handle(YieldInstr *v) override {
          method handle (line 179) | void handle(AwaitInstr *v) override {
          method handle (line 184) | void handle(YieldInInstr *v) override {
          method handle (line 189) | void handle(StackAllocInstr *v) override {
          method handle (line 194) | void handle(AssignInstr *v) override {
          method handle (line 203) | void handle(PointerValue *v) override {
          method visit (line 212) | void visit(SeriesFlow *v) override {
          method visit (line 234) | void visit(BodiedFunc *v) override {
          method preHook (line 241) | void preHook(Node *node) override {
          method getPrivateVars (line 253) | std::unordered_set<id_t> getPrivateVars() {
          method getSharedVars (line 263) | std::unordered_set<id_t> getSharedVars() {
          method getModVars (line 273) | std::unordered_set<id_t> getModVars() {
          method OutlineResult (line 285) | OutlineResult outline(bool allowOutflows = true) {
        function OutlineResult (line 391) | OutlineResult outlineRegion(BodiedFunc *parent, SeriesFlow *series,
        function OutlineResult (line 402) | OutlineResult outlineRegion(BodiedFunc *parent, SeriesFlow *series...

FILE: codon/cir/util/outlining.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/util/packs.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/util/side_effect.cpp
  type codon (line 6) | namespace codon {
    type ir (line 7) | namespace ir {
      type util (line 8) | namespace util {

FILE: codon/cir/util/side_effect.h
  function namespace (line 7) | namespace codon {

FILE: codon/cir/util/visitor.cpp
  type codon (line 7) | namespace codon {
    type ir (line 8) | namespace ir {
      type util (line 9) | namespace util {

FILE: codon/cir/util/visitor.h
  function namespace (line 12) | namespace codon {

FILE: codon/cir/value.cpp
  type codon (line 8) | namespace codon {
    type ir (line 9) | namespace ir {
      function Value (line 13) | Value *Value::operator==(Value &other) {
      function Value (line 17) | Value *Value::operator!=(Value &other) {
      function Value (line 21) | Value *Value::operator<(Value &other) {
      function Value (line 25) | Value *Value::operator>(Value &other) {
      function Value (line 29) | Value *Value::operator<=(Value &other) {
      function Value (line 33) | Value *Value::operator>=(Value &other) {
      function Value (line 37) | Value *Value::operator+() { return doUnaryOp(Module::POS_MAGIC_NAME); }
      function Value (line 39) | Value *Value::operator-() { return doUnaryOp(Module::NEG_MAGIC_NAME); }
      function Value (line 41) | Value *Value::operator~() { return doUnaryOp(Module::INVERT_MAGIC_NA...
      function Value (line 43) | Value *Value::operator+(Value &other) {
      function Value (line 47) | Value *Value::operator-(Value &other) {
      function Value (line 51) | Value *Value::operator*(Value &other) {
      function Value (line 55) | Value *Value::matMul(Value &other) {
      function Value (line 59) | Value *Value::trueDiv(Value &other) {
      function Value (line 63) | Value *Value::operator/(Value &other) {
      function Value (line 67) | Value *Value::operator%(Value &other) {
      function Value (line 71) | Value *Value::pow(Value &other) { return doBinaryOp(Module::POW_MAGI...
      function Value (line 73) | Value *Value::operator<<(Value &other) {
      function Value (line 77) | Value *Value::operator>>(Value &other) {
      function Value (line 81) | Value *Value::operator&(Value &other) {
      function Value (line 85) | Value *Value::operator|(Value &other) {
      function Value (line 89) | Value *Value::operator^(Value &other) {
      function Value (line 93) | Value *Value::operator||(Value &other) {
      function Value (line 98) | Value *Value::operator&&(Value &other) {
      function Value (line 103) | Value *Value::operator[](Value &other) {
      function Value (line 107) | Value *Value::toInt() { return doUnaryOp(Module::INT_MAGIC_NAME); }
      function Value (line 109) | Value *Value::toFloat() { return doUnaryOp(Module::FLOAT_MAGIC_NAME); }
      function Value (line 111) | Value *Value::toBool() { return doUnaryOp(Module::BOOL_MAGIC_NAME); }
      function Value (line 113) | Value *Value::toStr() { return doUnaryOp(Module::REPR_MAGIC_NAME); }
      function Value (line 115) | Value *Value::len() { return doUnaryOp(Module::LEN_MAGIC_NAME); }
      function Value (line 117) | Value *Value::iter() { return doUnaryOp(Module::ITER_MAGIC_NAME); }
      function Value (line 119) | Value *Value::doUnaryOp(const std::string &name) {
      function Value (line 131) | Value *Value::doBinaryOp(const std::string &name, Value &other) {
      function Value (line 143) | Value *Value::doCall(const std::vector<Value *> &args) {

FILE: codon/cir/value.h
  function namespace (line 9) | namespace codon {
  function virtual (line 115) | virtual int doReplaceUsedValue(id_t id, Value *newValue) { return 0; }

FILE: codon/cir/var.cpp
  type codon (line 7) | namespace codon {
    type ir (line 8) | namespace ir {

FILE: codon/cir/var.h
  function namespace (line 16) | namespace codon {
  function virtual (line 107) | virtual int doReplaceUsedValue(id_t id, Value *newValue) { return 0; }
  function virtual (line 109) | virtual std::vector<types::Type *> doGetUsedTypes() const { return {type...
  function virtual (line 113) | virtual int doReplaceUsedVariable(id_t id, Var *newVar) { return 0; }
  function Var (line 132) | Var *getVar() { return val; }
  function Var (line 134) | const Var *getVar() const { return val; }
  function setVar (line 137) | void setVar(Var *v) { val = v; }
  function override (line 142) | const override { return {val}; }
  function Var (line 172) | Var *getVar() { return val; }
  function Var (line 174) | const Var *getVar() const { return val; }
  function setVar (line 177) | void setVar(Var *v) { val = v; }
  function setFields (line 183) | void setFields(std::vector<std::string> f) { fields = std::move(f); }
  function override (line 188) | const override { return {val}; }

FILE: codon/compiler/compiler.cpp
  type codon (line 15) | namespace codon {
    function getPassManagerInit (line 17) | ir::transform::PassManager::Init getPassManagerInit(Compiler::Mode mod...

FILE: codon/compiler/compiler.h
  function namespace (line 17) | namespace codon {

FILE: codon/compiler/debug_listener.cpp
  type codon (line 11) | namespace codon {
    function makeBacktrace (line 13) | std::string

FILE: codon/compiler/debug_listener.h
  function namespace (line 12) | namespace codon {
  function class (line 56) | class DebugPlugin : public llvm::orc::ObjectLinkingLayer::Plugin {

FILE: codon/compiler/engine.cpp
  type codon (line 8) | namespace codon {
    type jit (line 9) | namespace jit {

FILE: codon/compiler/engine.h
  function namespace (line 11) | namespace codon {

FILE: codon/compiler/error.cpp
  type codon (line 5) | namespace codon {
    type error (line 42) | namespace error {
      function E (line 52) | void E(llvm::Error &&error) { throw exc::ParserException(std::move(e...
    type exc (line 56) | namespace exc {

FILE: codon/compiler/error.h
  function namespace (line 13) | namespace codon {

FILE: codon/compiler/jit.cpp
  type codon (line 15) | namespace codon {
    type jit (line 16) | namespace jit {
      function collectExecutableStmts (line 38) | void collectExecutableStmts(ast::Stmt *s, ast::SuiteStmt *final) {
      function buildKey (line 266) | std::string buildKey(const std::string &name, const std::vector<std:...
      function buildPythonWrapper (line 275) | std::string buildPythonWrapper(const std::string &name, const std::s...
  function jit_exit (line 386) | void jit_exit(void *jit) { delete ((codon::jit::JIT *)jit); }
  function CJITResult (line 388) | CJITResult jit_execute_python(void *jit, char *name, char **types, size_...
  function CJITResult (line 408) | CJITResult jit_execute_safe(void *jit, char *code, char *file, int32_t l...

FILE: codon/compiler/jit.h
  function namespace (line 23) | namespace codon {

FILE: codon/compiler/jit_extern.h
  type CJITResult (line 12) | struct CJITResult {
  type CJITResult (line 20) | struct CJITResult
  type CJITResult (line 24) | struct CJITResult

FILE: codon/compiler/memory_manager.cpp
  type codon (line 7) | namespace codon {
    class BoehmGCJITLinkMemoryManager::IPInFlightAlloc (line 9) | class BoehmGCJITLinkMemoryManager::IPInFlightAlloc
      method IPInFlightAlloc (line 12) | IPInFlightAlloc(BoehmGCJITLinkMemoryManager &MemMgr, llvm::jitlink::...
      method finalize (line 20) | void finalize(OnFinalizedFunction OnFinalized) override {
      method abandon (line 46) | void abandon(OnAbandonedFunction OnAbandoned) override {
      method applyProtections (line 56) | llvm::Error applyProtections() {

FILE: codon/compiler/memory_manager.h
  function namespace (line 11) | namespace codon {

FILE: codon/dsl/dsl.h
  function namespace (line 14) | namespace codon {

FILE: codon/dsl/plugins.cpp
  type codon (line 15) | namespace codon {
    function pluginError (line 17) | llvm::Expected<Plugin *> pluginError(const std::string &msg) {

FILE: codon/dsl/plugins.h
  function namespace (line 15) | namespace codon {

FILE: codon/parser/ast/attr.cpp
  type codon::ast (line 5) | namespace codon::ast {}

FILE: codon/parser/ast/attr.h
  function namespace (line 5) | namespace codon::ast {

FILE: codon/parser/ast/error.h
  function namespace (line 20) | namespace codon {
  function front (line 63) | struct ParserErrors {
  function explicit (line 82) | explicit ParserErrors(const ErrorMessage &msg) : errors{Backtrace{{msg}}}

FILE: codon/parser/ast/expr.cpp
  type codon::ast (line 30) | namespace codon::ast {
    function Param (line 72) | Param Param::clone(bool clean) const {
    function Expr (line 275) | Expr *GeneratorExpr::getFinalExpr() {
    function Stmt (line 303) | Stmt *GeneratorExpr::getFinalSuite() const { return loops; }
    function Stmt (line 304) | Stmt **GeneratorExpr::getFinalStmt() {
    function Pipe (line 376) | Pipe Pipe::clone(bool clean) const { return {op, ast::clone(expr, clea...
    function CallArg (line 408) | CallArg CallArg::clone(bool clean) const {
    function isId (line 555) | bool isId(Expr *e, const std::string &s) {
    function getStaticGeneric (line 560) | types::LiteralKind getStaticGeneric(Expr *e) {
  type tser (line 603) | namespace tser {

FILE: codon/parser/ast/expr.h
  function namespace (line 16) | namespace codon::ast {
  type BoolExpr (line 114) | struct BoolExpr
  type IntExpr (line 130) | struct IntExpr
  function hasStoredValue (line 135) | bool hasStoredValue() const;
  type ListExpr (line 273) | struct ListExpr
  type SetExpr (line 282) | struct SetExpr
  type DictExpr (line 292) | struct DictExpr
  type GeneratorExpr (line 302) | struct GeneratorExpr
  type GeneratorKind (line 304) | enum GeneratorKind {
  function loopCount (line 318) | int loopCount() const;
  type UnaryExpr (line 355) | struct UnaryExpr
  function Expr (line 360) | Expr *getExpr() const { return expr; }
  type BinaryExpr (line 372) | struct BinaryExpr
  function setOp (line 378) | void setOp(const std::string &o) { op = o; }
  function Expr (line 379) | Expr *getLhs() const { return lexpr; }
  function Expr (line 380) | Expr *getRhs() const { return rexpr; }
  type ChainBinaryExpr (line 395) | struct ChainBinaryExpr
  type Pipe (line 405) | struct Pipe {
  type PipeExpr (line 416) | struct PipeExpr
  type IndexExpr (line 430) | struct IndexExpr
  function Expr (line 434) | Expr *getExpr() const { return expr; }
  function Expr (line 435) | Expr *getIndex() const { return index; }
  type CallArg (line 443) | struct CallArg
  function Expr (line 452) | Expr *getExpr() const { return value; }
  function operator (line 453) | operator Expr *() const { return value; }
  type CallExpr (line 461) | struct CallExpr
  function Expr (line 471) | Expr *getExpr() const { return expr; }
  type DotExpr (line 487) | struct DotExpr
  function Expr (line 492) | Expr *getExpr() const { return expr; }
  type SliceExpr (line 506) | struct SliceExpr
  function Expr (line 510) | Expr *getStart() const { return start; }
  function Expr (line 511) | Expr *getStop() const { return stop; }
  function Expr (line 512) | Expr *getStep() const { return step; }
  type EllipsisExpr (line 523) | struct EllipsisExpr
  type EllipsisType (line 526) | enum EllipsisType { PIPE, PARTIAL, STANDALONE }
  type LambdaExpr (line 546) | struct LambdaExpr
  function Expr (line 550) | Expr *getExpr() const { return expr; }
  type YieldExpr (line 560) | struct YieldExpr
  type AwaitExpr (line 569) | struct AwaitExpr
  function Expr (line 573) | Expr *getExpr() const { return expr; }
  type AssignExpr (line 587) | struct AssignExpr
  function Expr (line 591) | Expr *getVar() const { return var; }
  function Expr (line 592) | Expr *getExpr() const { return expr; }
  type RangeExpr (line 603) | struct RangeExpr
  function Expr (line 607) | Expr *getStart() const { return start; }
  function Expr (line 608) | Expr *getStop() const { return stop; }
  type StmtExpr (line 622) | struct StmtExpr
  function Expr (line 628) | Expr *getExpr() const { return expr; }
  type InstantiateExpr (line 638) | struct InstantiateExpr
  function Expr (line 644) | Expr *getExpr() const { return expr; }
  function string_view (line 660) | struct fmt::formatter<codon::ast::CallArg> : fmt::formatter<std::string_...
  function string_view (line 671) | struct fmt::formatter<codon::ast::Param> : fmt::formatter<std::string_vi...
  function namespace (line 679) | namespace tser {

FILE: codon/parser/ast/node.h
  function namespace (line 10) | namespace codon::ast {
  function virtual (line 85) | virtual bool isConvertible(const void *other) const override {
  function explicit (line 91) | explicit Items(std::vector<T> items) : items(std::move(items)) {}
  function T (line 92) | const T &operator[](size_t i) const { return items[i]; }

FILE: codon/parser/ast/stmt.cpp
  type codon::ast (line 22) | namespace codon::ast {
    function SuiteStmt (line 72) | SuiteStmt *SuiteStmt::wrap(Stmt *s) {
    function MatchCase (line 225) | MatchCase MatchCase::clone(bool clean) const {
    class IdSearchVisitor (line 404) | class IdSearchVisitor : public CallbackASTVisitor<bool, bool> {
      method IdSearchVisitor (line 409) | IdSearchVisitor(std::string what) : what(std::move(what)), result(fa...
      method transform (line 410) | bool transform(Expr *expr) override {
      method transform (line 418) | bool transform(Stmt *stmt) override {
      method visit (line 426) | void visit(IdExpr *expr) override {
  type tser (line 632) | namespace tser {

FILE: codon/parser/ast/stmt.h
  function namespace (line 14) | namespace codon::ast {
  type ContinueStmt (line 92) | struct ContinueStmt
  type ExprStmt (line 101) | struct ExprStmt
  function Expr (line 105) | Expr *getExpr() const { return expr; }
  type AssignStmt (line 117) | struct AssignStmt
  type UpdateMode (line 118) | enum UpdateMode { Assign, Update, UpdateAtomic, ThreadLocalAssign }
  function Expr (line 126) | Expr *getLhs() const { return lhs; }
  function Expr (line 127) | Expr *getRhs() const { return rhs; }
  function Expr (line 128) | Expr *getTypeExpr() const { return type; }
  function setLhs (line 130) | void setLhs(Expr *expr) { lhs = expr; }
  function setRhs (line 131) | void setRhs(Expr *expr) { rhs = expr; }
  function isThreadLocal (line 136) | bool isThreadLocal() { return update == ThreadLocalAssign; }
  function setUpdate (line 137) | void setUpdate() { update = Update; }
  function setAtomicUpdate (line 138) | void setAtomicUpdate() { update = UpdateAtomic; }
  function setThreadLocal (line 139) | void setThreadLocal() { update = ThreadLocalAssign; }
  type DelStmt (line 151) | struct DelStmt
  function Expr (line 155) | Expr *getExpr() const { return expr; }
  type PrintStmt (line 165) | struct PrintStmt
  type ReturnStmt (line 181) | struct ReturnStmt
  function Expr (line 185) | Expr *getExpr() const { return expr; }
  type YieldStmt (line 197) | struct YieldStmt
  function Expr (line 201) | Expr *getExpr() const { return expr; }
  type AssertStmt (line 213) | struct AssertStmt
  function Expr (line 217) | Expr *getExpr() const { return expr; }
  function Expr (line 218) | Expr *getMessage() const { return message; }
  type WhileStmt (line 232) | struct WhileStmt
  function Expr (line 237) | Expr *getCond() const { return cond; }
  function SuiteStmt (line 238) | SuiteStmt *getSuite() const { return suite; }
  function SuiteStmt (line 239) | SuiteStmt *getElse() const { return elseSuite; }
  type ForStmt (line 258) | struct ForStmt
  function Expr (line 267) | Expr *getVar() const { return var; }
  function Expr (line 268) | Expr *getIter() const { return iter; }
  function SuiteStmt (line 269) | SuiteStmt *getSuite() const { return suite; }
  function SuiteStmt (line 270) | SuiteStmt *getElse() const { return elseSuite; }
  function Expr (line 271) | Expr *getDecorator() const { return decorator; }
  function setDecorator (line 272) | void setDecorator(Expr *e) { decorator = e; }
  function setAsync (line 274) | void setAsync() { async = true; }
  type IfStmt (line 306) | struct IfStmt
  function Expr (line 310) | Expr *getCond() const { return cond; }
  function SuiteStmt (line 311) | SuiteStmt *getIf() const { return ifSuite; }
  function SuiteStmt (line 312) | SuiteStmt *getElse() const { return elseSuite; }
  type MatchCase (line 324) | struct MatchCase {
  function SuiteStmt (line 329) | SuiteStmt *getSuite() const { return suite; }
  type MatchStmt (line 349) | struct MatchStmt
  function Expr (line 353) | Expr *getExpr() const { return expr; }
  type ImportStmt (line 373) | struct ImportStmt
  function Expr (line 379) | Expr *getFrom() const { return from; }
  function Expr (line 380) | Expr *getWhat() const { return what; }
  function Expr (line 383) | Expr *getReturnType() const { return ret; }
  type ExceptStmt (line 402) | struct ExceptStmt
  function Expr (line 407) | Expr *getException() const { return exc; }
  function SuiteStmt (line 408) | SuiteStmt *getSuite() const { return suite; }
  type TryStmt (line 429) | struct TryStmt
  function SuiteStmt (line 434) | SuiteStmt *getSuite() const { return suite; }
  function SuiteStmt (line 435) | SuiteStmt *getElse() const { return elseSuite; }
  function SuiteStmt (line 436) | SuiteStmt *getFinally() const { return finally; }
  type ThrowStmt (line 450) | struct ThrowStmt
  function Expr (line 455) | Expr *getExpr() const { return expr; }
  function Expr (line 456) | Expr *getFrom() const { return from; }
  type GlobalStmt (line 471) | struct GlobalStmt
  type FunctionStmt (line 488) | struct FunctionStmt
  function setName (line 495) | void setName(const std::string &n) { name = n; }
  function Expr (line 496) | Expr *getReturn() const { return ret; }
  function SuiteStmt (line 497) | SuiteStmt *getSuite() const { return suite; }
  function setSuite (line 498) | void setSuite(SuiteStmt *s) { suite = s; }
  function setDecorators (line 500) | void setDecorators(const std::vector<Expr *> &d) { decorators = d; }
  function setAsync (line 502) | void setAsync() { async = true; }
  function addParam (line 503) | void addParam(const Param &p) { items.push_back(p); }
  function getStarArgs (line 509) | size_t getStarArgs() const;
  function setDecorators (line 543) | void setDecorators(const std::vector<Expr *> &d) { decorators = d; }
  type YieldFromStmt (line 566) | struct YieldFromStmt
  function Expr (line 570) | Expr *getExpr() const { return expr; }
  type WithStmt (line 580) | struct WithStmt
  function SuiteStmt (line 587) | SuiteStmt *getSuite() const { return suite; }
  function setAsync (line 590) | void setAsync() { async = true; }
  type CustomStmt (line 603) | struct CustomStmt
  function Expr (line 608) | Expr *getExpr() const { return expr; }
  function SuiteStmt (line 609) | SuiteStmt *getSuite() const { return suite; }
  type DirectiveStmt (line 619) | struct DirectiveStmt
  type AssignMemberStmt (line 636) | struct AssignMemberStmt
  function Expr (line 641) | Expr *getLhs() const { return lhs; }
  function Expr (line 643) | Expr *getRhs() const { return rhs; }
  function Expr (line 644) | Expr *getTypeExpr() const { return type; }
  type CommentStmt (line 657) | struct CommentStmt
  function namespace (line 673) | namespace tser {

FILE: codon/parser/ast/types/class.cpp
  type codon::ast::types (line 10) | namespace codon::ast::types {
    function TypePtr (line 160) | TypePtr ClassType::generalize(int atLevel) const {
    function TypePtr (line 172) | TypePtr ClassType::instantiate(int atLevel, int *unboundCount,
    function FuncType (line 336) | FuncType *ClassType::getPartialFunc() const {

FILE: codon/parser/ast/types/class.h
  function namespace (line 11) | namespace codon::ast::types {
  function string_view (line 90) | struct fmt::formatter<codon::ast::types::ClassType::Generic>

FILE: codon/parser/ast/types/function.cpp
  type codon::ast::types (line 11) | namespace codon::ast::types {
    function TypePtr (line 44) | TypePtr FuncType::generalize(int atLevel) const {
    function TypePtr (line 55) | TypePtr FuncType::instantiate(int atLevel, int *unboundCount,
    function Type (line 198) | Type *FuncType::getRetType() const { return generics[1].type.get(); }
    function Type (line 202) | Type *FuncType::operator[](size_t i) const {

FILE: codon/parser/ast/types/function.h
  function namespace (line 13) | namespace codon::ast {
  function namespace (line 17) | namespace codon::ast::types {

FILE: codon/parser/ast/types/link.cpp
  type codon::ast::types (line 11) | namespace codon::ast::types {
    function TypePtr (line 96) | TypePtr LinkType::generalize(int atLevel) const {
    function TypePtr (line 119) | TypePtr LinkType::instantiate(int atLevel, int *unboundCount,
    function Type (line 146) | Type *LinkType::follow() {
    function LinkType (line 206) | LinkType *LinkType::getLink() { return this; }
    function FuncType (line 208) | FuncType *LinkType::getFunc() { return kind == Link ? type->getFunc() ...
    function ClassType (line 210) | ClassType *LinkType::getPartial() {
    function ClassType (line 214) | ClassType *LinkType::getClass() { return kind == Link ? type->getClass...
    function StaticType (line 216) | StaticType *LinkType::getStatic() { return kind == Link ? type->getSta...
    function IntStaticType (line 218) | IntStaticType *LinkType::getIntStatic() {
    function StrStaticType (line 222) | StrStaticType *LinkType::getStrStatic() {
    function BoolStaticType (line 226) | BoolStaticType *LinkType::getBoolStatic() {
    function UnionType (line 230) | UnionType *LinkType::getUnion() { return kind == Link ? type->getUnion...
    function LinkType (line 232) | LinkType *LinkType::getUnbound() {

FILE: codon/parser/ast/types/link.h
  function namespace (line 13) | namespace codon::ast::types {

FILE: codon/parser/ast/types/static.cpp
  type codon::ast::types (line 12) | namespace codon::ast::types {
    function Type (line 23) | Type *StaticType::getNonStaticType() const { return cache->findClass(n...
    function TypePtr (line 42) | TypePtr IntStaticType::generalize(int atLevel) const {
    function TypePtr (line 48) | TypePtr IntStaticType::instantiate(int atLevel, int *unboundCount,
    function Expr (line 59) | Expr *IntStaticType::getStaticExpr() const { return cache->N<IntExpr>(...
    function TypePtr (line 78) | TypePtr StrStaticType::generalize(int atLevel) const {
    function TypePtr (line 84) | TypePtr StrStaticType::instantiate(int atLevel, int *unboundCount,
    function Expr (line 96) | Expr *StrStaticType::getStaticExpr() const { return cache->N<StringExp...
    function TypePtr (line 115) | TypePtr BoolStaticType::generalize(int atLevel) const {
    function TypePtr (line 121) | TypePtr BoolStaticType::instantiate(int atLevel, int *unboundCount,
    function Expr (line 133) | Expr *BoolStaticType::getStaticExpr() const { return cache->N<BoolExpr...

FILE: codon/parser/ast/types/static.h
  function namespace (line 11) | namespace codon::ast::types {

FILE: codon/parser/ast/types/traits.cpp
  type codon::ast::types (line 11) | namespace codon::ast::types {
    function TypePtr (line 188) | TypePtr CallableTrait::generalize(int atLevel) const {
    function TypePtr (line 197) | TypePtr CallableTrait::instantiate(int atLevel, int *unboundCount,
    function TypePtr (line 225) | TypePtr TypeTrait::generalize(int atLevel) const {
    function TypePtr (line 231) | TypePtr TypeTrait::instantiate(int atLevel, int *unboundCount,

FILE: codon/parser/ast/types/traits.h
  function namespace (line 12) | namespace codon::ast::types {

FILE: codon/parser/ast/types/type.cpp
  type codon::ast::types (line 11) | namespace codon::ast::types {
    function Type (line 36) | Type *Type::follow() { return this; }
    function LiteralKind (line 48) | LiteralKind Type::getStaticKind() {
    function LiteralKind (line 56) | LiteralKind Type::literalFromString(const std::string &s) {
    function Type (line 76) | Type *Type::operator<<(Type *t) {

FILE: codon/parser/ast/types/type.h
  function namespace (line 12) | namespace codon::ast {
  function namespace (line 18) | namespace codon::ast::types {
  function decltype (line 143) | constexpr auto parse(const format_parse_context &ctx) -> decltype(ctx.be...

FILE: codon/parser/ast/types/union.cpp
  type codon::ast::types (line 13) | namespace codon::ast::types {
    function TypePtr (line 65) | TypePtr UnionType::generalize(int atLevel) const {
    function TypePtr (line 75) | TypePtr UnionType::instantiate(int atLevel, int *unboundCount,

FILE: codon/parser/ast/types/union.h
  function namespace (line 12) | namespace codon::ast::types {

FILE: codon/parser/cache.cpp
  type codon::ast (line 18) | namespace codon::ast {
    function SrcInfo (line 46) | SrcInfo Cache::generateSrcInfo() {

FILE: codon/parser/cache.h
  function namespace (line 46) | namespace codon {
  function namespace (line 50) | namespace codon::ast {
  type Function (line 208) | struct Function {

FILE: codon/parser/common.cpp
  type codon::ast (line 20) | namespace codon::ast {
    function ImportFile (line 37) | ImportFile IFilesystem::get_root(const path_t &sp) const {
    function split (line 150) | std::vector<std::string> split(const std::string &s, char delim) {
    function escape (line 159) | std::string escape(const std::string &str) {
    function unescape (line 182) | std::string unescape(const std::string &str) {
    function escapeFStringBraces (line 223) | std::string escapeFStringBraces(const std::string &str, int start, int...
    function findStar (line 235) | int findStar(const std::string &s) {
    function in (line 245) | bool in(const std::string &m, char item) {
    function in (line 249) | bool in(const std::string &m, const std::string &item) {
    function startswith (line 253) | size_t startswith(const std::string &str, const std::string &prefix) {
    function endswith (line 260) | size_t endswith(const std::string &str, const std::string &suffix) {
    function ltrim (line 268) | void ltrim(std::string &str) {
    function rtrim (line 272) | void rtrim(std::string &str) {
    function isdigit (line 279) | bool isdigit(const std::string &str) { return std::ranges::all_of(str,...
    function library_path (line 286) | std::string library_path() {
    function getImportFile (line 348) | std::shared_ptr<ImportFile> getImportFile(Cache *cache, const std::str...
    function getMangledClass (line 422) | std::string getMangledClass(const std::string &module, const std::stri...
    function getMangledFunc (line 432) | std::string getMangledFunc(const std::string &module, const std::strin...
    function getMangledMethod (line 443) | std::string getMangledMethod(const std::string &module, const std::str...
    function getMangledVar (line 454) | std::string getMangledVar(const std::string &module, const std::string...

FILE: codon/parser/common.h
  function namespace (line 17) | namespace codon {

FILE: codon/parser/ctx.h
  function namespace (line 16) | namespace codon::ast {

FILE: codon/parser/match.cpp
  type codon::matcher (line 5) | namespace codon::matcher {
    function match_zero_or_more_t (line 7) | match_zero_or_more_t MAny() { return match_zero_or_more_t(); }
    function match_startswith_t (line 9) | match_startswith_t MStarts(std::string s) { return match_startswith_t{...
    function match_endswith_t (line 11) | match_endswith_t MEnds(std::string s) { return match_endswith_t{std::m...
    function match_contains_t (line 13) | match_contains_t MContains(std::string s) { return match_contains_t{st...
    function match (line 15) | bool match(const char *c, const char *d) {
    function match (line 19) | bool match(const char *c, std::string d) { return std::string(c) == d; }
    function match (line 21) | bool match(std::string c, const char *d) { return std::string(d) == c; }
    function match (line 23) | bool match(double &a, double b) {
    function match (line 27) | bool match(std::string s, match_startswith_t m) {
    function match (line 31) | bool match(std::string s, match_endswith_t m) {
    function match (line 35) | bool match(std::string s, match_contains_t m) {
    function match (line 39) | bool match(const char *s, match_startswith_t m) {
    function match (line 43) | bool match(const char *s, match_endswith_t m) {
    function match (line 47) | bool match(const char *s, match_contains_t m) {

FILE: codon/parser/match.h
  function args (line 20) | match_or_t(MA... args) : args(std::tuple<MA...>(args...)) {}
  type match_ignore_t (line 23) | struct match_ignore_t {}
  type match_zero_or_more_t (line 25) | struct match_zero_or_more_t {}
  type match_startswith_t (line 27) | struct match_startswith_t {
  type match_endswith_t (line 31) | struct match_endswith_t {
  type match_contains_t (line 35) | struct match_contains_t {

FILE: codon/parser/peg/peg.cpp
  type codon::ast (line 20) | namespace codon::ast {
    function initParser (line 25) | std::shared_ptr<peg::Grammar> initParser() {
    function parseCode (line 57) | llvm::Expected<T> parseCode(Cache *cache, const std::string &file,
    function parseCode (line 90) | llvm::Expected<Stmt *> parseCode(Cache *cache, const std::string &file,
    function parseExpr (line 95) | llvm::Expected<std::pair<Expr *, StringExpr::FormatSpec>>
    function parseFile (line 104) | llvm::Expected<Stmt *> parseFile(Cache *cache, const std::string &file) {
    function initOpenMPParser (line 113) | std::shared_ptr<peg::Grammar> initOpenMPParser() {
    function parseOpenMP (line 125) | llvm::Expected<std::vector<CallArg>> parseOpenMP(Cache *cache, const s...

FILE: codon/parser/peg/peg.h
  function namespace (line 11) | namespace codon::ast {

FILE: codon/parser/peg/rules.h
  function namespace (line 11) | namespace codon::ast {

FILE: codon/parser/visitors/doc/doc.cpp
  type codon::ast (line 16) | namespace codon::ast {
    function json_escape (line 22) | std::string json_escape(const std::string &str) {
    function getDocstr (line 149) | std::string getDocstr(Stmt *s) {
    function isValidName (line 256) | bool isValidName(const std::string &s) {

FILE: codon/parser/visitors/doc/doc.h
  function namespace (line 16) | namespace codon::ast {

FILE: codon/parser/visitors/format/format.cpp
  type codon (line 8) | namespace codon {
    type ast (line 9) | namespace ast {

FILE: codon/parser/visitors/format/format.h
  function string (line 44) | string renderComment(const char *fmt, Ts &&...args) {
  function defaultVisit (line 68) | void defaultVisit(Expr *e) override { seqassertn(false, "cannot format {...
  function defaultVisit (line 69) | void defaultVisit(Stmt *e) override { seqassertn(false, "cannot format {...

FILE: codon/parser/visitors/scoping/scoping.cpp
  type codon::ast (line 27) | namespace codon::ast {
    function format_as (line 954) | auto format_as(BindingsAttribute::CaptureType c) {

FILE: codon/parser/visitors/scoping/scoping.h
  function namespace (line 16) | namespace codon::ast {
  type Context (line 48) | struct Context {
  function ConditionalBlock (line 112) | struct ConditionalBlock {
  function addError (line 141) | void addError(llvm::Error &&e) {

FILE: codon/parser/visitors/translate/translate.cpp
  type codon::ast (line 20) | namespace codon::ast {
    class IdVisitor (line 221) | class IdVisitor : public CallbackASTVisitor<bool, bool> {
      method transform (line 225) | bool transform(Expr *expr) override {
      method transform (line 232) | bool transform(Stmt *stmt) override {
      method visit (line 239) | void visit(IdExpr *expr) override { ids.insert(expr->getValue()); }

FILE: codon/parser/visitors/translate/translate.h
  function namespace (line 13) | namespace codon::ast {

FILE: codon/parser/visitors/translate/translate_ctx.cpp
  type codon::ast (line 14) | namespace codon::ast {

FILE: codon/parser/visitors/translate/translate_ctx.h
  function namespace (line 15) | namespace codon::ast {
  type TranslateContext (line 46) | struct TranslateContext

FILE: codon/parser/visitors/typecheck/access.cpp
  type codon::ast (line 16) | namespace codon::ast {
    function Expr (line 520) | Expr *TypecheckVisitor::getClassMember(DotExpr *expr) {

FILE: codon/parser/visitors/typecheck/assign.cpp
  type codon::ast (line 17) | namespace codon::ast {
    function Stmt (line 103) | Stmt *TypecheckVisitor::unpackAssignment(Expr *lhs, Expr *rhs) {
    function Stmt (line 178) | Stmt *TypecheckVisitor::transformAssignment(AssignStmt *stmt, bool mus...
    function Stmt (line 338) | Stmt *TypecheckVisitor::transformUpdate(AssignStmt *stmt) {

FILE: codon/parser/visitors/typecheck/basic.cpp
  type codon::ast (line 11) | namespace codon::ast {
    function Expr (line 98) | Expr *TypecheckVisitor::transformInt(IntExpr *expr) {
    function Expr (line 148) | Expr *TypecheckVisitor::transformFloat(FloatExpr *expr) {

FILE: codon/parser/visitors/typecheck/call.cpp
  type codon::ast (line 13) | namespace codon::ast {
    function Expr (line 444) | Expr *TypecheckVisitor::callReorderArguments(FuncType *calleeFn, CallE...
    function Expr (line 990) | Expr *TypecheckVisitor::generatePartialCall(const std::string &mask,

FILE: codon/parser/visitors/typecheck/class.cpp
  type codon::ast (line 16) | namespace codon::ast {
    function Stmt (line 605) | Stmt *TypecheckVisitor::codegenMagic(const std::string &op, Expr *typE...

FILE: codon/parser/visitors/typecheck/collections.cpp
  type codon::ast (line 10) | namespace codon::ast {
    function Expr (line 173) | Expr *TypecheckVisitor::transformComprehension(const std::string &type,

FILE: codon/parser/visitors/typecheck/cond.cpp
  type codon::ast (line 8) | namespace codon::ast {
    function evaluateStaticCondition (line 15) | auto evaluateStaticCondition(Expr *cond, TT ready, TF notReady) {
    function Stmt (line 164) | Stmt *TypecheckVisitor::transformPattern(Expr *var, Expr *pattern, Stm...

FILE: codon/parser/visitors/typecheck/ctx.cpp
  type codon::ast (line 17) | namespace codon::ast {

FILE: codon/parser/visitors/typecheck/ctx.h
  function namespace (line 16) | namespace codon::ast {

FILE: codon/parser/visitors/typecheck/error.cpp
  type codon::ast (line 8) | namespace codon::ast {

FILE: codon/parser/visitors/typecheck/function.cpp
  type codon::ast (line 17) | namespace codon::ast {
    function Stmt (line 683) | Stmt *TypecheckVisitor::transformPythonDefinition(const std::string &n...
    function Stmt (line 719) | Stmt *TypecheckVisitor::transformLLVMDefinition(Stmt *codeStmt) {

FILE: codon/parser/visitors/typecheck/import.cpp
  type codon::ast (line 19) | namespace codon::ast {
    function Stmt (line 139) | Stmt *TypecheckVisitor::transformSpecialImport(const ImportStmt *stmt) {
    function Stmt (line 193) | Stmt *TypecheckVisitor::transformCImport(const std::string &name,
    function Stmt (line 232) | Stmt *TypecheckVisitor::transformCVarImport(const std::string &name, E...
    function Stmt (line 253) | Stmt *TypecheckVisitor::transformCDLLImport(Expr *dylib, const std::st...
    function Stmt (line 287) | Stmt *TypecheckVisitor::transformPythonImport(Expr *what,
    function Stmt (line 341) | Stmt *TypecheckVisitor::transformNewImport(const ImportFile &file) {

FILE: codon/parser/visitors/typecheck/infer.cpp
  type codon::ast (line 22) | namespace codon::ast {
    function Type (line 32) | Type *TypecheckVisitor::unify(Type *a, Type *b) const {
    function Stmt (line 47) | Stmt *TypecheckVisitor::inferTypes(Stmt *result, bool isToplevel) {

FILE: codon/parser/visitors/typecheck/loops.cpp
  type codon::ast (line 13) | namespace codon::ast {
    function Expr (line 221) | Expr *TypecheckVisitor::transformForDecorator(Expr *decorator) {

FILE: codon/parser/visitors/typecheck/op.cpp
  type codon::ast (line 14) | namespace codon::ast {
    function Expr (line 562) | Expr *TypecheckVisitor::evaluateStaticUnary(const UnaryExpr *expr) {
    function divMod (line 622) | std::pair<int64_t, int64_t> divMod(const std::shared_ptr<TypeContext> ...
    function Expr (line 646) | Expr *TypecheckVisitor::evaluateStaticBinary(const BinaryExpr *expr) {
    function Expr (line 758) | Expr *TypecheckVisitor::transformBinarySimple(const BinaryExpr *expr) {
    function Expr (line 829) | Expr *TypecheckVisitor::transformBinaryIs(const BinaryExpr *expr) {
    function Expr (line 922) | Expr *TypecheckVisitor::transformBinaryInplaceMagic(BinaryExpr *expr, ...
    function Expr (line 953) | Expr *TypecheckVisitor::transformBinaryMagic(const BinaryExpr *expr) {

FILE: codon/parser/visitors/typecheck/special.cpp
  type codon::ast (line 20) | namespace codon::ast {
    function SuiteStmt (line 72) | SuiteStmt *TypecheckVisitor::generateClassPopulateVTablesAST() {
    function SuiteStmt (line 108) | SuiteStmt *TypecheckVisitor::generateBaseDerivedDistAST(FuncType *f) {
    function FunctionStmt (line 141) | FunctionStmt *TypecheckVisitor::generateThunkAST(const FuncType *fp, C...
    function SuiteStmt (line 203) | SuiteStmt *TypecheckVisitor::generateGetThunkIDAst(types::FuncType *f) {
    function SuiteStmt (line 269) | SuiteStmt *TypecheckVisitor::generateFunctionCallInternalAST(FuncType ...
    function SuiteStmt (line 296) | SuiteStmt *TypecheckVisitor::generateUnionNewAST(const FuncType *type) {
    function SuiteStmt (line 306) | SuiteStmt *TypecheckVisitor::generateUnionTagAST(FuncType *type) {
    function SuiteStmt (line 320) | SuiteStmt *TypecheckVisitor::generateNamedKeysAST(FuncType *type) {
    function SuiteStmt (line 331) | SuiteStmt *TypecheckVisitor::generateTupleMulAST(FuncType *type) {
    function SuiteStmt (line 346) | SuiteStmt *TypecheckVisitor::generateSpecialAst(types::FuncType *type) {
    function Expr (line 381) | Expr *TypecheckVisitor::transformNamedTuple(CallExpr *expr) {
    function Expr (line 419) | Expr *TypecheckVisitor::transformFunctoolsPartial(CallExpr *expr) {
    function Expr (line 437) | Expr *TypecheckVisitor::transformSuperF(CallExpr *expr) {
    function Expr (line 476) | Expr *TypecheckVisitor::transformSuper() {
    function Expr (line 529) | Expr *TypecheckVisitor::transformPtr(CallExpr *expr) {
    function Expr (line 562) | Expr *TypecheckVisitor::transformArray(CallExpr *expr) {
    function Expr (line 576) | Expr *TypecheckVisitor::transformIsInstance(CallExpr *expr) {
    function Expr (line 676) | Expr *TypecheckVisitor::transformStaticLen(CallExpr *expr) {
    function Expr (line 702) | Expr *TypecheckVisitor::transformHasAttr(CallExpr *expr) {
    function Expr (line 762) | Expr *TypecheckVisitor::transformGetAttr(CallExpr *expr) {
    function Expr (line 783) | Expr *TypecheckVisitor::transformSetAttr(CallExpr *expr) {
    function Expr (line 791) | Expr *TypecheckVisitor::transformCompileError(CallExpr *expr) const {
    function Expr (line 798) | Expr *TypecheckVisitor::transformTupleFn(CallExpr *expr) {
    function Expr (line 832) | Expr *TypecheckVisitor::transformTypeFn(CallExpr *expr) {
    function Expr (line 845) | Expr *TypecheckVisitor::transformRealizedFn(CallExpr *expr) {
    function Expr (line 872) | Expr *TypecheckVisitor::transformStaticPrintFn(CallExpr *expr) const {
    function Expr (line 883) | Expr *TypecheckVisitor::transformHasRttiFn(const CallExpr *expr) {
    function Expr (line 894) | Expr *TypecheckVisitor::transformStaticFnCanCall(CallExpr *expr) {
    function Expr (line 926) | Expr *TypecheckVisitor::transformStaticFnArgHasType(CallExpr *expr) {
    function Expr (line 940) | Expr *TypecheckVisitor::transformStaticFnArgGetType(CallExpr *expr) {
    function Expr (line 952) | Expr *TypecheckVisitor::transformStaticFnArgs(CallExpr *expr) {
    function Expr (line 967) | Expr *TypecheckVisitor::transformStaticFnHasDefault(CallExpr *expr) {
    function Expr (line 982) | Expr *TypecheckVisitor::transformStaticFnGetDefault(CallExpr *expr) {
    function Expr (line 994) | Expr *TypecheckVisitor::transformStaticFnWrapCallArgs(CallExpr *expr) {
    function Expr (line 1027) | Expr *TypecheckVisitor::transformStaticVars(CallExpr *expr) {
    function Expr (line 1054) | Expr *TypecheckVisitor::transformStaticTupleType(const CallExpr *expr) {
    function Expr (line 1070) | Expr *TypecheckVisitor::transformStaticFormat(CallExpr *expr) {
    function Expr (line 1089) | Expr *TypecheckVisitor::transformStaticIntToStr(CallExpr *expr) {

FILE: codon/parser/visitors/typecheck/typecheck.cpp
  type codon::ast (line 21) | namespace codon::ast {
    function Stmt (line 32) | Stmt *TypecheckVisitor::apply(
    function Stmt (line 176) | Stmt *TypecheckVisitor::apply(const std::shared_ptr<TypeContext> &ctx,...
    function Expr (line 207) | Expr *TypecheckVisitor::transform(Expr *expr) { return transform(expr,...
    function Expr (line 210) | Expr *TypecheckVisitor::transform(Expr *expr, bool allowTypes) {
    function Expr (line 254) | Expr *TypecheckVisitor::transformType(Expr *expr, bool simple) {
    function Stmt (line 289) | Stmt *TypecheckVisitor::transform(Stmt *stmt) {
    function Expr (line 944) | Expr *TypecheckVisitor::castToSuperClass(Expr *expr, ClassType *superTyp,
    function Expr (line 1297) | Expr *TypecheckVisitor::getParamType(Type *t) {
    function Expr (line 1315) | Expr *TypecheckVisitor::getHeadExpr(Expr *e) {
    class SearchVisitor (line 1607) | class SearchVisitor : public CallbackASTVisitor<void, void> {
      method SearchVisitor (line 1615) | SearchVisitor(const std::function<bool(Expr *)> &exprPredicate,
      method transform (line 1618) | void transform(Expr *expr) override {
      method transform (line 1628) | void transform(Stmt *stmt) override {
    function ParserErrors (line 1637) | ParserErrors TypecheckVisitor::findTypecheckErrors(Stmt *n) const {

FILE: codon/parser/visitors/typecheck/typecheck.h
  function namespace (line 17) | namespace codon::ast {

FILE: codon/parser/visitors/visitor.cpp
  type codon::ast (line 7) | namespace codon::ast {

FILE: codon/parser/visitors/visitor.h
  type ASTVisitor (line 17) | struct ASTVisitor {

FILE: codon/runtime/exc.cpp
  type unw_dynamic_unwind_sections (line 38) | struct unw_dynamic_unwind_sections {
  function find_dynamic_unwind_sections (line 46) | int find_dynamic_unwind_sections(uintptr_t addr, unw_dynamic_unwind_sect...
  type unw_dynamic_unwind_sections (line 57) | struct unw_dynamic_unwind_sections
  type BacktraceFrame (line 60) | struct BacktraceFrame {
  type Backtrace (line 67) | struct Backtrace {
    type BacktraceFrame (line 69) | struct BacktraceFrame
    method push_back (line 72) | void push_back(const char *function, const char *filename, uintptr_t pc,
    method push_back (line 91) | void push_back(uintptr_t pc) { push_back("<invalid>", "<invalid>", pc,...
    method free (line 93) | void free() {
  function seq_backtrace_error_callback (line 105) | void seq_backtrace_error_callback(void *data, const char *msg, int errnu...
  function seq_backtrace_full_callback (line 109) | int seq_backtrace_full_callback(void *data, uintptr_t pc, const char *fi...
  function seq_backtrace_simple_callback (line 116) | int seq_backtrace_simple_callback(void *data, uintptr_t pc) {
  function ReadType (line 128) | static uintptr_t ReadType(const uint8_t *&p) {
  type TypeInfo (line 137) | struct TypeInfo {
  type RTTIObject (line 145) | struct RTTIObject {
  type CodonBaseExceptionType (line 150) | struct CodonBaseExceptionType {
  type CodonBaseException (line 154) | struct CodonBaseException {
  type CodonExceptionHeader (line 160) | struct CodonExceptionHeader {
  function seq_exc_init (line 170) | void seq_exc_init(int flags) {
  function seq_delete_exc (line 182) | static void seq_delete_exc(_Unwind_Exception *expToDelete) {
  function seq_delete_unwind_exc (line 192) | static void seq_delete_unwind_exc(_Unwind_Reason_Code reason,
  type backtrace_state (line 197) | struct backtrace_state
  function SEQ_FUNC (line 200) | SEQ_FUNC void *seq_alloc_exc(void *obj) {
  function print_from_last_dot (line 230) | static void print_from_last_dot(seq_str_t s, std::ostringstream &buf) {
  function SEQ_FUNC (line 247) | SEQ_FUNC void seq_terminate(void *exc) {
  function SEQ_FUNC (line 322) | SEQ_FUNC void seq_throw(void *exc) {
  function readULEB128 (line 328) | static uintptr_t readULEB128(const uint8_t **data) {
  function readSLEB128 (line 345) | static uintptr_t readSLEB128(const uint8_t **data) {
  function getEncodingSize (line 366) | static unsigned getEncodingSize(uint8_t encoding) {
  function readEncodedPointer (line 391) | static uintptr_t readEncodedPointer(const uint8_t **data, uint8_t encodi...
  function isinstance (line 460) | static bool isinstance(void *obj, seq_int_t type) {
  function handleActionValue (line 475) | static bool handleActionValue(int64_t *resultAction, uint8_t TTypeEncoding,
  function _Unwind_Reason_Code (line 524) | static _Unwind_Reason_Code handleLsda(int version, const uint8_t *lsda,
  function SEQ_FUNC (line 641) | SEQ_FUNC _Unwind_Reason_Code seq_personality(int version, _Unwind_Action...
  function SEQ_FUNC (line 650) | SEQ_FUNC int64_t seq_exc_offset() {

FILE: codon/runtime/floatlib/extenddftf2.c
  function COMPILER_RT_ABI (line 17) | COMPILER_RT_ABI fp_t __extenddftf2(double a) {

FILE: codon/runtime/floatlib/extendhfsf2.c
  function __extendhfsf2 (line 15) | float __extendhfsf2(src_t a) {
  function COMPILER_RT_ABI (line 19) | COMPILER_RT_ABI float __gnu_h2f_ieee(src_t a) { return __extendhfsf2(a); }
  function AEABI_RTABI (line 23) | AEABI_RTABI float __aeabi_h2f(src_t a) { return __extendhfsf2(a); }

FILE: codon/runtime/floatlib/extendhftf2.c
  function __extendhftf2 (line 18) | COMPILER_RT_ABI long double __extendhftf2(_Float16 a) {

FILE: codon/runtime/floatlib/extendsfdf2.c
  function COMPILER_RT_ABI (line 13) | COMPILER_RT_ABI double __extendsfdf2(float a) { return __extendXfYf2__(a...
  function AEABI_RTABI (line 17) | AEABI_RTABI double __aeabi_f2d(float a) { return __extendsfdf2(a); }

FILE: codon/runtime/floatlib/extendsftf2.c
  function COMPILER_RT_ABI (line 17) | COMPILER_RT_ABI fp_t __extendsftf2(float a) {

FILE: codon/runtime/floatlib/fp_extend.h
  type src_t (line 20) | typedef float src_t;
  type src_rep_t (line 21) | typedef uint32_t src_rep_t;
  type src_t (line 27) | typedef double src_t;
  type src_rep_t (line 28) | typedef uint64_t src_rep_t;
  function src_rep_t_clz (line 31) | static __inline int src_rep_t_clz(src_rep_t a) {
  type _Float16 (line 44) | typedef _Float16 src_t;
  type src_t (line 46) | typedef uint16_t src_t;
  type src_rep_t (line 48) | typedef uint16_t src_rep_t;
  type dst_t (line 58) | typedef float dst_t;
  type dst_rep_t (line 59) | typedef uint32_t dst_rep_t;
  type dst_t (line 64) | typedef double dst_t;
  type dst_rep_t (line 65) | typedef uint64_t dst_rep_t;
  type dst_t (line 70) | typedef long double dst_t;
  type __uint128_t (line 71) | typedef __uint128_t dst_rep_t;
  function src_rep_t (line 82) | static __inline src_rep_t srcToRep(src_t x) {
  function dst_t (line 90) | static __inline dst_t dstFromRep(dst_rep_t x) {

FILE: codon/runtime/floatlib/fp_lib.h
  type half_rep_t (line 32) | typedef uint16_t half_rep_t;
  type rep_t (line 33) | typedef uint32_t rep_t;
  type twice_rep_t (line 34) | typedef uint64_t twice_rep_t;
  type srep_t (line 35) | typedef int32_t srep_t;
  type fp_t (line 36) | typedef float fp_t;
  function rep_clz (line 41) | static __inline int rep_clz(rep_t a) { return clzsi(a); }
  function wideMultiply (line 44) | static __inline void wideMultiply(rep_t a, rep_t b, rep_t *hi, rep_t *lo) {
  type half_rep_t (line 53) | typedef uint32_t half_rep_t;
  type rep_t (line 54) | typedef uint64_t rep_t;
  type srep_t (line 55) | typedef int64_t srep_t;
  type fp_t (line 56) | typedef double fp_t;
  function rep_clz (line 61) | static __inline int rep_clz(rep_t a) {
  function wideMultiply (line 78) | static __inline void wideMultiply(rep_t a, rep_t b, rep_t *hi, rep_t *lo) {
  type half_rep_t (line 98) | typedef uint64_t half_rep_t;
  type __uint128_t (line 99) | typedef __uint128_t rep_t;
  type __int128_t (line 100) | typedef __int128_t srep_t;
  type tf_float (line 101) | typedef tf_float fp_t;
  function rep_clz (line 110) | static __inline int rep_clz(rep_t a) {
  function wideMultiply (line 148) | static __inline void wideMultiply(rep_t a, rep_t b, rep_t *hi, rep_t *lo) {
  type fp_t (line 195) | typedef long double fp_t;
  function rep_t (line 205) | static __inline rep_t toRep(fp_t x) {
  function fp_t (line 213) | static __inline fp_t fromRep(rep_t x) {
  function normalize (line 236) | static __inline int normalize(rep_t *significand) {
  function wideLeftShift (line 242) | static __inline void wideLeftShift(rep_t *hi, rep_t *lo, int count) {
  function wideRightShiftWithSticky (line 247) | static __inline void wideRightShiftWithSticky(rep_t *hi, rep_t *lo,
  function fp_t (line 268) | static __inline fp_t __compiler_rt_logbX(fp_t x) {
  function fp_t (line 300) | static __inline fp_t __compiler_rt_scalbnX(fp_t x, int y) {
  function fp_t (line 341) | static __inline fp_t __compiler_rt_fmaxX(fp_t x, fp_t y) {
  function fp_t (line 352) | static __inline fp_t __compiler_rt_logbf(fp_t x) { return __compiler_rt_...
  function fp_t (line 353) | static __inline fp_t __compiler_rt_scalbnf(fp_t x, int y) {
  function fp_t (line 356) | static __inline fp_t __compiler_rt_fmaxf(fp_t x, fp_t y) {
  function fp_t (line 368) | static __inline fp_t __compiler_rt_logb(fp_t x) { return __compiler_rt_l...
  function fp_t (line 369) | static __inline fp_t __compiler_rt_scalbn(fp_t x, int y) {
  function fp_t (line 372) | static __inline fp_t __compiler_rt_fmax(fp_t x, fp_t y) {
  function tf_float (line 386) | static __inline tf_float __compiler_rt_logbtf(tf_float x) {
  function tf_float (line 389) | static __inline tf_float __compiler_rt_scalbntf(tf_float x, int y) {
  function tf_float (line 392) | static __inline tf_float __compiler_rt_fmaxtf(tf_float x, tf_float y) {
  function tf_float (line 401) | static __inline tf_float __compiler_rt_logbtf(tf_float x) { return crt_l...
  function tf_float (line 402) | static __inline tf_float __compiler_rt_scalbntf(tf_float x, int y) {
  function tf_float (line 405) | static __inline tf_float __compiler_rt_fmaxtf(tf_float x, tf_float y) {

FILE: codon/runtime/floatlib/fp_trunc.h
  type src_t (line 19) | typedef float src_t;
  type src_rep_t (line 20) | typedef uint32_t src_rep_t;
  type src_t (line 25) | typedef double src_t;
  type src_rep_t (line 26) | typedef uint64_t src_rep_t;
  type src_t (line 31) | typedef long double src_t;
  type __uint128_t (line 32) | typedef __uint128_t src_rep_t;
  type dst_t (line 41) | typedef double dst_t;
  type dst_rep_t (line 42) | typedef uint64_t dst_rep_t;
  type dst_t (line 47) | typedef float dst_t;
  type dst_rep_t (line 48) | typedef uint32_t dst_rep_t;
  type _Float16 (line 54) | typedef _Float16 dst_t;
  type dst_t (line 56) | typedef uint16_t dst_t;
  type dst_rep_t (line 58) | typedef uint16_t dst_rep_t;
  type __bf16 (line 63) | typedef __bf16 dst_t;
  type dst_rep_t (line 64) | typedef uint16_t dst_rep_t;
  function src_rep_t (line 75) | static __inline src_rep_t srcToRep(src_t x) {
  function dst_t (line 83) | static __inline dst_t dstFromRep(dst_rep_t x) {

FILE: codon/runtime/floatlib/int_lib.h
  function __builtin_ctz (line 121) | int __inline __builtin_ctz(uint32_t value) {
  function __builtin_clz (line 128) | int __inline __builtin_clz(uint32_t value) {
  function __builtin_clzll (line 136) | int __inline __builtin_clzll(uint64_t value) {
  function __builtin_clzll (line 143) | int __inline __builtin_clzll(uint64_t value) {
  function __builtin_sadd_overflow (line 156) | bool __inline __builtin_sadd_overflow(int x, int y, int *result) {

FILE: codon/runtime/floatlib/int_types.h
  type si_int (line 25) | typedef int32_t si_int;
  type su_int (line 26) | typedef uint32_t su_int;
  type di_int (line 37) | typedef int64_t di_int;
  type du_int (line 38) | typedef uint64_t du_int;
  type dwords (line 40) | typedef union {
  type udwords (line 53) | typedef union {
  type ti_int (line 79) | typedef int ti_int __attribute__((mode(TI)));
  type tu_int (line 80) | typedef unsigned tu_int __attribute__((mode(TI)));
  type twords (line 82) | typedef union {
  type utwords (line 95) | typedef union {
  function ti_int (line 108) | static __inline ti_int make_ti(di_int h, di_int l) {
  function tu_int (line 115) | static __inline tu_int make_tu(du_int h, du_int l) {
  type float_bits (line 133) | typedef union {
  type double_bits (line 138) | typedef union {
  type uqwords (line 144) | typedef struct {
  type long_double_bits (line 169) | typedef union {
  type _Complex (line 175) | typedef float _Complex Fcomplex;
  type _Complex (line 176) | typedef double _Complex Dcomplex;
  type _Complex (line 177) | typedef long double _Complex Lcomplex;
  type Fcomplex (line 182) | typedef struct {
  type Dcomplex (line 186) | typedef struct {
  type Lcomplex (line 190) | typedef struct {

FILE: codon/runtime/floatlib/truncdfbf2.c
  function COMPILER_RT_ABI (line 13) | COMPILER_RT_ABI dst_t __truncdfbf2(double a) { return __truncXfYf2__(a); }

FILE: codon/runtime/floatlib/truncdfhf2.c
  function COMPILER_RT_ABI (line 13) | COMPILER_RT_ABI dst_t __truncdfhf2(double a) { return __truncXfYf2__(a); }
  function AEABI_RTABI (line 17) | AEABI_RTABI dst_t __aeabi_d2h(double a) { return __truncdfhf2(a); }

FILE: codon/runtime/floatlib/truncdfsf2.c
  function COMPILER_RT_ABI (line 13) | COMPILER_RT_ABI float __truncdfsf2(double a) { return __truncXfYf2__(a); }
  function AEABI_RTABI (line 17) | AEABI_RTABI float __aeabi_d2f(double a) { return __truncdfsf2(a); }

FILE: codon/runtime/floatlib/truncsfbf2.c
  function COMPILER_RT_ABI (line 13) | COMPILER_RT_ABI dst_t __truncsfbf2(float a) { return __truncXfYf2__(a); }

FILE: codon/runtime/floatlib/truncsfhf2.c
  function dst_t (line 15) | dst_t __truncsfhf2(float a) {
  function COMPILER_RT_ABI (line 19) | COMPILER_RT_ABI dst_t __gnu_f2h_ieee(float a) { return __truncsfhf2(a); }
  function AEABI_RTABI (line 23) | AEABI_RTABI dst_t __aeabi_f2h(float a) { return __truncsfhf2(a); }

FILE: codon/runtime/floatlib/trunctfdf2.c
  function COMPILER_RT_ABI (line 17) | COMPILER_RT_ABI double __trunctfdf2(long double a) { return __truncXfYf2...

FILE: codon/runtime/floatlib/trunctfhf2.c
  function COMPILER_RT_ABI (line 18) | COMPILER_RT_ABI _Float16 __trunctfhf2(long double a) {

FILE: codon/runtime/floatlib/trunctfsf2.c
  function COMPILER_RT_ABI (line 17) | COMPILER_RT_ABI float __trunctfsf2(long double a) { return __truncXfYf2_...

FILE: codon/runtime/lib.cpp
  function SEQ_FUNC (line 51) | SEQ_FUNC void seq_init(int flags) {
  function SEQ_FUNC (line 64) | SEQ_FUNC seq_int_t seq_pid() { return (seq_int_t)getpid(); }
  function SEQ_FUNC (line 66) | SEQ_FUNC seq_int_t seq_time() {
  function SEQ_FUNC (line 73) | SEQ_FUNC seq_int_t seq_time_monotonic() {
  function SEQ_FUNC (line 80) | SEQ_FUNC seq_int_t seq_time_highres() {
  function copy_time_c_to_seq (line 87) | static void copy_time_c_to_seq(struct tm *x, seq_time_t *output) {
  function copy_time_seq_to_c (line 99) | static void copy_time_seq_to_c(seq_time_t *x, struct tm *output) {
  function SEQ_FUNC (line 111) | SEQ_FUNC bool seq_localtime(seq_int_t secs, seq_time_t *output) {
  function SEQ_FUNC (line 120) | SEQ_FUNC bool seq_gmtime(seq_int_t secs, seq_time_t *output) {
  function SEQ_FUNC (line 129) | SEQ_FUNC seq_int_t seq_mktime(seq_time_t *time) {
  function SEQ_FUNC (line 135) | SEQ_FUNC void seq_sleep(double secs) {
  function SEQ_FUNC (line 140) | SEQ_FUNC char **seq_env() { return environ; }
  function SEQ_FUNC (line 146) | SEQ_FUNC void *seq_alloc(size_t n) {
  function SEQ_FUNC (line 154) | SEQ_FUNC void *seq_alloc_atomic(size_t n) {
  function SEQ_FUNC (line 162) | SEQ_FUNC void *seq_alloc_uncollectable(size_t n) {
  function SEQ_FUNC (line 170) | SEQ_FUNC void *seq_alloc_atomic_uncollectable(size_t n) {
  function SEQ_FUNC (line 178) | SEQ_FUNC void *seq_realloc(void *p, size_t newsize, size_t oldsize) {
  function SEQ_FUNC (line 186) | SEQ_FUNC void seq_free(void *p) {
  function SEQ_FUNC (line 194) | SEQ_FUNC void seq_register_finalizer(void *p, void (*f)(void *obj, void ...
  function SEQ_FUNC (line 200) | SEQ_FUNC void seq_gc_add_roots(void *start, void *end) {
  function SEQ_FUNC (line 206) | SEQ_FUNC void seq_gc_remove_roots(void *start, void *end) {
  function SEQ_FUNC (line 212) | SEQ_FUNC void seq_gc_clear_roots() {
  function SEQ_FUNC (line 218) | SEQ_FUNC void seq_gc_exclude_static_roots(void *start, void *end) {
  function seq_str_t (line 227) | static seq_str_t string_conv(const std::string &s) {
  function default_format (line 234) | std::string default_format(T n) {
  function default_format (line 238) | std::string default_format(double n) {
  function seq_str_t (line 242) | seq_str_t fmt_conv(T n, seq_str_t format, bool *error) {
  function SEQ_FUNC (line 259) | SEQ_FUNC seq_str_t seq_str_int(seq_int_t n, seq_str_t format, bool *erro...
  function SEQ_FUNC (line 263) | SEQ_FUNC seq_str_t seq_str_uint(seq_int_t n, seq_str_t format, bool *err...
  function SEQ_FUNC (line 267) | SEQ_FUNC seq_str_t seq_str_float(double f, seq_str_t format, bool *error) {
  function SEQ_FUNC (line 271) | SEQ_FUNC seq_str_t seq_str_ptr(void *p, seq_str_t format, bool *error) {
  function SEQ_FUNC (line 275) | SEQ_FUNC seq_str_t seq_str_str(seq_str_t s, seq_str_t format, bool *erro...
  function SEQ_FUNC (line 280) | SEQ_FUNC seq_int_t seq_int_from_str(seq_str_t s, const char **e, int bas...
  function SEQ_FUNC (line 287) | SEQ_FUNC double seq_float_from_str(seq_str_t s, const char **e) {
  function SEQ_FUNC (line 298) | SEQ_FUNC seq_str_t seq_check_errno() {
  function SEQ_FUNC (line 308) | SEQ_FUNC void seq_print(seq_str_t str) { seq_print_full(str, stdout); }
  function SEQ_FUNC (line 313) | SEQ_FUNC void seq_print_full(seq_str_t str, FILE *fo) {
  function SEQ_FUNC (line 329) | SEQ_FUNC void *seq_stdin() { return stdin; }
  function SEQ_FUNC (line 331) | SEQ_FUNC void *seq_stdout() { return stdout; }
  function SEQ_FUNC (line 333) | SEQ_FUNC void *seq_stderr() { return stderr; }
  function SEQ_FUNC (line 339) | SEQ_FUNC void *seq_lock_new() {
  function SEQ_FUNC (line 343) | SEQ_FUNC bool seq_lock_acquire(void *lock, bool block, double timeout) {
  function SEQ_FUNC (line 357) | SEQ_FUNC void seq_lock_release(void *lock) {
  function SEQ_FUNC (line 362) | SEQ_FUNC void *seq_rlock_new() {
  function SEQ_FUNC (line 367) | SEQ_FUNC bool seq_rlock_acquire(void *lock, bool block, double timeout) {
  function SEQ_FUNC (line 381) | SEQ_FUNC void seq_rlock_release(void *lock) {

FILE: codon/runtime/lib.h
  type seq_int_t (line 24) | typedef int64_t seq_int_t;
  type seq_str_t (line 26) | struct seq_str_t {
  type seq_time_t (line 31) | struct seq_time_t {
  function namespace (line 99) | namespace codon {

FILE: codon/runtime/numpy/loops.cpp
  type HWY_NAMESPACE (line 24) | namespace HWY_NAMESPACE {
    type AcosFunctor (line 28) | struct AcosFunctor {
      method vector (line 30) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 34) | static inline double scalar(const double x) { return acos(x); }
      method scalar (line 36) | static inline float scalar(const float x) { return acosf(x); }
    type AcoshFunctor (line 39) | struct AcoshFunctor {
      method vector (line 41) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 48) | static inline double scalar(const double x) { return acosh(x); }
      method scalar (line 50) | static inline float scalar(const float x) { return acoshf(x); }
    type AsinFunctor (line 53) | struct AsinFunctor {
      method vector (line 55) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 59) | static inline double scalar(const double x) { return asin(x); }
      method scalar (line 61) | static inline float scalar(const float x) { return asinf(x); }
    type AsinhFunctor (line 64) | struct AsinhFunctor {
      method vector (line 66) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 73) | static inline double scalar(const double x) { return asinh(x); }
      method scalar (line 75) | static inline float scalar(const float x) { return asinhf(x); }
    type AtanFunctor (line 78) | struct AtanFunctor {
      method vector (line 80) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 88) | static inline double scalar(const double x) { return atan(x); }
      method scalar (line 90) | static inline float scalar(const float x) { return atanf(x); }
    type AtanhFunctor (line 93) | struct AtanhFunctor {
      method vector (line 95) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 107) | static inline double scalar(const double x) { return atanh(x); }
      method scalar (line 109) | static inline float scalar(const float x) { return atanhf(x); }
    type Atan2Functor (line 112) | struct Atan2Functor {
      method vector (line 114) | static inline auto vector(const hn::ScalableTag<T> d, const V &v1, c...
      method scalar (line 135) | static inline auto scalar(const double x, const double y) { return a...
      method scalar (line 137) | static inline auto scalar(const float x, const float y) { return ata...
    type CosFunctor (line 140) | struct CosFunctor {
      method T (line 141) | static inline T limit() {
      method vector (line 152) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 172) | static inline double scalar(const double x) { return cos(x); }
      method scalar (line 174) | static inline float scalar(const float x) { return cosf(x); }
    type ExpFunctor (line 177) | struct ExpFunctor {
      method T (line 178) | static inline T limit() {
      method vector (line 189) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 195) | static inline double scalar(const double x) { return exp(x); }
      method scalar (line 197) | static inline float scalar(const float x) { return expf(x); }
    type Exp2Functor (line 200) | struct Exp2Functor {
      method T (line 201) | static inline T limit() {
      method vector (line 212) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 218) | static inline double scalar(const double x) { return exp2(x); }
      method scalar (line 220) | static inline float scalar(const float x) { return exp2f(x); }
    type Expm1Functor (line 223) | struct Expm1Functor {
      method T (line 224) | static inline T limit() {
      method vector (line 235) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 241) | static inline double scalar(const double x) { return expm1(x); }
      method scalar (line 243) | static inline float scalar(const float x) { return expm1f(x); }
    type LogFunctor (line 246) | struct LogFunctor {
      method vector (line 248) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 259) | static inline double scalar(const double x) { return log(x); }
      method scalar (line 261) | static inline float scalar(const float x) { return logf(x); }
    type Log10Functor (line 264) | struct Log10Functor {
      method vector (line 266) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 277) | static inline double scalar(const double x) { return log10(x); }
      method scalar (line 279) | static inline float scalar(const float x) { return log10f(x); }
    type Log1pFunctor (line 282) | struct Log1pFunctor {
      method vector (line 284) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 295) | static inline double scalar(const double x) { return log1p(x); }
      method scalar (line 297) | static inline float scalar(const float x) { return log1pf(x); }
    type Log2Functor (line 300) | struct Log2Functor {
      method vector (line 302) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 313) | static inline double scalar(const double x) { return log2(x); }
      method scalar (line 315) | static inline float scalar(const float x) { return log2f(x); }
    type SinFunctor (line 318) | struct SinFunctor {
      method T (line 319) | static inline T limit() {
      method vector (line 330) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 350) | static inline double scalar(const double x) { return sin(x); }
      method scalar (line 352) | static inline float scalar(const float x) { return sinf(x); }
    type SinhFunctor (line 355) | struct SinhFunctor {
      method T (line 356) | static inline T limit() {
      method vector (line 367) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 387) | static inline double scalar(const double x) { return sinh(x); }
      method scalar (line 389) | static inline float scalar(const float x) { return sinhf(x); }
    type TanhFunctor (line 392) | struct TanhFunctor {
      method vector (line 394) | static inline auto vector(const hn::ScalableTag<T> d, const V &v) {
      method scalar (line 398) | static inline double scalar(const double x) { return tanh(x); }
      method scalar (line 400) | static inline float scalar(const float x) { return tanhf(x); }
    type HypotFunctor (line 403) | struct HypotFunctor {
      method vector (line 405) | static inline auto vector(const hn::ScalableTag<T> d, const V &v1, c...
      method scalar (line 409) | static inline auto scalar(const double x, const double y) { return h...
      method scalar (line 411) | static inline auto scalar(const float x, const float y) { return hyp...
    function UnaryLoop (line 415) | void UnaryLoop(const T *in, size_t is, T *out, size_t os, size_t n) {
    function BinaryLoop (line 449) | void BinaryLoop(const T *in1, size_t is1, const T *in2, size_t is2, T ...
    function LoopAcos32 (line 518) | void LoopAcos32(const float *in, size_t is, float *out, size_t os, siz...
    function LoopAcos64 (line 522) | void LoopAcos64(const double *in, size_t is, double *out, size_t os, s...
    function LoopAcosh32 (line 526) | void LoopAcosh32(const float *in, size_t is, float *out, size_t os, si...
    function LoopAcosh64 (line 530) | void LoopAcosh64(const double *in, size_t is, double *out, size_t os, ...
    function LoopAsin32 (line 534) | void LoopAsin32(const float *in, size_t is, float *out, size_t os, siz...
    function LoopAsin64 (line 538) | void LoopAsin64(const double *in, size_t is, double *out, size_t os, s...
    function LoopAsinh32 (line 542) | void LoopAsinh32(const float *in, size_t is, float *out, size_t os, si...
    function LoopAsinh64 (line 546) | void LoopAsinh64(const double *in, size_t is, double *out, size_t os, ...
    function LoopAtan32 (line 550) | void LoopAtan32(const float *in, size_t is, float *out, size_t os, siz...
    function LoopAtan64 (line 554) | void LoopAtan64(const double *in, size_t is, double *out, size_t os, s...
    function LoopAtanh32 (line 558) | void LoopAtanh32(const float *in, size_t is, float *out, size_t os, si...
    function LoopAtanh64 (line 562) | void LoopAtanh64(const double *in, size_t is, double *out, size_t os, ...
    function LoopAtan232 (line 566) | void LoopAtan232(const float *in1, size_t is1, const float *in2, size_...
    function LoopAtan264 (line 571) | void LoopAtan264(const double *in1, size_t is1, const double *in2, siz...
    function LoopCos32 (line 576) | void LoopCos32(const float *in, size_t is, float *out, size_t os, size...
    function LoopCos64 (line 580) | void LoopCos64(const double *in, size_t is, double *out, size_t os, si...
    function LoopExp32 (line 584) | void LoopExp32(const float *in, size_t is, float *out, size_t os, size...
    function LoopExp64 (line 588) | void LoopExp64(const double *in, size_t is, double *out, size_t os, si...
    function LoopExp232 (line 592) | void LoopExp232(const float *in, size_t is, float *out, size_t os, siz...
    function LoopExp264 (line 596) | void LoopExp264(const double *in, size_t is, double *out, size_t os, s...
    function LoopExpm132 (line 600) | void LoopExpm132(const float *in, size_t is, float *out, size_t os, si...
    function LoopExpm164 (line 604) | void LoopExpm164(const double *in, size_t is, double *out, size_t os, ...
    function LoopLog32 (line 608) | void LoopLog32(const float *in, size_t is, float *out, size_t os, size...
    function LoopLog64 (line 612) | void LoopLog64(const double *in, size_t is, double *out, size_t os, si...
    function LoopLog1032 (line 616) | void LoopLog1032(const float *in, size_t is, float *out, size_t os, si...
    function LoopLog1064 (line 620) | void LoopLog1064(const double *in, size_t is, double *out, size_t os, ...
    function LoopLog1p32 (line 624) | void LoopLog1p32(const float *in, size_t is, float *out, size_t os, si...
    function LoopLog1p64 (line 628) | void LoopLog1p64(const double *in, size_t is, double *out, size_t os, ...
    function LoopLog232 (line 632) | void LoopLog232(const float *in, size_t is, float *out, size_t os, siz...
    function LoopLog264 (line 636) | void LoopLog264(const double *in, size_t is, double *out, size_t os, s...
    function LoopSin32 (line 640) | void LoopSin32(const float *in, size_t is, float *out, size_t os, size...
    function LoopSin64 (line 644) | void LoopSin64(const double *in, size_t is, double *out, size_t os, si...
    function LoopSinh32 (line 648) | void LoopSinh32(const float *in, size_t is, float *out, size_t os, siz...
    function LoopSinh64 (line 652) | void LoopSinh64(const double *in, size_t is, double *out, size_t os, s...
    function LoopTanh32 (line 656) | void LoopTanh32(const float *in, size_t is, float *out, size_t os, siz...
    function LoopTanh64 (line 660) | void LoopTanh64(const double *in, size_t is, double *out, size_t os, s...
    function LoopHypot32 (line 664) | void LoopHypot32(const float *in1, size_t is1, const float *in2, size_...
    function LoopHypot64 (line 669) | void LoopHypot64(const double *in1, size_t is1, const double *in2, siz...
  function SEQ_FUNC (line 719) | SEQ_FUNC void cnp_acos_float32(const float *in, size_t is, float *out, s...
  function SEQ_FUNC (line 725) | SEQ_FUNC void cnp_acos_float64(const double *in, size_t is, double *out,...
  function SEQ_FUNC (line 731) | SEQ_FUNC void cnp_acosh_float32(const float *in, size_t is, float *out, ...
  function SEQ_FUNC (line 737) | SEQ_FUNC void cnp_acosh_float64(const double *in, size_t is, double *out...
  function SEQ_FUNC (line 743) | SEQ_FUNC void cnp_asin_float32(const float *in, size_t is, float *out, s...
  function SEQ_FUNC (line 749) | SEQ_FUNC void cnp_asin_float64(const double *in, size_t is, double *out,...
  function SEQ_FUNC (line 755) | SEQ_FUNC void cnp_asinh_float32(const float *in, size_t is, float *out, ...
  function SEQ_FUNC (line 761) | SEQ_FUNC void cnp_asinh_float64(const double *in, size_t is, double *out...
  function SEQ_FUNC (line 767) | SEQ_FUNC void cnp_atan_float32(const float *in, size_t is, float *out, s...
  function SEQ_FUNC (line 773) | SEQ_FUNC void cnp_atan_float64(const double *in, size_t is, double *out,...
  function SEQ_FUNC (line 779) | SEQ_FUNC void cnp_atanh_float32(const float *in, size_t is, float *out, ...
  function SEQ_FUNC (line 785) | SEQ_FUNC void cnp_atanh_float64(const double *in, size_t is, double *out...
  function SEQ_FUNC (line 791) | SEQ_FUNC void cnp_atan2_float32(const float *in1, size_t is1, const floa...
  function SEQ_FUNC (line 797) | SEQ_FUNC void cnp_atan2_float64(const double *in1, size_t is1, const dou...
  function SEQ_FUNC (line 803) | SEQ_FUNC void cnp_cos_float32(const float *in, size_t is, float *out, si...
  function SEQ_FUNC (line 809) | SEQ_FUNC void cnp_cos_float64(const double *in, size_t is, double *out, ...
  function SEQ_FUNC (line 815) | SEQ_FUNC void cnp_exp_float32(const float *in, size_t is, float *out, si...
  function SEQ_FUNC (line 821) | SEQ_FUNC void cnp_exp_float64(const double *in, size_t is, double *out, ...
  function SEQ_FUNC (line 827) | SEQ_FUNC void cnp_exp2_float32(const float *in, size_t is, float *out, s...
  function SEQ_FUNC (line 833) | SEQ_FUNC void cnp_exp2_float64(const double *in, size_t is, double *out,...
  function SEQ_FUNC (line 839) | SEQ_FUNC void cnp_expm1_float32(const float *in, size_t is, float *out, ...
  function SEQ_FUNC (line 845) | SEQ_FUNC void cnp_expm1_float64(const double *in, size_t is, double *out...
  function SEQ_FUNC (line 851) | SEQ_FUNC void cnp_log_float32(const float *in, size_t is, float *out, si...
  function SEQ_FUNC (line 857) | SEQ_FUNC void cnp_log_float64(const double *in, size_t is, double *out, ...
  function SEQ_FUNC (line 863) | SEQ_FUNC void cnp_log10_float32(const float *in, size_t is, float *out, ...
  function SEQ_FUNC (line 869) | SEQ_FUNC void cnp_log10_float64(const double *in, size_t is, double *out...
  function SEQ_FUNC (line 875) | SEQ_FUNC void cnp_log1p_float32(const float *in, size_t is, float *out, ...
  function SEQ_FUNC (line 881) | SEQ_FUNC void cnp_log1p_float64(const double *in, size_t is, double *out...
  function SEQ_FUNC (line 887) | SEQ_FUNC void cnp_log2_float32(const float *in, size_t is, float *out, s...
  function SEQ_FUNC (line 893) | SEQ_FUNC void cnp_log2_float64(const double *in, size_t is, double *out,...
  function SEQ_FUNC (line 899) | SEQ_FUNC void cnp_sin_float32(const float *in, size_t is, float *out, si...
  function SEQ_FUNC (line 905) | SEQ_FUNC void cnp_sin_float64(const double *in, size_t is, double *out, ...
  function SEQ_FUNC (line 911) | SEQ_FUNC void cnp_sinh_float32(const float *in, size_t is, float *out, s...
  function SEQ_FUNC (line 917) | SEQ_FUNC void cnp_sinh_float64(const double *in, size_t is, double *out,...
  function SEQ_FUNC (line 923) | SEQ_FUNC void cnp_tanh_float32(const float *in, size_t is, float *out, s...
  function SEQ_FUNC (line 929) | SEQ_FUNC void cnp_tanh_float64(const double *in, size_t is, double *out,...
  function SEQ_FUNC (line 935) | SEQ_FUNC void cnp_hypot_float32(const float *in1, size_t is1, const floa...
  function SEQ_FUNC (line 941) | SEQ_FUNC void cnp_hypot_float64(const double *in1, size_t is1, const dou...

FILE: codon/runtime/numpy/sort.cpp
  function SEQ_FUNC (line 6) | SEQ_FUNC void cnp_sort_int16(int16_t *data, int64_t n) {
  function SEQ_FUNC (line 10) | SEQ_FUNC void cnp_sort_uint16(uint16_t *data, int64_t n) {
  function SEQ_FUNC (line 14) | SEQ_FUNC void cnp_sort_int32(int32_t *data, int64_t n) {
  function SEQ_FUNC (line 18) | SEQ_FUNC void cnp_sort_uint32(uint32_t *data, int64_t n) {
  function SEQ_FUNC (line 22) | SEQ_FUNC void cnp_sort_int64(int64_t *data, int64_t n) {
  function SEQ_FUNC (line 26) | SEQ_FUNC void cnp_sort_uint64(uint64_t *data, int64_t n) {
  function SEQ_FUNC (line 30) | SEQ_FUNC void cnp_sort_uint128(hwy::uint128_t *data, int64_t n) {
  function SEQ_FUNC (line 34) | SEQ_FUNC void cnp_sort_float32(float *data, int64_t n) {
  function SEQ_FUNC (line 38) | SEQ_FUNC void cnp_sort_float64(double *data, int64_t n) {

FILE: codon/runtime/numpy/zmath.cpp
  function SEQ_FUNC (line 10) | SEQ_FUNC void cnp_cexpf(float r, float i, float *z) {
  function SEQ_FUNC (line 17) | SEQ_FUNC void cnp_clogf(float r, float i, float *z) {
  function SEQ_FUNC (line 24) | SEQ_FUNC void cnp_csqrtf(float r, float i, float *z) {
  function SEQ_FUNC (line 31) | SEQ_FUNC void cnp_ccoshf(float r, float i, float *z) {
  function SEQ_FUNC (line 38) | SEQ_FUNC void cnp_csinhf(float r, float i, float *z) {
  function SEQ_FUNC (line 45) | SEQ_FUNC void cnp_ctanhf(float r, float i, float *z) {
  function SEQ_FUNC (line 52) | SEQ_FUNC void cnp_cacoshf(float r, float i, float *z) {
  function SEQ_FUNC (line 59) | SEQ_FUNC void cnp_casinhf(float r, float i, float *z) {
  function SEQ_FUNC (line 66) | SEQ_FUNC void cnp_catanhf(float r, float i, float *z) {
  function SEQ_FUNC (line 73) | SEQ_FUNC void cnp_ccosf(float r, float i, float *z) {
  function SEQ_FUNC (line 80) | SEQ_FUNC void cnp_csinf(float r, float i, float *z) {
  function SEQ_FUNC (line 87) | SEQ_FUNC void cnp_ctanf(float r, float i, float *z) {
  function SEQ_FUNC (line 94) | SEQ_FUNC void cnp_cacosf(float r, float i, float *z) {
  function SEQ_FUNC (line 101) | SEQ_FUNC void cnp_casinf(float r, float i, float *z) {
  function SEQ_FUNC (line 108) | SEQ_FUNC void cnp_catanf(float r, float i, float *z) {

FILE: codon/runtime/re.cpp
  function flags2opt (line 27) | static inline Regex::Options flags2opt(seq_int_t flags) {
  type Span (line 67) | struct Span {
  type GCMapAllocator (line 72) | struct GCMapAllocator : public std::allocator<KV> {
    method GCMapAllocator (line 73) | GCMapAllocator() = default;
    method GCMapAllocator (line 74) | GCMapAllocator(GCMapAllocator<KV> const &) = default;
    method GCMapAllocator (line 76) | GCMapAllocator(const GCMapAllocator<KV1> &) noexcept {}
    method KV (line 78) | KV *allocate(std::size_t n) { return (KV *)seq_alloc_uncollectable(n *...
    method deallocate (line 80) | void deallocate(KV *p, std::size_t n) { seq_free(p); }
    type rebind (line 82) | struct rebind {
  function seq_str_t (line 87) | static inline seq_str_t convert(const std::string &p) {
  function StringPiece (line 94) | static inline StringPiece str2sp(const seq_str_t &s) {
  type KeyEqual (line 100) | struct KeyEqual {
  type KeyHash (line 106) | struct KeyHash {
  function Regex (line 117) | static inline Regex *get(const seq_str_t &p, seq_int_t flags) {
  function SEQ_FUNC (line 133) | SEQ_FUNC Span *seq_re_match(Regex *re, seq_int_t anchor, seq_str_t s, se...
  function SEQ_FUNC (line 161) | SEQ_FUNC Span seq_re_match_one(Regex *re, seq_int_t anchor, seq_str_t s,...
  function SEQ_FUNC (line 175) | SEQ_FUNC seq_str_t seq_re_escape(seq_str_t p) {
  function SEQ_FUNC (line 179) | SEQ_FUNC Regex *seq_re_compile(seq_str_t p, seq_int_t flags) { return ge...
  function SEQ_FUNC (line 181) | SEQ_FUNC void seq_re_purge() { cache.clear(); }
  function SEQ_FUNC (line 187) | SEQ_FUNC seq_int_t seq_re_pattern_groups(Regex *pattern) {
  function SEQ_FUNC (line 191) | SEQ_FUNC seq_int_t seq_re_group_name_to_index(Regex *pattern, seq_str_t ...
  function SEQ_FUNC (line 197) | SEQ_FUNC seq_str_t seq_re_group_index_to_name(Regex *pattern, seq_int_t ...
  function SEQ_FUNC (line 204) | SEQ_FUNC bool seq_re_check_rewrite_string(Regex *pattern, seq_str_t rewr...
  function SEQ_FUNC (line 213) | SEQ_FUNC seq_str_t seq_re_pattern_error(Regex *pattern) {

FILE: codon/util/common.cpp
  type codon (line 11) | namespace codon {
    function compilationMessage (line 13) | void compilationMessage(const std::string &header, const std::string &...
    function compilationError (line 66) | void compilationError(const std::string &msg, const std::string &file,...
    function compilationWarning (line 75) | void compilationWarning(const std::string &msg, const std::string &fil...

FILE: codon/util/common.h
  function namespace (line 69) | namespace codon {
  function elapsed (line 113) | double elapsed(std::chrono::time_point<clock_type> end = clock_type::now...
  type SrcObject (line 127) | struct SrcObject {
  function SrcObject (line 139) | SrcObject *setSrcInfo(SrcInfo info) {
  type MessageGroupPos (line 156) | enum MessageGroupPos {
  function ostream_formatter (line 173) | struct fmt::formatter<codon::SrcInfo> : fmt::ostream_formatter {}

FILE: codon/util/jupyter.cpp
  type codon (line 6) | namespace codon {
    function startJupyterKernel (line 7) | int startJupyterKernel(const std::string &argv0,

FILE: codon/util/jupyter.h
  function namespace (line 8) | namespace codon {

FILE: codon/util/peg2cpp.cpp
  function string (line 30) | string escape(const string &str) {
  function string (line 59) | string join(const T &items, const string &delim = " ", int start = 0, in...
  class PrintVisitor (line 74) | class PrintVisitor : public peg::Ope::Visitor {
    method string (line 78) | static string parse(const shared_ptr<peg::Ope> &op) {
    method visit (line 91) | void visit(peg::Sequence &s) override {
    method visit (line 96) | void visit(peg::PrioritizedChoice &s) override {
    method visit (line 101) | void visit(peg::Repetition &s) override {
    method visit (line 111) | void visit(peg::AndPredicate &s) override { v = {"apd", parse(s.ope_)}; }
    method visit (line 112) | void visit(peg::NotPredicate &s) override { v = {"npd", parse(s.ope_)}; }
    method visit (line 113) | void visit(peg::LiteralString &s) override {
    method visit (line 116) | void visit(peg::CharacterClass &s) override {
    method visit (line 122) | void visit(peg::Character &s) override { v = {"chr", fmt::format("'{}'...
    method visit (line 123) | void visit(peg::AnyCharacter &s) override { v = {"dot"}; }
    method visit (line 124) | void visit(peg::Cut &s) override { v = {"cut"}; }
    method visit (line 125) | void visit(peg::Reference &s) override {
    method visit (line 136) | void visit(peg::TokenBoundary &s) override { v = {"tok", parse(s.ope_)...
    method visit (line 137) | void visit(peg::Ignore &s) override { v = {"ign", parse(s.ope_)}; }
    method visit (line 138) | void visit(peg::Recovery &s) override { v = {"rec", parse(s.ope_)}; }
  function main (line 142) | int main(int argc, char **argv) {

FILE: codon/util/serialize.h
  function namespace (line 11) | namespace codon {

FILE: codon/util/tser.h
  function namespace (line 15) | namespace tser {
  function namespace (line 41) | namespace tser {
  function std (line 51) | static std::string encode_base64(std::string_view in) {
  function explicit (line 221) | explicit BinaryArchive(std::string encodedStr)
  function else (line 232) | else if constexpr (is_tser_t_v<T>)
  function else (line 234) | else if constexpr (is_tuple_v<T>)
  function else (line 236) | else if constexpr (is_pointer_like_v<T>) {

FILE: jit/codon/decorator.py
  function _common_type (line 63) | def _common_type(t, debug, sample_size):
  function _codon_type (line 77) | def _codon_type(arg, **kwargs):
  function _codon_types (line 146) | def _codon_types(args, **kwargs):
  function _reset_jit (line 149) | def _reset_jit():
  class RewriteFunctionArgs (line 166) | class RewriteFunctionArgs(ast.NodeTransformer):
    method __init__ (line 167) | def __init__(self, args):
    method visit_FunctionDef (line 170) | def visit_FunctionDef(self, node):
  function _obj_to_str (line 175) | def _obj_to_str(obj, **kwargs) -> str:
  function _parse_decorated (line 209) | def _parse_decorated(obj, **kwargs):
  function convert (line 212) | def convert(t):
  function _jit_register_fn (line 239) | def _jit_register_fn(f, pyvars, debug):
  function _jit_callback_fn (line 253) | def _jit_callback_fn(fn,
  function _jit_str_fn (line 280) | def _jit_str_fn(fstr, debug=0, sample_size=5, pyvars=None):
  function jit (line 290) | def jit(fn=None, debug=0, sample_size=5, pyvars=None):
  function execute (line 318) | def execute(code, debug=0):

FILE: jupyter/jupyter.cpp
  type codon (line 27) | namespace codon {
    function startJupyterKernel (line 134) | int startJupyterKernel(const std::string &argv0,

FILE: jupyter/jupyter.h
  function namespace (line 11) | namespace codon {

FILE: scripts/docgen.py
  function remove_root (line 26) | def remove_root(path, roots):
  function parse_docstr (line 64) | def parse_docstr(s, level=0):
  function parse_type (line 78) | def parse_type(a):
  function parse_fn (line 96) | def parse_fn(v):
  function write_tag (line 151) | def write_tag(tag, f):
  function write_tags (line 161) | def write_tags(v, f):
  function write_docstr (line 168) | def write_docstr(v, f):

FILE: test/app/test.c
  function main (line 2) | int main(void) { foo(3); }

FILE: test/cir/analyze/dominator.cpp
  function TEST_F (line 8) | TEST_F(CIRCoreTest, DominatorAnalysisSimple) {
  function TEST_F (line 30) | TEST_F(CIRCoreTest, DominatorAnalysisTernary) {

FILE: test/cir/analyze/reaching.cpp
  function rdset (line 9) | std::unordered_set<codon::ir::id_t> rdset(analyze::dataflow::RDInspector...
  function TEST_F (line 21) | TEST_F(CIRCoreTest, RDAnalysisSimple) {
  function TEST_F (line 65) | TEST_F(CIRCoreTest, RDAnalysisIfConditional) {
  function TEST_F (line 104) | TEST_F(CIRCoreTest, RDAnalysisTryCatch) {
  function TEST_F (line 156) | TEST_F(CIRCoreTest, RDAnalysisWhileLoop) {

FILE: test/cir/base.cpp
  class TestVisitor (line 6) | class TestVisitor : public codon::ir::util::Visitor {
    method visit (line 8) | void visit(codon::ir::IntConst *) override { FAIL(); }
    method visit (line 9) | void visit(codon::ir::BoolConst *) override {}
  class ConstTestVisitor (line 12) | class ConstTestVisitor : public codon::ir::util::ConstVisitor {
    method visit (line 14) | void visit(const codon::ir::IntConst *) override { FAIL(); }
    method visit (line 15) | void visit(const codon::ir::BoolConst *) override {}
  function TEST_F (line 22) | TEST_F(CIRCoreTest, NodeNoReplacementRTTI) {
  function TEST_F (line 38) | TEST_F(CIRCoreTest, NodeNoReplacementAttributes) {
  function TEST_F (line 48) | TEST_F(CIRCoreTest, NodeReplacementRTTI) {
  function TEST_F (line 61) | TEST_F(CIRCoreTest, NodeReplacementDelegates) {
  function TEST_F (line 86) | TEST_F(CIRCoreTest, NodeNonReplaceableFails) {

FILE: test/cir/constant.cpp
  function TEST_F (line 8) | TEST_F(CIRCoreTest, ConstTypeQueryAndReplace) {
  function TEST_F (line 18) | TEST_F(CIRCoreTest, ConstCloning) {

FILE: test/cir/flow.cpp
  function TEST_F (line 10) | TEST_F(CIRCoreTest, SeriesFlowInsertionEraseAndIterators) {
  function TEST_F (line 28) | TEST_F(CIRCoreTest, SeriesFlowQueryAndReplace) {
  function TEST_F (line 46) | TEST_F(CIRCoreTest, SeriesFlowCloning) {
  function TEST_F (line 57) | TEST_F(CIRCoreTest, WhileFlowQueryAndReplace) {
  function TEST_F (line 83) | TEST_F(CIRCoreTest, WhileFlowCloning) {
  function TEST_F (line 90) | TEST_F(CIRCoreTest, ForFlowQueryAndReplace) {
  function TEST_F (line 122) | TEST_F(CIRCoreTest, ForFlowCloning) {
  function TEST_F (line 131) | TEST_F(CIRCoreTest, IfFlowQueryAndReplace) {
  function TEST_F (line 172) | TEST_F(CIRCoreTest, IfFlowCloning) {
  function TEST_F (line 181) | TEST_F(CIRCoreTest, TryCatchFlowSingleCatchQueryAndReplace) {

FILE: test/cir/func.cpp
  function TEST_F (line 9) | TEST_F(CIRCoreTest, FuncRealizationAndVarInsertionEraseAndIterators) {
  function TEST_F (line 32) | TEST_F(CIRCoreTest, BodiedFuncQueryAndReplace) {
  function TEST_F (line 55) | TEST_F(CIRCoreTest, BodiedFuncUnmangledName) {
  function TEST_F (line 62) | TEST_F(CIRCoreTest, BodiedFuncCloning) {
  function TEST_F (line 71) | TEST_F(CIRCoreTest, ExternalFuncUnmangledNameAndCloning) {
  function TEST_F (line 80) | TEST_F(CIRCoreTest, InternalFuncParentTypeUnmangledNameAndCloning) {
  function TEST_F (line 91) | TEST_F(CIRCoreTest, LLVMFuncUnmangledNameQueryAndReplace) {

FILE: test/cir/instr.cpp
  function TEST_F (line 7) | TEST_F(CIRCoreTest, AssignInstrQueryAndReplace) {
  function TEST_F (line 28) | TEST_F(CIRCoreTest, AssignInstrCloning) {
  function TEST_F (line 36) | TEST_F(CIRCoreTest, ExtractInstrQueryAndReplace) {
  function TEST_F (line 55) | TEST_F(CIRCoreTest, ExtractInstrCloning) {
  function TEST_F (line 66) | TEST_F(CIRCoreTest, InsertInstrQueryAndReplace) {
  function TEST_F (line 86) | TEST_F(CIRCoreTest, InsertInstrCloning) {
  function TEST_F (line 99) | TEST_F(CIRCoreTest, CallInstrQueryAndReplace) {
  function TEST_F (line 114) | TEST_F(CIRCoreTest, CallInstrCloning) {
  function TEST_F (line 124) | TEST_F(CIRCoreTest, StackAllocInstrQueryAndReplace) {
  function TEST_F (line 141) | TEST_F(CIRCoreTest, StackAllocInstrCloning) {
  function TEST_F (line 148) | TEST_F(CIRCoreTest, TypePropertyInstrQueryAndReplace) {
  function TEST_F (line 168) | TEST_F(CIRCoreTest, TypePropertyInstrCloning) {
  function TEST_F (line 175) | TEST_F(CIRCoreTest, YieldInInstrQueryAndReplace) {
  function TEST_F (line 189) | TEST_F(CIRCoreTest, YieldInInstrCloning) {
  function TEST_F (line 195) | TEST_F(CIRCoreTest, TernaryInstrQueryAndReplace) {
  function TEST_F (line 215) | TEST_F(CIRCoreTest, TernaryInstrCloning) {
  function TEST_F (line 224) | TEST_F(CIRCoreTest, ContinueInstrQueryReplaceAndCloning) {
  function TEST_F (line 229) | TEST_F(CIRCoreTest, BreakInstrQueryReplaceAndCloning) {
  function TEST_F (line 234) | TEST_F(CIRCoreTest, ReturnInstrQueryReplaceAndCloning) {
  function TEST_F (line 246) | TEST_F(CIRCoreTest, YieldInstrQueryReplaceAndCloning) {
  function TEST_F (line 258) | TEST_F(CIRCoreTest, ThrowInstrQueryReplaceAndCloning) {
  function TEST_F (line 270) | TEST_F(CIRCoreTest, FlowInstrQueryAndReplace) {
  function TEST_F (line 285) | TEST_F(CIRCoreTest, FlowInstrCloning) {

FILE: test/cir/module.cpp
  function TEST_F (line 7) | TEST_F(CIRCoreTest, ModuleNodeBuildingRemovalAndIterators) {
  function TEST_F (line 36) | TEST_F(CIRCoreTest, ModuleMainFunctionAndArgVar) {
  function TEST_F (line 52) | TEST_F(CIRCoreTest, ModuleTypeGetAndLookup) {

FILE: test/cir/test.h
  function class (line 7) | class CIRCoreTest : public testing::Test {

FILE: test/cir/transform/manager.cpp
  class DummyResult (line 11) | class DummyResult : public analyze::Result {}
  class DummyAnalysis (line 13) | class DummyAnalysis : public analyze::Analysis {
    method DummyAnalysis (line 20) | explicit DummyAnalysis(int &counter) : counter(counter) {}
    method getKey (line 22) | std::string getKey() const override { return ANALYSIS_KEY; }
    method run (line 24) | std::unique_ptr<analyze::Result> run(const Module *) override {
  class DummyPass (line 32) | class DummyPass : public transform::Pass {
    method DummyPass (line 40) | explicit DummyPass(int &counter, std::string required)
    method getKey (line 43) | std::string getKey() const override { return PASS_KEY; }
    method run (line 45) | void run(Module *) override {
  function TEST_F (line 53) | TEST_F(CIRCoreTest, PassManagerNoInvalidations) {
  function TEST_F (line 67) | TEST_F(CIRCoreTest, PassManagerInvalidations) {

FILE: test/cir/types/types.cpp
  function TEST_F (line 7) | TEST_F(CIRCoreTest, RecordTypeQuery) {
  function TEST_F (line 27) | TEST_F(CIRCoreTest, RefTypeQuery) {
  function TEST_F (line 48) | TEST_F(CIRCoreTest, FuncTypeQuery) {

FILE: test/cir/util/matching.cpp
  function TEST_F (line 7) | TEST_F(CIRCoreTest, MatchingEquivalentVar) {
  function TEST_F (line 15) | TEST_F(CIRCoreTest, MatchingNonEquivalentVar) {
  function TEST_F (line 21) | TEST_F(CIRCoreTest, MatchingEquivalentFunc) {
  function TEST_F (line 54) | TEST_F(CIRCoreTest, MatchingNonEquivalentFunc) {
  function TEST_F (line 88) | TEST_F(CIRCoreTest, MatchingAnyValue) {
  function TEST_F (line 93) | TEST_F(CIRCoreTest, MatchingVarValue) {
  function TEST_F (line 101) | TEST_F(CIRCoreTest, MatchingPointerValue) {
  function TEST_F (line 109) | TEST_F(CIRCoreTest, MatchingSeriesFlow) {
  function TEST_F (line 120) | TEST_F(CIRCoreTest, MatchingIfFlow) {
  function TEST_F (line 131) | TEST_F(CIRCoreTest, MatchingForFlow) {
  function TEST_F (line 144) | TEST_F(CIRCoreTest, MatchingIntConst) {
  function TEST_F (line 152) | TEST_F(CIRCoreTest, MatchingFloatConst) {
  function TEST_F (line 160) | TEST_F(CIRCoreTest, MatchingBoolConst) {
  function TEST_F (line 168) | TEST_F(CIRCoreTest, MatchingStringConst) {
  function TEST_F (line 176) | TEST_F(CIRCoreTest, MatchingAssignInstr) {
  function TEST_F (line 187) | TEST_F(CIRCoreTest, MatchingExtractInstr) {
  function TEST_F (line 201) | TEST_F(CIRCoreTest, MatchingInsertInstr) {
  function TEST_F (line 216) | TEST_F(CIRCoreTest, MatchingCallInstr) {
  function TEST_F (line 232) | TEST_F(CIRCoreTest, MatchingTernaryInstr) {

FILE: test/cir/value.cpp
  function TEST_F (line 5) | TEST_F(CIRCoreTest, ValueQueryMethodsDelegate) {
  function TEST_F (line 33) | TEST_F(CIRCoreTest, ValueReplaceMethodsDelegate) {

FILE: test/cir/var.cpp
  function TEST_F (line 5) | TEST_F(CIRCoreTest, VarQueryMethodsDelegate) {
  function TEST_F (line 14) | TEST_F(CIRCoreTest, VarReplaceMethodsDelegate) {

FILE: test/main.cpp
  class TestOutliner (line 34) | class TestOutliner : public ir::transform::OperatorPass {
    method getKey (line 41) | std::string getKey() const override { return KEY; }
    method handle (line 43) | void handle(ir::SeriesFlow *v) override {
    method handle (line 67) | void handle(ir::ReturnInstr *v) override {
  class TestInliner (line 80) | class TestInliner : public ir::transform::OperatorPass {
    method getKey (line 82) | std::string getKey() const override { return KEY; }
    method handle (line 84) | void handle(ir::CallInstr *v) override {
  type PartitionArgsByEscape (line 104) | struct PartitionArgsByEscape : public ir::util::Operator {
    method handle (line 108) | void handle(ir::CallInstr *v) override {
  type EscapeValidator (line 140) | struct EscapeValidator : public ir::transform::Pass {
    method getKey (line 142) | std::string getKey() const override { return KEY; }
    method EscapeValidator (line 146) | explicit EscapeValidator(const std::string &capAnalysisKey)
    method run (line 149) | void run(ir::Module *m) override {
  function splitLines (line 184) | vector<string> splitLines(const string &output) {
  function findExpectOnLine (line 196) | static pair<bool, string> findExpectOnLine(const string &line) {
  function findExpects (line 206) | static pair<vector<string>, bool> findExpects(const string &filename, bo...
  class SeqTest (line 241) | class SeqTest
    method SeqTest (line 251) | SeqTest() : buf(65536), out_pipe(), pid() {}
    method string (line 252) | string getFilename(const string &basename) {
    method runInChildProcess (line 255) | int runInChildProcess(bool avoidFork = false) {
    method string (line 324) | string result() { return string(buf.data()); }
  function string (line 326) | static string
  function string (line 343) | static string
  function TEST_P (line 347) | TEST_P(SeqTest, Run) {
  function getTypeTests (line 380) | auto getTypeTests(const vector<string> &files) {
  function main (line 599) | int main(int argc, char *argv[]) {

FILE: test/python/cython_jit.py
  class Foo (line 6) | class Foo:
    method __init__ (line 9) | def __init__(self, n):
    method __eq__ (line 14) | def __eq__(self, other):
    method __hash__ (line 19) | def __hash__(self):
    method total (line 23) | def total(self):
    method __init__ (line 126) | def __init__(self):
  function test_convertible (line 26) | def test_convertible():
  function test_many (line 29) | def test_many():
  function test_roundtrip (line 41) | def test_roundtrip():
  function test_return_type (line 64) | def test_return_type():
  function test_param_types (line 82) | def test_param_types():
  function test_error_handling (line 94) | def test_error_handling():
  function foo (line 117) | def foo(y):
  function foo2 (line 122) | def foo2(y):
  class Foo (line 125) | class Foo:
    method __init__ (line 9) | def __init__(self, n):
    method __eq__ (line 14) | def __eq__(self, other):
    method __hash__ (line 19) | def __hash__(self):
    method total (line 23) | def total(self):
    method __init__ (line 126) | def __init__(self):
  function a (line 130) | def a(x):
  function b (line 133) | def b(x, z):
  function c (line 138) | def c(x, y):
  function test_cross_calls (line 142) | def test_cross_calls():
  function d (line 156) | def d(x, y):
  function test_ndarray (line 160) | def test_ndarray():
  function e (line 186) | def e(x=2, y=99):
  function test_arg_order (line 189) | def test_arg_order():

FILE: test/python/find-python-library.py
  function get_python_library (line 3) | def get_python_library(python_version):

FILE: test/python/mymodule.py
  function multiply (line 1) | def multiply(a,b):
  function print_args (line 4) | def print_args(a,b,c,d,e):
  function print_args_var (line 10) | def print_args_var(a,b,c=1,*args,**kwargs):
  function throw_exc (line 13) | def throw_exc():
  function test_call_no_args (line 17) | def test_call_no_args():
  function test_call_one_arg (line 20) | def test_call_one_arg(x):

FILE: test/python/pyext.py
  function equal (line 4) | def equal(v, a, b, tag):
  function test_codon_extensions (line 15) | def test_codon_extensions(m):

FILE: test/python/setup.py
  class CodonExtension (line 42) | class CodonExtension(Extension):
    method __init__ (line 43) | def __init__(self, name, source):
  class BuildCodonExt (line 47) | class BuildCodonExt(build_ext):
    method build_extensions (line 48) | def build_extensions(self):
    method run (line 51) | def run(self):
    method build_codon (line 59) | def build_codon(self, ext):

FILE: test/types.cpp
  function TEST (line 21) | TEST(TypeCoreTest, TestName) { ; }
Condensed preview — 612 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (6,827K chars).
[
  {
    "path": ".clang-format",
    "chars": 39,
    "preview": "---\nBasedOnStyle: LLVM\nColumnLimit: 88\n"
  },
  {
    "path": ".clang-tidy",
    "chars": 563,
    "preview": "---\nChecks: 'clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,modernize-*,bugprone-*,concurrency-*,performance-*,"
  },
  {
    "path": ".gitattributes",
    "chars": 358,
    "preview": "*.codon linguist-language=Python\n\n*.png binary\n*.jpg binary\n*.jpeg binary\n*.gif binary\n*.ico binary\n*.mov binary\n*.mp4 b"
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 119,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      interval: \"monthly\"\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 4451,
    "preview": "name: Codon CI\n\non:\n  push:\n    branches:\n      - master\n      - develop\n    tags:\n      - '*'\n  pull_request:\n    branc"
  },
  {
    "path": ".gitignore",
    "chars": 911,
    "preview": "######################\n# Generic .gitignore #\n######################\n\n# Compiled source #\n###################\n*.com\n*.cl"
  },
  {
    "path": ".pre-commit-config.yaml",
    "chars": 269,
    "preview": "repos:\n  - repo: https://github.com/pre-commit/pre-commit-hooks\n    rev: v4.5.0\n    hooks:\n      - id: trailing-whitespa"
  },
  {
    "path": "CMakeLists.txt",
    "chars": 20124,
    "preview": "cmake_minimum_required(VERSION 3.14)\nproject(\n  Codon\n  VERSION \"0.19.6\"\n  HOMEPAGE_URL \"https://github.com/exaloop/codo"
  },
  {
    "path": "CODEOWNERS",
    "chars": 103,
    "preview": "*                    @arshajii @inumanag\n/codon/              @arshajii\n/codon/parser/       @inumanag\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 2465,
    "preview": "# Contributing to Codon\n\nThank you for considering contributing to Codon! This document contains some helpful informatio"
  },
  {
    "path": "LICENSE",
    "chars": 11357,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "README.md",
    "chars": 9054,
    "preview": "<h1 align=\"center\">\n <img src=\"docs/img/codon-banner.svg\" alt=\"Codon banner\"/>\n</h1>\n\n<h3 align=\"center\">\n  <a href=\"htt"
  },
  {
    "path": "bench/README.md",
    "chars": 3194,
    "preview": "# Codon benchmark suite\n\nThis folder contains a number of Codon benchmarks. Some are taken\nfrom the [pyperformance suite"
  },
  {
    "path": "bench/codon/binary_trees.codon",
    "chars": 1616,
    "preview": "# The Computer Language Benchmarks Game\n# http://benchmarksgame.alioth.debian.org/\n#\n# contributed by Antoine Pitrou\n# m"
  },
  {
    "path": "bench/codon/binary_trees.cpp",
    "chars": 2219,
    "preview": "#include <cassert>\n#include <chrono>\n#include <iostream>\n#include <memory>\n#include <utility>\n#include <vector>\n\nstruct "
  },
  {
    "path": "bench/codon/binary_trees.py",
    "chars": 1654,
    "preview": "# The Computer Language Benchmarks Game\n# http://benchmarksgame.alioth.debian.org/\n#\n# contributed by Antoine Pitrou\n# m"
  },
  {
    "path": "bench/codon/chaos.codon",
    "chars": 9356,
    "preview": "\"\"\"create chaosgame-like fractals\nCopyright (C) 2005 Carl Friedrich Bolz\n\nadapted by @arshajii for Codon\n\"\"\"\n\nimport mat"
  },
  {
    "path": "bench/codon/chaos.py",
    "chars": 8924,
    "preview": "\"\"\"create chaosgame-like fractals\nCopyright (C) 2005 Carl Friedrich Bolz\n\nadapted by @arshajii for Codon\n\"\"\"\n\nimport mat"
  },
  {
    "path": "bench/codon/fannkuch.codon",
    "chars": 810,
    "preview": "# FANNKUCH benchmark\nfrom math import factorial as fact\nfrom sys import argv\nfrom time import time\n\ndef perm(n, i):\n    "
  },
  {
    "path": "bench/codon/fannkuch.py",
    "chars": 770,
    "preview": "# FANNKUCH benchmark\nfrom math import factorial as fact\nfrom sys import argv\nfrom time import time\n\ndef perm(n, i):\n    "
  },
  {
    "path": "bench/codon/float.py",
    "chars": 1096,
    "preview": "from math import sin, cos, sqrt\nfrom time import time\n\nPOINTS = 10000000\n\n\nclass Point:\n    x: float\n    y: float\n    z:"
  },
  {
    "path": "bench/codon/go.codon",
    "chars": 14789,
    "preview": "\"\"\"\nGo board game\n\"\"\"\nimport math\nimport random\nfrom time import time\n\nSIZE = 9\nGAMES = 200\nKOMI = 7.5\nEMPTY, WHITE, BLA"
  },
  {
    "path": "bench/codon/go.py",
    "chars": 13866,
    "preview": "\"\"\"\nGo board game\n\"\"\"\nimport math\nimport random\nfrom time import time\n\nSIZE = 9\nGAMES = 200\nKOMI = 7.5\nEMPTY, WHITE, BLA"
  },
  {
    "path": "bench/codon/mandelbrot.codon",
    "chars": 572,
    "preview": "import time\nMAX    = 1000  # maximum Mandelbrot iterations\nN      = 4096  # width and height of image\npixels = [0 for _ "
  },
  {
    "path": "bench/codon/mandelbrot.py",
    "chars": 545,
    "preview": "import time\nMAX    = 1000  # maximum Mandelbrot iterations\nN      = 4096  # width and height of image\npixels = [0 for _ "
  },
  {
    "path": "bench/codon/nbody.cpp",
    "chars": 4817,
    "preview": "#include <chrono>\n#include <cmath>\n#include <iostream>\n#include <string>\n#include <unordered_map>\n#include <utility>\n#in"
  },
  {
    "path": "bench/codon/nbody.py",
    "chars": 3522,
    "preview": "# The Computer Language Benchmarks Game\n# http://benchmarksgame.alioth.debian.org/\n#\n# originally by Kevin Carson\n# modi"
  },
  {
    "path": "bench/codon/npbench.codon",
    "chars": 20369,
    "preview": "import numpy as np\nfrom numpy.random import default_rng\nimport npbench_lib as bench\nimport time\n\n\ndef run(b, prep, **kwa"
  },
  {
    "path": "bench/codon/npbench_lib.codon",
    "chars": 41718,
    "preview": "# Copyright 2021 ETH Zurich and the NPBench authors. All rights reserved.\n\n__CODON_RET__: Literal[bool] = True\n\nimport n"
  },
  {
    "path": "bench/codon/primes.codon",
    "chars": 351,
    "preview": "from sys import argv\nfrom time import time\n\ndef is_prime(n):\n    factors = 0\n    for i in range(2, n):\n        if n % i "
  },
  {
    "path": "bench/codon/primes.py",
    "chars": 326,
    "preview": "from sys import argv\nfrom time import time\n\ndef is_prime(n):\n    factors = 0\n    for i in range(2, n):\n        if n % i "
  },
  {
    "path": "bench/codon/set_partition.cpp",
    "chars": 2487,
    "preview": "#include <algorithm>\n#include <chrono>\n#include <functional>\n#include <iostream>\n#include <vector>\n\ntemplate <class T> u"
  },
  {
    "path": "bench/codon/set_partition.py",
    "chars": 1594,
    "preview": "# https://stackoverflow.com/questions/73473074/speed-up-set-partition-generation-by-skipping-ones-with-subsets-smaller-o"
  },
  {
    "path": "bench/codon/spectral_norm.py",
    "chars": 1554,
    "preview": "\"\"\"\nMathWorld: \"Hundred-Dollar, Hundred-Digit Challenge Problems\", Challenge #3.\nhttp://mathworld.wolfram.com/Hundred-Do"
  },
  {
    "path": "bench/codon/sum.py",
    "chars": 247,
    "preview": "# https://towardsdatascience.com/getting-started-with-pypy-ef4ba5cb431c\nimport time\nt1 = time.time()\nnums = range(500000"
  },
  {
    "path": "bench/codon/taq.cpp",
    "chars": 3593,
    "preview": "#include <algorithm>\n#include <chrono>\n#include <cmath>\n#include <fstream>\n#include <iostream>\n#include <numeric>\n#inclu"
  },
  {
    "path": "bench/codon/taq.py",
    "chars": 1861,
    "preview": "# Parses TAQ file and performs volume peak detection\nfrom sys import argv\nfrom time import time\nfrom statistics import m"
  },
  {
    "path": "bench/codon/word_count.cpp",
    "chars": 858,
    "preview": "#include <chrono>\n#include <fstream>\n#include <iostream>\n#include <sstream>\n#include <string>\n#include <unordered_map>\n\n"
  },
  {
    "path": "bench/codon/word_count.py",
    "chars": 235,
    "preview": "from sys import argv\nfrom time import time\n\nt0 = time()\nwc = {}\nfilename = argv[-1]\n\nwith open(filename) as f:\n    for l"
  },
  {
    "path": "bench/run.sh",
    "chars": 7060,
    "preview": "# set -x\n\ntrap 'echo Exiting...; exit' INT\n\nget_data() {\n    git clone https://github.com/exaloop/seq\n    mkdir -p test\n"
  },
  {
    "path": "cmake/CMakeRC.cmake",
    "chars": 21551,
    "preview": "# This block is executed when generating an intermediate resource file, not when\n# running in CMake configure mode\nif(_C"
  },
  {
    "path": "cmake/backtrace-config.h.in",
    "chars": 2500,
    "preview": "/* config.h.cmake */\n\n/* ELF size: 32 or 64 */\n#define BACKTRACE_ELF_SIZE ${BACKTRACE_ELF_SIZE}\n\n/* XCOFF size: 32 or 64"
  },
  {
    "path": "cmake/backtrace-supported.h.in",
    "chars": 3036,
    "preview": "/* backtrace-supported.h.cmake -- Whether stack backtrace is supported.\n   Copyright (C) 2012-2016 Free Software Foundat"
  },
  {
    "path": "cmake/config.h.in",
    "chars": 218,
    "preview": "#pragma once\n\n#define CODON_VERSION       \"@PROJECT_VERSION@\"\n#define CODON_VERSION_MAJOR @PROJECT_VERSION_MAJOR@\n#defin"
  },
  {
    "path": "cmake/config.py.in",
    "chars": 231,
    "preview": "__version__         = \"@CODON_JIT_PYTHON_VERSION@\"\nCODON_VERSION       = \"@PROJECT_VERSION@\"\nCODON_VERSION_MAJOR = @PROJ"
  },
  {
    "path": "cmake/deps.cmake",
    "chars": 5638,
    "preview": "set(CPM_DOWNLOAD_VERSION 0.40.8)\nset(CPM_DOWNLOAD_LOCATION \"${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake\""
  },
  {
    "path": "codon/app/main.cpp",
    "chars": 17600,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include <algorithm>\n#include <cstdio>\n#include <cstdlib>\n"
  },
  {
    "path": "codon/cir/analyze/analysis.cpp",
    "chars": 366,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"analysis.h\"\n\n#include \"codon/cir/transform/manag"
  },
  {
    "path": "codon/cir/analyze/analysis.h",
    "chars": 1171,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <memory>\n\n#include \"codon/cir/modul"
  },
  {
    "path": "codon/cir/analyze/dataflow/capture.cpp",
    "chars": 23537,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"capture.h\"\n\n#include <algorithm>\n#include <itera"
  },
  {
    "path": "codon/cir/analyze/dataflow/capture.h",
    "chars": 2750,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <memory>\n#include <unordered_map>\n#"
  },
  {
    "path": "codon/cir/analyze/dataflow/cfg.cpp",
    "chars": 14043,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"cfg.h\"\n\n#include <vector>\n\n#include \"codon/cir/d"
  },
  {
    "path": "codon/cir/analyze/dataflow/cfg.h",
    "chars": 18303,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <iostream>\n#include <list>\n#include"
  },
  {
    "path": "codon/cir/analyze/dataflow/dominator.cpp",
    "chars": 3275,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"dominator.h\"\n\n#include \"codon/cir/llvm/llvm.h\"\n\n"
  },
  {
    "path": "codon/cir/analyze/dataflow/dominator.h",
    "chars": 1735,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <unordered_map>\n#include <unordered"
  },
  {
    "path": "codon/cir/analyze/dataflow/reaching.cpp",
    "chars": 7976,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"reaching.h\"\n\n#include <deque>\n#include <tuple>\n\n"
  },
  {
    "path": "codon/cir/analyze/dataflow/reaching.h",
    "chars": 3437,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <utility>\n\n#include \"codon/cir/anal"
  },
  {
    "path": "codon/cir/analyze/module/global_vars.cpp",
    "chars": 1143,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"global_vars.h\"\n\n#include \"codon/cir/util/operato"
  },
  {
    "path": "codon/cir/analyze/module/global_vars.h",
    "chars": 704,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <unordered_map>\n\n#include \"codon/ci"
  },
  {
    "path": "codon/cir/analyze/module/side_effect.cpp",
    "chars": 11122,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"side_effect.h\"\n\n#include <type_traits>\n#include "
  },
  {
    "path": "codon/cir/analyze/module/side_effect.h",
    "chars": 1586,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <unordered_map>\n\n#include \"codon/ci"
  },
  {
    "path": "codon/cir/attribute.cpp",
    "chars": 7429,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"attribute.h\"\n\n#include \"codon/cir/func.h\"\n#inclu"
  },
  {
    "path": "codon/cir/attribute.h",
    "chars": 10490,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <iostream>\n#include <map>\n#include "
  },
  {
    "path": "codon/cir/base.cpp",
    "chars": 972,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"base.h\"\n\n#include \"codon/cir/types/types.h\"\n#inc"
  },
  {
    "path": "codon/cir/base.h",
    "chars": 11683,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <cstdint>\n#include <memory>\n#includ"
  },
  {
    "path": "codon/cir/cir.h",
    "chars": 344,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/const.h\"\n#include \"codon"
  },
  {
    "path": "codon/cir/const.cpp",
    "chars": 403,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"const.h\"\n\nnamespace codon {\nnamespace ir {\n\ncons"
  },
  {
    "path": "codon/cir/const.h",
    "chars": 2304,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/module.h\"\n#include \"codo"
  },
  {
    "path": "codon/cir/dsl/codegen.h",
    "chars": 1362,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <unordered_map>\n\n#include \"codon/ci"
  },
  {
    "path": "codon/cir/dsl/nodes.cpp",
    "chars": 356,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"nodes.h\"\n\nnamespace codon {\nnamespace ir {\nnames"
  },
  {
    "path": "codon/cir/dsl/nodes.h",
    "chars": 4633,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <memory>\n\n#include \"codon/cir/base."
  },
  {
    "path": "codon/cir/flow.cpp",
    "chars": 7441,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"flow.h\"\n\n#include \"codon/cir/module.h\"\n#include "
  },
  {
    "path": "codon/cir/flow.h",
    "chars": 21168,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <list>\n#include <vector>\n\n#include "
  },
  {
    "path": "codon/cir/func.cpp",
    "chars": 3343,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"func.h\"\n\n#include <algorithm>\n\n#include \"codon/c"
  },
  {
    "path": "codon/cir/func.h",
    "chars": 8205,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/flow.h\"\n#include \"codon/"
  },
  {
    "path": "codon/cir/instr.cpp",
    "chars": 6257,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"instr.h\"\n\n#include \"codon/cir/module.h\"\n#include"
  },
  {
    "path": "codon/cir/instr.h",
    "chars": 19531,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <memory>\n#include <string>\n\n#includ"
  },
  {
    "path": "codon/cir/llvm/gpu.cpp",
    "chars": 34059,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"gpu.h\"\n\n#include <algorithm>\n#include <memory>\n#"
  },
  {
    "path": "codon/cir/llvm/gpu.h",
    "chars": 603,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <string>\n\n#include \"codon/cir/llvm/"
  },
  {
    "path": "codon/cir/llvm/llvisitor.cpp",
    "chars": 125686,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"llvisitor.h\"\n\n#include <algorithm>\n#include <cct"
  },
  {
    "path": "codon/cir/llvm/llvisitor.h",
    "chars": 16634,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/cir.h\"\n#include \"codon/c"
  },
  {
    "path": "codon/cir/llvm/llvm.h",
    "chars": 5032,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"llvm/ADT/BitVector.h\"\n#include \"ll"
  },
  {
    "path": "codon/cir/llvm/native/native.cpp",
    "chars": 3131,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"native.h\"\n\n#include \"codon/cir/llvm/llvm.h\"\n#inc"
  },
  {
    "path": "codon/cir/llvm/native/native.h",
    "chars": 233,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/llvm/llvm.h\"\n\nnamespace "
  },
  {
    "path": "codon/cir/llvm/native/targets/aarch64.cpp",
    "chars": 1754,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"aarch64.h\"\n\n#include \"llvm/TargetParser/AArch64T"
  },
  {
    "path": "codon/cir/llvm/native/targets/aarch64.h",
    "chars": 379,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/llvm/native/targets/targ"
  },
  {
    "path": "codon/cir/llvm/native/targets/arm.cpp",
    "chars": 13028,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"arm.h\"\n\n#include \"llvm/TargetParser/ARMTargetPar"
  },
  {
    "path": "codon/cir/llvm/native/targets/arm.h",
    "chars": 375,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/llvm/native/targets/targ"
  },
  {
    "path": "codon/cir/llvm/native/targets/target.h",
    "chars": 412,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <sstream>\n#include <string>\n\n#inclu"
  },
  {
    "path": "codon/cir/llvm/native/targets/x86.cpp",
    "chars": 2876,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"x86.h\"\n\nnamespace codon {\nnamespace ir {\nnamespa"
  },
  {
    "path": "codon/cir/llvm/native/targets/x86.h",
    "chars": 375,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/llvm/native/targets/targ"
  },
  {
    "path": "codon/cir/llvm/optimize.cpp",
    "chars": 36941,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"optimize.h\"\n\n#include <algorithm>\n#include <dequ"
  },
  {
    "path": "codon/cir/llvm/optimize.h",
    "chars": 736,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <memory>\n\n#include \"codon/cir/llvm/"
  },
  {
    "path": "codon/cir/module.cpp",
    "chars": 16402,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"module.h\"\n\n#include <algorithm>\n#include <memory"
  },
  {
    "path": "codon/cir/module.h",
    "chars": 18848,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <iterator>\n#include <memory>\n#inclu"
  },
  {
    "path": "codon/cir/pyextension.h",
    "chars": 2888,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <string>\n#include <vector>\n\n#includ"
  },
  {
    "path": "codon/cir/transform/cleanup/canonical.cpp",
    "chars": 10563,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"canonical.h\"\n\n#include <algorithm>\n#include <fun"
  },
  {
    "path": "codon/cir/transform/cleanup/canonical.h",
    "chars": 1029,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n#inclu"
  },
  {
    "path": "codon/cir/transform/cleanup/dead_code.cpp",
    "chars": 2552,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"dead_code.h\"\n\n#include \"codon/cir/analyze/module"
  },
  {
    "path": "codon/cir/transform/cleanup/dead_code.h",
    "chars": 1164,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n\nnames"
  },
  {
    "path": "codon/cir/transform/cleanup/global_demote.cpp",
    "chars": 1841,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"global_demote.h\"\n\nnamespace codon {\nnamespace ir"
  },
  {
    "path": "codon/cir/transform/cleanup/global_demote.h",
    "chars": 822,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n\nnames"
  },
  {
    "path": "codon/cir/transform/cleanup/replacer.cpp",
    "chars": 3697,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"replacer.h\"\n\n#include <unordered_set>\n\n#include "
  },
  {
    "path": "codon/cir/transform/cleanup/replacer.h",
    "chars": 503,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n\nnames"
  },
  {
    "path": "codon/cir/transform/folding/const_fold.cpp",
    "chars": 16756,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"const_fold.h\"\n\n#include <cmath>\n#include <utilit"
  },
  {
    "path": "codon/cir/transform/folding/const_fold.h",
    "chars": 812,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <memory>\n#include <unordered_map>\n\n"
  },
  {
    "path": "codon/cir/transform/folding/const_prop.cpp",
    "chars": 3066,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"const_prop.h\"\n\n#include \"codon/cir/analyze/dataf"
  },
  {
    "path": "codon/cir/transform/folding/const_prop.h",
    "chars": 1016,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n\nnames"
  },
  {
    "path": "codon/cir/transform/folding/folding.cpp",
    "chars": 1758,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"folding.h\"\n\n#include \"codon/cir/transform/foldin"
  },
  {
    "path": "codon/cir/transform/folding/folding.h",
    "chars": 1483,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/cleanup/canoni"
  },
  {
    "path": "codon/cir/transform/folding/rule.h",
    "chars": 8041,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <algorithm>\n#include <utility>\n\n#in"
  },
  {
    "path": "codon/cir/transform/lowering/async_for.cpp",
    "chars": 2693,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"async_for.h\"\n\n#include \"codon/cir/util/cloning.h"
  },
  {
    "path": "codon/cir/transform/lowering/async_for.h",
    "chars": 461,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n\nnames"
  },
  {
    "path": "codon/cir/transform/lowering/await.cpp",
    "chars": 3439,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"await.h\"\n\n#include <algorithm>\n\n#include \"codon/"
  },
  {
    "path": "codon/cir/transform/lowering/await.h",
    "chars": 461,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n\nnames"
  },
  {
    "path": "codon/cir/transform/lowering/imperative.cpp",
    "chars": 4493,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"imperative.h\"\n\n#include <algorithm>\n\n#include \"c"
  },
  {
    "path": "codon/cir/transform/lowering/imperative.h",
    "chars": 470,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n\nnames"
  },
  {
    "path": "codon/cir/transform/lowering/pipeline.cpp",
    "chars": 2187,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"pipeline.h\"\n\n#include <algorithm>\n\n#include \"cod"
  },
  {
    "path": "codon/cir/transform/lowering/pipeline.h",
    "chars": 502,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n\nnames"
  },
  {
    "path": "codon/cir/transform/manager.cpp",
    "chars": 8402,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"manager.h\"\n\n#include <unordered_set>\n\n#include \""
  },
  {
    "path": "codon/cir/transform/manager.h",
    "chars": 6276,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <algorithm>\n#include <memory>\n#incl"
  },
  {
    "path": "codon/cir/transform/numpy/expr.cpp",
    "chars": 30824,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"numpy.h\"\n\n#include \"codon/cir/util/irtools.h\"\n\nn"
  },
  {
    "path": "codon/cir/transform/numpy/forward.cpp",
    "chars": 10941,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"numpy.h\"\n\nnamespace codon {\nnamespace ir {\nnames"
  },
  {
    "path": "codon/cir/transform/numpy/indexing.cpp",
    "chars": 13234,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"indexing.h\"\n\n#include \"codon/cir/analyze/dataflo"
  },
  {
    "path": "codon/cir/transform/numpy/indexing.h",
    "chars": 861,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"codon/cir/transform/pass.h\"\n#include \"codon/cir/"
  },
  {
    "path": "codon/cir/transform/numpy/numpy.cpp",
    "chars": 32072,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"numpy.h\"\n\n#include \"codon/cir/analyze/dataflow/r"
  },
  {
    "path": "codon/cir/transform/numpy/numpy.h",
    "chars": 7776,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/analyze/dataflow/reachin"
  },
  {
    "path": "codon/cir/transform/parallel/openmp.cpp",
    "chars": 55447,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"openmp.h\"\n\n#include <algorithm>\n#include <iterat"
  },
  {
    "path": "codon/cir/transform/parallel/openmp.h",
    "chars": 591,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n\nnames"
  },
  {
    "path": "codon/cir/transform/parallel/schedule.cpp",
    "chars": 2503,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"schedule.h\"\n\n#include \"codon/cir/cir.h\"\n#include"
  },
  {
    "path": "codon/cir/transform/parallel/schedule.h",
    "chars": 1096,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/value.h\"\n\nnamespace codo"
  },
  {
    "path": "codon/cir/transform/pass.cpp",
    "chars": 581,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"pass.h\"\n\n#include \"codon/cir/transform/manager.h"
  },
  {
    "path": "codon/cir/transform/pass.h",
    "chars": 2448,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/module.h\"\n#include \"codo"
  },
  {
    "path": "codon/cir/transform/pythonic/dict.cpp",
    "chars": 4681,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"dict.h\"\n\n#include <algorithm>\n\n#include \"codon/c"
  },
  {
    "path": "codon/cir/transform/pythonic/dict.h",
    "chars": 646,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n\nnames"
  },
  {
    "path": "codon/cir/transform/pythonic/generator.cpp",
    "chars": 6947,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"generator.h\"\n\n#include <algorithm>\n\n#include \"co"
  },
  {
    "path": "codon/cir/transform/pythonic/generator.h",
    "chars": 626,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n\nnames"
  },
  {
    "path": "codon/cir/transform/pythonic/io.cpp",
    "chars": 2716,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"io.h\"\n\n#include <algorithm>\n\n#include \"codon/cir"
  },
  {
    "path": "codon/cir/transform/pythonic/io.h",
    "chars": 533,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n\nnames"
  },
  {
    "path": "codon/cir/transform/pythonic/list.cpp",
    "chars": 8437,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"list.h\"\n\n#include <algorithm>\n\n#include \"codon/c"
  },
  {
    "path": "codon/cir/transform/pythonic/list.h",
    "chars": 572,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n\nnames"
  },
  {
    "path": "codon/cir/transform/pythonic/str.cpp",
    "chars": 1866,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"str.h\"\n\n#include <algorithm>\n\n#include \"codon/ci"
  },
  {
    "path": "codon/cir/transform/pythonic/str.h",
    "chars": 509,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n\nnames"
  },
  {
    "path": "codon/cir/transform/rewrite.h",
    "chars": 1894,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/transform/pass.h\"\n#inclu"
  },
  {
    "path": "codon/cir/types/types.cpp",
    "chars": 6686,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"types.h\"\n\n#include <algorithm>\n#include <memory>"
  },
  {
    "path": "codon/cir/types/types.h",
    "chars": 18281,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <algorithm>\n#include <memory>\n#incl"
  },
  {
    "path": "codon/cir/util/cloning.cpp",
    "chars": 9744,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"cloning.h\"\n\n#include \"codon/cir/util/operator.h\""
  },
  {
    "path": "codon/cir/util/cloning.h",
    "chars": 4727,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <unordered_map>\n\n#include \"codon/ci"
  },
  {
    "path": "codon/cir/util/context.h",
    "chars": 910,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <vector>\n\nnamespace codon {\nnamespa"
  },
  {
    "path": "codon/cir/util/format.cpp",
    "chars": 17282,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include <algorithm>\n#include <fmt/format.h>\n#include <fmt"
  },
  {
    "path": "codon/cir/util/format.h",
    "chars": 550,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <iostream>\n\n#include \"codon/cir/cir"
  },
  {
    "path": "codon/cir/util/inlining.cpp",
    "chars": 3637,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"inlining.h\"\n\n#include <algorithm>\n\n#include \"cod"
  },
  {
    "path": "codon/cir/util/inlining.h",
    "chars": 1131,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/cir.h\"\n\nnamespace codon "
  },
  {
    "path": "codon/cir/util/irtools.cpp",
    "chars": 7071,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"irtools.h\"\n\n#include <iterator>\n\nnamespace codon"
  },
  {
    "path": "codon/cir/util/irtools.h",
    "chars": 8251,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/cir.h\"\n\nnamespace codon "
  },
  {
    "path": "codon/cir/util/iterators.h",
    "chars": 4262,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <iterator>\n#include <memory>\n#inclu"
  },
  {
    "path": "codon/cir/util/matching.cpp",
    "chars": 11249,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"matching.h\"\n\n#include <algorithm>\n\n#include \"cod"
  },
  {
    "path": "codon/cir/util/matching.h",
    "chars": 1419,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/cir.h\"\n\nnamespace codon "
  },
  {
    "path": "codon/cir/util/operator.h",
    "chars": 6426,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <unordered_set>\n\n#include \"codon/ci"
  },
  {
    "path": "codon/cir/util/outlining.cpp",
    "chars": 13438,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"outlining.h\"\n\n#include <iterator>\n#include <unor"
  },
  {
    "path": "codon/cir/util/outlining.h",
    "chars": 3370,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/cir.h\"\n\nnamespace codon "
  },
  {
    "path": "codon/cir/util/packs.h",
    "chars": 950,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <vector>\n\nnamespace codon {\nnamespa"
  },
  {
    "path": "codon/cir/util/side_effect.cpp",
    "chars": 814,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"side_effect.h\"\n#include \"codon/parser/common.h\"\n"
  },
  {
    "path": "codon/cir/util/side_effect.h",
    "chars": 1133,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <string>\n\nnamespace codon {\nnamespa"
  },
  {
    "path": "codon/cir/util/visitor.cpp",
    "chars": 8375,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"visitor.h\"\n\n#include \"codon/cir/cir.h\"\n\nnamespac"
  },
  {
    "path": "codon/cir/util/visitor.h",
    "chars": 5469,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <memory>\n#include <stdexcept>\n#incl"
  },
  {
    "path": "codon/cir/value.cpp",
    "chars": 3899,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"value.h\"\n\n#include \"codon/cir/instr.h\"\n#include "
  },
  {
    "path": "codon/cir/value.h",
    "chars": 3874,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/base.h\"\n#include \"codon/"
  },
  {
    "path": "codon/cir/var.cpp",
    "chars": 1028,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"var.h\"\n\n#include \"codon/cir/module.h\"\n\nnamespace"
  },
  {
    "path": "codon/cir/var.h",
    "chars": 6299,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <memory>\n#include <string>\n#include"
  },
  {
    "path": "codon/compiler/compiler.cpp",
    "chars": 6438,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"compiler.h\"\n\n#include \"codon/compiler/error.h\"\n#"
  },
  {
    "path": "codon/compiler/compiler.h",
    "chars": 2835,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <memory>\n#include <string>\n#include"
  },
  {
    "path": "codon/compiler/debug_listener.cpp",
    "chars": 7649,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"debug_listener.h\"\n\n#include <algorithm>\n#include"
  },
  {
    "path": "codon/compiler/debug_listener.h",
    "chars": 3467,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <map>\n#include <memory>\n#include <m"
  },
  {
    "path": "codon/compiler/engine.cpp",
    "chars": 2494,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"engine.h\"\n\n#include \"codon/cir/llvm/optimize.h\"\n"
  },
  {
    "path": "codon/compiler/engine.h",
    "chars": 797,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <memory>\n#include <vector>\n\n#includ"
  },
  {
    "path": "codon/compiler/error.cpp",
    "chars": 1531,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"error.h\"\n\nnamespace codon {\n\nSrcInfo::SrcInfo(st"
  },
  {
    "path": "codon/compiler/error.h",
    "chars": 17783,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <string>\n#include <unordered_set>\n#"
  },
  {
    "path": "codon/compiler/jit.cpp",
    "chars": 13860,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"jit.h\"\n\n#include <sstream>\n\n#include \"codon/pars"
  },
  {
    "path": "codon/compiler/jit.h",
    "chars": 3474,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <memory>\n#include <string>\n#include"
  },
  {
    "path": "codon/compiler/jit_extern.h",
    "chars": 705,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <stddef.h>\n#include <stdint.h>\n\n#if"
  },
  {
    "path": "codon/compiler/memory_manager.cpp",
    "chars": 8657,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"memory_manager.h\"\n\n#include \"codon/runtime/lib.h"
  },
  {
    "path": "codon/compiler/memory_manager.h",
    "chars": 1872,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <mutex>\n#include <utility>\n#include"
  },
  {
    "path": "codon/config/.gitignore",
    "chars": 17,
    "preview": "*\n*/\n!.gitignore\n"
  },
  {
    "path": "codon/dsl/dsl.h",
    "chars": 2375,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"codon/cir/cir.h\"\n#include \"codon/c"
  },
  {
    "path": "codon/dsl/plugins.cpp",
    "chars": 4261,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"plugins.h\"\n\n#include <cstdlib>\n#include <semver."
  },
  {
    "path": "codon/dsl/plugins.h",
    "chars": 1754,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <functional>\n#include <memory>\n#inc"
  },
  {
    "path": "codon/parser/ast/attr.cpp",
    "chars": 129,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"attr.h\"\n\nnamespace codon::ast {} // namespace co"
  },
  {
    "path": "codon/parser/ast/attr.h",
    "chars": 1062,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\nnamespace codon::ast {\n\nconstexpr int INDENT"
  },
  {
    "path": "codon/parser/ast/error.h",
    "chars": 4859,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include \"llvm/Support/Error.h\"\n#include <st"
  },
  {
    "path": "codon/parser/ast/expr.cpp",
    "chars": 24436,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"expr.h\"\n\n#include <algorithm>\n#include <iterator"
  },
  {
    "path": "codon/parser/ast/expr.h",
    "chars": 19738,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <memory>\n#include <ostream>\n#includ"
  },
  {
    "path": "codon/parser/ast/node.h",
    "chars": 3396,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <ostream>\n#include <string>\n\n#inclu"
  },
  {
    "path": "codon/parser/ast/stmt.cpp",
    "chars": 27363,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include \"stmt.h\"\n\n#include <memory>\n#include <string>\n#in"
  },
  {
    "path": "codon/parser/ast/stmt.h",
    "chars": 21079,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <memory>\n#include <ostream>\n#includ"
  },
  {
    "path": "codon/parser/ast/types/class.cpp",
    "chars": 12473,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include <memory>\n#include <string>\n#include <vector>\n\n#in"
  },
  {
    "path": "codon/parser/ast/types/class.h",
    "chars": 3011,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <string>\n#include <unordered_map>\n#"
  },
  {
    "path": "codon/parser/ast/types/function.cpp",
    "chars": 7582,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include <memory>\n#include <string>\n#include <vector>\n\n#in"
  },
  {
    "path": "codon/parser/ast/types/function.h",
    "chars": 1819,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#pragma once\n\n#include <memory>\n#include <string>\n#include"
  },
  {
    "path": "codon/parser/ast/types/link.cpp",
    "chars": 8784,
    "preview": "// Copyright (C) 2022-2026 Exaloop Inc. <https://exaloop.io>\n\n#include <memory>\n#include <string>\n#include <vector>\n\n#in"
  }
]

// ... and 412 more files (download for full content)

About this extraction

This page contains the full source code of the exaloop/codon GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 612 files (6.3 MB), approximately 1.7M tokens, and a symbol index with 2352 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!