Suitable form for discussing and optimizing small programs to help improving compiler/optimizer/stdlib?

For anyone interested in such teaching, here's an opportunity to guide us through a small practical example!

(I roughly know how to use Instruments (I think), using High Frequency recording in Timed profiling and/or Counters, but more often than not, I end up getting jumbled/confusing results, pointing to the wrong lines in the code even though I use -g, and I know there are swiftc -emit-sil and -emit-assembly etc, but I'm unable to make much sense of the output. I used to do some x86 asm programming as a kid and while studying computer science.)