def intcode(x):
    """Function that computes the intcode for the list x."""

    # Traverse x with a stride of 4
    for i in range(0, len(x), 4):
        # Kill the program
        if x[i] == 99:
            return x[0]
        # Addition
        elif x[i] == 1:
            x[x[i + 3]] = x[x[i + 1]] + x[x[i + 2]]
        # Multiplication
        elif x[i] == 2:
            x[x[i + 3]] = x[x[i + 1]] * x[x[i + 2]]

    # Reached the end
    return x[0]