def compute_spiral_diagonal_sum(first_elem, loop_wh):
    """
    Compute the sum of the four diagonal elements for the given loop
    first_elem: First element (in the right-most, second-down element of this loop)
    loop_wh: Width / height of the spiral's loop to compute the diag-sum
    return: sum of the four diagonal elements
    """
    lower_right = first_elem + loop_wh - 2
    return 4 * lower_right + 6 * loop_wh - 6