def load_input_segs(cand_segs, ref_segs, src_segs=None):
    """
    Load input files specified in the CL arguments into memory.

    Returns a list of 5-tuples: (segment_id, origin, src_segment,
                                 candidate_segment, reference_segment)
    "origin" is always None (present for compatibility with other modules handling sdlxliff files).
    "src_segment" is None if the source file was not passed on the CL.
    """
    # src file is optional
    src_segs = src_segs or [None] * len(cand_segs)
    assert len(src_segs) == len(cand_segs) == len(ref_segs)
    return [(i, None, src.strip() if src else src, cand.strip(), ref.strip())
            for i, (src, cand, ref)
            in enumerate(zip(src_segs, cand_segs, ref_segs), 1)]