These are simplified examples I came up with to go along with William Woodruff's excellent blog post on x86-64 addressing modes.
All the examples are compiled with GCC -O3 or -Os, which is indicative of what the compiler thinks the best option is in practice.
Use case: Indexing into a byte array (whose address is not fixed)
char f(char buf[], int index)