The programmer probably wrote memcmp(pass, buf, 5) which compilers will often fold into an inlined loop, or a few comparisons if they know the 3rd arg.
The weird thing is it didn't emit a 32-bit load+compare for the first 4 bytes, this could probably be done with 2 comparsions. Idk. Maybe weird CPU with stricter alignment rules.