You can do this question with your intuition also.
See the first for loop. We know that we are calling the function by function(n/2). Reducing the function exponentially. That is it will run for a time complexity of O(log n).
The second loop will obviously run for n*n.
So the total time complexity will be O(n2 log n) .
Well if you don't get it, go ahead with the conventional way. I just told with respect of exam point of view.