It's always kinda humbling to see how much performance is still left on the table in some base/core libraries everyone uses. It'd be nice to have seen what the compiler output is in comparison - and explore if there is a way to reorganize the code to "coerce" the compiler to output something similar.
The few times I've had to do similar things - I usually work by tweaking the code to give me the desired compiler output and I really try to avoid inline assembly. This usually helps me learn some limitations of C/C++ and what the compiler can deduce