def add_saturate(a, b, upper_bound, lower_bound):
    """
        Returns the saturated result of an addition of two values a and b

        Parameters
        ----------
        a : Integer
            First summand
        b : Integer
            Second summand
        upper_bound : Integer
            Upper bound for the addition
        lower_bound : Integer
            Lower bound for the addition
    """
    c = int(a) + int(b)
    if c > upper_bound:
        c = upper_bound
    elif c < lower_bound:
        c = lower_bound
    return c