I'm not well versed in that area. Looks like the compiler is doing something differently when you free up a registry space, but it's still slower.
int tailing_binary_search(int *array, int array_size, int key)
{
register int bot, mid, i;
if (key < array\[0\])
{
return -1;
}
bot = 0;
i = array\_size - 1;
mid = i / 2;
while (bot + 7 < i)
{
if (key < array\[mid\])
{
i = mid - 1;
mid -= (i - bot) / 2;
}
else
{
bot = mid;
mid += (i - bot) / 2;
}
}
while (key < array\[i\]) --i;
if (key == array\[i\])
{
return i;
}
return -1;
}