(cur_statements, cur_statement, deferred_statements)))
        cur_statements.append(''.join(cur_statement))
        for i in deferred_statements:
            cur_statements.append(''.join(i))
        ret.extend(list(minimize_lifted_statements(cur_statements)))
    ret = ''.join(ret)
    if ret == contents:
        return
    if kwargs['inplace']:
        do_backup = kwargs['suffix'] is not None and len(kwargs['suffix']) > 0
        write_to_file(filename,
                      ret,
                      do_backup=do_backup,
                      backup_ext=kwargs['suffix'])
    else:
        print(ret)


if __name__ == '__main__':
    args = process_logging_arguments(parser.parse_args())
    env = {
        'verbose': args.verbose,
        'log': args.log,
        'inplace': args.suffix !=
        '',  # it's None if they passed no argument, and '' if they didn't pass -i
        'suffix': args.suffix,
    }

    for f in args.input_files:
        move_from_proof(f, **env)
                    help='The path to a folder containing the coqc and coqtop programs.')
parser.add_argument('--coqc', metavar='COQC', dest='coqc', type=str, default='coqc',
                    help='The path to the coqc program.')
parser.add_argument('--coqtop', metavar='COQTOP', dest='coqtop', type=str, default=DEFAULT_COQTOP,
                    help=('The path to the coqtop program (default: %s).' % DEFAULT_COQTOP))
parser.add_argument('--coqc-args', metavar='ARG', dest='coqc_args', type=str, nargs='?',
                    help='Arguments to pass to coqc; e.g., " -indices-matter" (leading and trailing spaces are stripped)')
parser.add_argument('--coqtop-args', metavar='ARG', dest='coqtop_args', type=str, nargs='?',
                    help='Arguments to pass to coqtop; e.g., " -indices-matter" (leading and trailing spaces are stripped)')
parser.add_argument('--coq_makefile', metavar='COQ_MAKEFILE', dest='coq_makefile', type=str, default='coq_makefile',
                    help='The path to the coq_makefile program.')
add_libname_arguments(parser)
add_logging_arguments(parser)

if __name__ == '__main__':
    args = process_logging_arguments(parser.parse_args())

    env = {
        'verbose': args.verbose,
        'log': args.log,
        'coqc': (args.coqc if args.coqbin == '' else os.path.join(args.coqbin, args.coqc)),
        'absolutize': args.absolutize,
        'as_modules': args.wrap_modules,
        'fast': args.fast_merge_imports,
        'coq_makefile': args.coq_makefile,
        'walk_tree': args.walk_tree
        }
    update_env_with_libnames(env, args)

    filename = args.input_file.name
    args.input_file.close()