  We present the first high performance compiler for very large scale quantum
error correction: it translates an arbitrary quantum circuit to surface code
operations based on lattice surgery. Our compiler offers an end to end error
correction workflow implemented by a pluggable architecture centered around an
intermediate representation of lattice surgery instructions. Moreover, the
compiler supports customizable circuit layouts, can be used for quantum
benchmarking and includes a quantum resource estimator. The compiler can
process millions of gates using a streaming pipeline at a speed geared towards
real-time operation of a physical device. We compiled within seconds 80 million
logical surface code instructions, corresponding to a high precision Clifford+T
implementation of the 128-qubit Quantum Fourier Transform (QFT). Our code is
open-sourced at \url{https://github.com/latticesurgery-com}.
