Well, the while loop runs in O(logm), where the log has a base of 3 and after the while loop, the outer for loop runs a constant number of times <= 100, and the inner for loop runs in O(logn), where the log has a base of 2.
Because it runs in O(1), the outer for loop can be ingnored( complexity means ignoring the constants and studying growth, not the number of steps in which an algorithm executes! ); the algorithm has O(logm + logn) complexity because first you have the while in O(logm) and after that the for in O(logn)( you do nat have the for inside the while to multiply them ).