I love how easy it is to view the machine code for a function. Julia actually ships with a handful of these introspection macros: https://docs.julialang.org/en/v1/devdocs/reflection/#Interme.... They are invaluable when it comes to optimization.
Note that the 'manual dispatch' is optimized out in a very early stage:
julia> @code_typed foo(1)
CodeInfo(
1 ─ return 2
) => Int64
So, no need to look at assembly here.