This:
testl %esi, %esi
jle .L3
movl %esi, %eax
If testl
do a logical AND on esi
the result can't never be less but only equals, either if esi
is 0. In this way movl
can't be reached. It's that true, or I'm missing somethings.
Step two:
f1:
pushq %rbp
movq %rsp, %rbp
testl %esi, %esi
jle .L3
movl %esi, %eax
.L2:
incb (%rdi)
incq %rdi
decq %rax
jne .L2
.L3:
popq %rbp
ret
In a hypothetical C translation if .L3
consists of pop
then ret
and the branch take place it's possible to determine the value returned by the function?