But, the compiler if fighting me, not liking the jump in the inline code (it basically does not see the jumps and optimizes out all the code!
We do not allow you to change control flow using inline assembly. It's not a matter of "not liking the jump". We simply don't allow control flow changes through inline assembly. This is relatively common among other compilers, AFAIK.