Given the code:
uint64_t f() { return 42; }
compilers output the following assembly for x86-64:
movl $42, %eax
ret
I'm raising my eyebrows, because the return value should be 64-bit, but the compilers appear to think it is safe to assume that the return registers %rax and %rdi are zero. I'm seem to be unable to find anything about this in the x86-64 ABI. Can somebody point to the basis for this assumption?