import textwrap


def reflow(text, width, protect):
    """Reflow the given `text` with line width `width`

    Return unchanged `text` if `protect` is True.
    """
    if protect:
        return text
    else:
        dedented_text = textwrap.dedent(text.strip())
        wrapped_text = textwrap.fill(
            dedented_text, width=width, break_on_hyphens=False,
            break_long_words=False)
        return wrapped_text