It depends on your optimizations. If you have full optimizations and the compiler can prove that removing the initial if will not change the output of the function, then yes it may remove it.
In the exact code sample you provided, I would venture that the compiler could indeed optimize the first if away.