Cloned from https://gitlab.com/hatsya/open-source/f2reduce at revision
949b91d022c001bbce19157f806013d37f05fbf5.
