Use unbuffered I/O. This reduces the runtime by about half. Our implementation is now only about 5 times slower than gcc's.