def parse_line(line):
    """
    Parses a log line and returns its components
    :param line:
    :return: tuple
    """
    addr, insn, insnty, val, flow = "", "", "", "", ""

    parts = line.rstrip().split(" | ")

    if len(parts) == 5:
        addr, insn, insnty, val, flow = parts
    elif len(parts) == 4:
        addr, insnty, val, flow = parts
    elif len(parts) == 2:
        addr, flow = parts
    else:
        raise Exception("Incorrect line format: {}".format(line))

    return addr, insn, insnty, val, flow