def same_orientation(lineA, lineB):
    """Return whether two paired end reads are of the same orientation."""

    # SAM flags
    reverse = 16
    mate_reverse = 32

    flagA = int(lineA.split()[11])
    flagB = int(lineB.split()[11])

    return ((flagA & reverse) == (flagB & reverse) and
            (flagA & mate_reverse) == (flagB & mate_reverse))