Generate a Python program that has the following intention:

The program defines a recursive algorithm for finding the index of a given element in a sorted array. The algorithm is known as the binary search algorithm, and it works by dividing the array in half repeatedly until it finds the element or determines that it is not present.

The intention of the program is to implement this algorithm in a way that is efficient and easy to understand. The function p1 is the outer function that calls the inner function p2 to perform the actual search.

The function p2 takes three arguments: start, end, and arr. start and end are the current left and right bounds of the search, and arr is the array being searched. The function p2 recursively calls itself, using the current bounds and the array, to search the array.

The core of the algorithm is the if statement in p2. This statement checks if the element being searched for is present at the current midpoint, and if so, returns the index. If the element is not present, the statement checks if the element is less than the current midpoint and recursively calls p2 with the new bounds, or if the element is greater than the current midpoint and recursively calls p2 with the new bounds.

The program terminates when the if statement returns -1, which indicates that the element is not present in the array. The final return value of the p1 function is the index of the element, if it is present, or -1 if it is not present. Provide your response in exactly 3 paragraphs (separated nearby paragraphs with 3 aterisk symbols ***).
user