def parse_program(filename):
    """
    Load the program from FILENAME into a list of lists.  Capture the IP
    register and return both.
    """
    ip_register = None
    program = list()

    with open(filename) as f:
        for line in f:
            if line.startswith('#ip '):
                ip_register = int(line.rstrip()[len('#ip '):])
            else:
                opcode, a, b, c = line.rstrip().split(' ')
                program.append([opcode, int(a), int(b), int(c)])

    return [ip_register, program]