RIIR

Rewrite it in rust.