>>5I guess the printf-to-puts optimisation was simple enough to do, so they included it.
>>6It is returning the value of
puts
in this case; otherwise there would be a
xor eax, eax
(and it would not be a tail call.)
Why they didn't choose to not emit the other 3 useless instructions is not so easy to explain, but I bet it has to do with some stupid design that dates back to RMS and the early days of non-dataflow compilers.