for(a = c; a > 0; a/=2)
for(b=0; b < 2*a; b++)
I have reached the conclusion that this is O(nlogn) runtime but I'm not sure.. My logic is that the outermost for-loop runs logn times as its being divided by 2 every time, and then the innermost for-loop runs 2 times the halved number; therefore it runs n times.