I use Kobo with Pocket integration for exactly this! Just install the extension, click the button, refresh on your e-reader and get reading :) It doesn't work for every page but it has been really useful for me.
Interestingly I couldn't get it to fail on GCC (even with -fnoexceptions and -Ofast), only on Clang. Maybe someone else has some info as to why this is?
There is a clear difference in the assembly output for the correct and incorrect implementations, with a testb instruction run much earlier in the correct version. You can see this at line 22 of the output, if you highlight it the && in the source is highlighted in bold.