@Rufflewind had it right in the comments, you have to substitute the function call - think closer to copy/pasting the subfunction into the main function. This can get a bit nasty when you have recursive calls, as you might guess.
One important thing to keep in mind is the "what" of your analysis. Usually big-O style runtime analysis picks a certain number of operations to measure - swaps, additions, multiplications, etc. You may have cases where the subfunction does work, but none of the operations being measured, in which case it should drop out of analysis.
So it looks like in your example that the outer loop would be O(N) if the subfunction did "no work", but when you substitute it, you'll end up with some O(N^2) type of operation.