<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def max_or(a, b, c, d, w):
 """ Upper bound of result of ORing 2-intervals. :param a: Lower bound of first interval :param b: Upper bound of first interval :param c: Lower bound of second interval :param d: Upper bound of second interval :param w: bit width :return: Upper bound of ORing 2-intervals """

        m = (1 << (w - 1))
        while m != 0:
            if (b & d & m) != 0:
                temp = (b - m) | (m - 1)
                if temp >= a:
                    b = temp
                    break
                temp = (d - m) | (m - 1)
                if temp >= c:
                    d = temp
                    break
            m >>= 1
        return b | d