It should be $O(n)$.
It can be written as:
while(n > 1){
for(i = 1; i <= n; i++)
temp = temp + 1;
n = n / 2;
}
It should be $O(n)$. What I forgot was that the inner value of $n$ will also change.
So the first time, it will run $n$ times, then $n/2$ times and so on, thus making it $O(n).$