rename state INPUT to _INPUT for mingw-w64
set stdin/stdout to binary mode on windows