Can you please avoid code like this? It is ugly, and I don't think there is a good reason for it to be ugly. Are you sure clang is incapable of optimizing `memcmp` with a constant by itself? Even if currently it does not do this — are you sure it never will? Is this really a measurable bottleneck when reading files from a disk? And if it really is — is it the best way to avoid it? I doubt it.

Sorry for the rant — but I really dislike such «clever» code and do not think it is warranted here.