Deleting this if the check seems can fix the preemption for the example and pass all tests as well.
This is definitely incorrect. There are various non-preemptible regions, which are marked with -2.
There is a known issue that the very last instruction in a function is marked non-preemptible. For this particular function, that is the loop back-edge, making the empty loop hardly preemptible (which we should fix). However, it should be more preemptible in real code with non-empty loops.